Files
dsserver/plugin/admin/app/controller/DeviceStatusController.php
zimoyin 13fd9c5f0a init
2026-04-06 20:48:32 +08:00

87 lines
2.5 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace plugin\admin\app\controller;
use plugin\admin\app\service\DeviceStatusService;
use support\Response;
/**
* 设备情况管理(参照旧系统 device.tpl.html
*/
class DeviceStatusController extends Base
{
private DeviceStatusService $service;
public function __construct()
{
$this->service = new DeviceStatusService();
}
public function index(): Response
{
return raw_view('device-status/index');
}
/**
* 获取设备按钮列表(带数据权限)
*/
public function getDeviceNameList(): Response
{
return json(['code' => 0, 'data' => $this->service->getDeviceNameList()]);
}
/**
* 获取设备基本信息
*/
public function getDeviceBasicInfo(): Response
{
$deviceId = request()->get('id') ? (int)request()->get('id') : null;
return json(['code' => 0, 'data' => $this->service->getDeviceBasicInfo($deviceId)]);
}
/**
* 获取设备灭菌次数及合规次数
*/
public function getDeviceRunInfo(): Response
{
$deviceId = request()->get('id') ? (int)request()->get('id') : null;
return json(['code' => 0, 'data' => $this->service->getDeviceRunInfo($deviceId)]);
}
/**
* 获取设备预警次数(按类型分)
*/
public function getDeviceWarnInfo(): Response
{
$deviceId = request()->get('id') ? (int)request()->get('id') : null;
return json(['code' => 0, 'data' => $this->service->getDeviceWarnInfo($deviceId)]);
}
/**
* 获取设备最近周期运行折线图数据
*/
public function getDeviceCycleRunLine(): Response
{
$deviceId = request()->get('id') ? (int)request()->get('id') : null;
return json(['code' => 0, 'data' => $this->service->getDeviceCycleRunLine($deviceId)]);
}
/**
* 获取设备最近周期运行列表(右侧小表格)
*/
public function getDeviceCycleRunList(): Response
{
$deviceId = request()->get('id') ? (int)request()->get('id') : null;
return json(['code' => 0, 'data' => $this->service->getDeviceCycleRunList($deviceId)]);
}
/**
* 获取该设备下所有周期运行信息(操作记录)
*/
public function getDeviceAllCycleInfo(): Response
{
$deviceId = request()->get('id') ? (int)request()->get('id') : null;
return json(['code' => 0, 'data' => $this->service->getDeviceAllCycleInfo($deviceId)]);
}
}