This commit is contained in:
zimoyin
2026-04-06 20:48:32 +08:00
parent 76e9f24aa7
commit 13fd9c5f0a
77 changed files with 6034 additions and 42 deletions
-39
View File
@@ -19,45 +19,6 @@ class Base extends Model
*/
protected $connection = 'plugin.admin.mysql';
/**
* --------------------------
* 【核心配置】权限规则配置
* 新增规则只需在这里加一项,无需改下面的逻辑
* --------------------------
*/
protected function getPermissionRules(): array
{
return [
// 规则1:医院权限
'hospital' => [
'table' => 'opm_mw_hospital', // 表名
'admin_attr' => 'hospitals', // 用户属性里的键($admin['hospitals']
'permission_field'=> 'id', // 表中用于权限过滤的字段
'related_field' => null, // 关联上级权限的字段(如科室关联医院的organ_id)
'related_rule' => null, // 关联的上级规则key(对应上面的'hospital'
],
// 规则2:科室权限
'department' => [
'table' => 'opm_mw_department',
'admin_attr' => 'departments',
'permission_field'=> 'id',
'related_field' => 'organ_id', // 科室通过organ_id关联医院
'related_rule' => 'hospital', // 关联上级规则:医院
],
// 规则3:数据权限
// 这个需要绑定 医院的.id
// 这个需要绑定 科室的.id
'data' => [
'table' => 'opm_mw_info_data',
'admin_attr' => 'data',
'permission_field'=> 'id',
'related_field' => null,
'related_rule' => null,
],
];
}
/**
* 格式化日期
*/
+41
View File
@@ -0,0 +1,41 @@
<?php
namespace plugin\admin\app\model;
use support\Model;
/**
* OpmDsAuth 模型
* 表说明:opm_ds_auth 数据表模型
* 对应数据表:opm_ds_auth
* @property string $id id(非空,主键)
* @property int $role_id role_id
* @property string $menu_id menu_id
* @property string $created_at created_at
*/
class OpmDsAuth extends Model
{
/**
* 数据表名
* @var string
*/
protected $table = 'opm_ds_auth';
/**
* 主键字段名
* @var string
*/
protected $pk = 'id';
/**
* 关闭自动时间戳(如需开启请改为 true,需确保表有 create_time/update_time 字段)
* @var bool
*/
protected $autoWriteTimestamp = false;
/**
* 字段严格检查(false=允许操作未定义字段)
* @var bool
*/
protected $strict = false;
}
+43
View File
@@ -0,0 +1,43 @@
<?php
namespace plugin\admin\app\model;
use plugin\admin\app\model\Base;
/**
* OpmDsCamera 模型
* 表说明:opm_ds_camera 数据表模型
* 对应数据表:opm_ds_camera
* @property string $id id(非空,主键)
* @property int $hospital_id hospital_id
* @property int $department_id department_id
* @property string $url url
* @property string $name name
* @property string $created_at created_at
*/
class OpmDsCamera extends Base
{
/**
* 数据表名
* @var string
*/
protected $table = 'opm_ds_camera';
/**
* 主键字段名
* @var string
*/
protected $pk = 'id';
/**
* 关闭自动时间戳(如需开启请改为 true,需确保表有 create_time/update_time 字段)
* @var bool
*/
protected $autoWriteTimestamp = false;
/**
* 字段严格检查(false=允许操作未定义字段)
* @var bool
*/
protected $strict = false;
}
+52
View File
@@ -0,0 +1,52 @@
<?php
namespace plugin\admin\app\model;
use plugin\admin\app\model\Base;
/**
* OpmDsCycle 模型
* 表说明:opm_ds_cycle 数据表模型
* 对应数据表:opm_ds_cycle
* @property string $id id(非空,主键)
* @property int $hospital_id hospital_id
* @property int $department_id department_id
* @property int $device_id device_id
* @property int $sensor_id sensor_id
* @property string $pack pack
* @property string $operation operation
* @property string $start_time start_time
* @property string $end_time end_time
* @property string $created_at created_at
* @property int $is_warn is_warn 1 正常 2预警(默认值:1)
* @property int $is_sync is_sync(默认值:1
* @property int $is_tag is_tag 周期检验 0未检验 1已检验(默认值:0)
* @property string $description description 问题描述
* @property int $is_mark is_mark 0 默认未标注 1 已标注(默认值:0)
*/
class OpmDsCycle extends Base
{
/**
* 数据表名
* @var string
*/
protected $table = 'opm_ds_cycle';
/**
* 主键字段名
* @var string
*/
protected $pk = 'id';
/**
* 关闭自动时间戳(如需开启请改为 true,需确保表有 create_time/update_time 字段)
* @var bool
*/
protected $autoWriteTimestamp = false;
/**
* 字段严格检查(false=允许操作未定义字段)
* @var bool
*/
protected $strict = false;
}
+56
View File
@@ -0,0 +1,56 @@
<?php
namespace plugin\admin\app\model;
use support\Model;
/**
* OpmDsData 模型
* 表说明:opm_ds_data 数据表模型
* 对应数据表:opm_ds_data
* @property string $id id(非空,主键)
* @property int $cycle_id cycle_id
* @property string $gateway_sn gateway_sn 网关id
* @property int $sensor_id sensor_id 传感器id
* @property string $name name 传感器sn
* @property string $temperature temperature 温度
* @property string $pressure pressure 压力
* @property int $is_analysis is_analysis 1未解析 0已解析(默认值:1)
* @property string $created_at created_at
* @property string $sensor_time sensor_time
* @property string $sensor_raw_data sensor_raw_data
* @property string $cmd_type cmd_type
* @property int $is_sync is_sync(默认值:1
* @property string $is_tag is_tag 1 已标记(默认值:0
* @property string $mcutemp mcutemp mcu 温度
* @property string $power power 电量
* @property int $is_report is_report(默认值:0
* @property string $sleep_cnt_current sleep_cnt_current
* @property string $sleep_cnt_base sleep_cnt_base
*/
class OpmDsData extends Model
{
/**
* 数据表名
* @var string
*/
protected $table = 'opm_ds_data';
/**
* 主键字段名
* @var string
*/
protected $pk = 'id';
/**
* 关闭自动时间戳(如需开启请改为 true,需确保表有 create_time/update_time 字段)
* @var bool
*/
protected $autoWriteTimestamp = false;
/**
* 字段严格检查(false=允许操作未定义字段)
* @var bool
*/
protected $strict = false;
}
@@ -0,0 +1,42 @@
<?php
namespace plugin\admin\app\model;
use support\Model;
/**
* OpmDsDepartment 模型
* 表说明:opm_ds_department 数据表模型
* 对应数据表:opm_ds_department
* @property string $id id(非空,主键)
* @property int $hospital_id hospital_id 医院ID
* @property string $department department 科室名称
* @property string $created_at created_at
* @property string $department_code department_code 科室编码
*/
class OpmDsDepartment extends Model
{
/**
* 数据表名
* @var string
*/
protected $table = 'opm_ds_department';
/**
* 主键字段名
* @var string
*/
protected $pk = 'id';
/**
* 关闭自动时间戳(如需开启请改为 true,需确保表有 create_time/update_time 字段)
* @var bool
*/
protected $autoWriteTimestamp = false;
/**
* 字段严格检查(false=允许操作未定义字段)
* @var bool
*/
protected $strict = false;
}
+68
View File
@@ -0,0 +1,68 @@
<?php
namespace plugin\admin\app\model;
use plugin\admin\app\model\Base;
/**
* OpmDsDevice 模型
* 表说明:opm_ds_device 数据表模型
* 对应数据表:opm_ds_device
* @property string $id id(非空,主键)
* @property int $hospital_id hospital_id 医院ID
* @property int $department_id department_id 科室ID
* @property string $name name 设备名称
* @property int $type type 1网关 2消毒灭菌器
* @property string $manufacturer manufacturer 制造单位
* @property int $status status 1正常 2离线 3报警
* @property string $description description 描述
* @property string $created_at created_at 创建时间
* @property string $buy_time buy_time 购买时间
* @property string $device_code device_code 设备编码
* @property string $device_type device_type 设备类型
* @property string $limitPressure limitPressure 灭菌锅最高压力(默认值:0.25)
* @property string $volume volume 容量(默认值:0.094
* @property string $limitTemperature limitTemperature 最高温度(默认值:150
* @property string $workPressure workPressure 工作压力(默认值:0.142
* @property string $year year(默认值:5
* @property string $monitorPerson monitorPerson 监管人
* @property string $phone phone(默认值:18730306171
* @property int $sensor_id sensor_id
* @property string $potUuid potUuid 灭菌锅唯一标识(长度36位)
* @property string $category category 产品类别
* @property string $pressure pressure 设计压力 例子(-0.1/0.28MPa
* @property string $testPressure testPressure 试压力
* @property string $temperature temperature 设计温度
* @property string $weight weight 自重
* @property string $material material 材料
* @property string $workMedium workMedium 工作介质
* @property string $productStandard productStandard 产品标准
* @property string $manufactureLicenseLevel manufactureLicenseLevel 制造许可级别
* @property string $manufactureLicenseCode manufactureLicenseCode 制造许可编码
*/
class OpmDsDevice extends Base
{
/**
* 数据表名
* @var string
*/
protected $table = 'opm_ds_device';
/**
* 主键字段名
* @var string
*/
protected $pk = 'id';
/**
* 关闭自动时间戳(如需开启请改为 true,需确保表有 create_time/update_time 字段)
* @var bool
*/
protected $autoWriteTimestamp = false;
/**
* 字段严格检查(false=允许操作未定义字段)
* @var bool
*/
protected $strict = false;
}
+42
View File
@@ -0,0 +1,42 @@
<?php
namespace plugin\admin\app\model;
use support\Model;
/**
* OpmDsLog 模型
* 表说明:opm_ds_log 数据表模型
* 对应数据表:opm_ds_log
* @property string $id id(非空,主键)
* @property int $hospital_id hospital_id
* @property int $user_id user_id
* @property string $content content
* @property string $created_at created_at
*/
class OpmDsLog extends Model
{
/**
* 数据表名
* @var string
*/
protected $table = 'opm_ds_log';
/**
* 主键字段名
* @var string
*/
protected $pk = 'id';
/**
* 关闭自动时间戳(如需开启请改为 true,需确保表有 create_time/update_time 字段)
* @var bool
*/
protected $autoWriteTimestamp = false;
/**
* 字段严格检查(false=允许操作未定义字段)
* @var bool
*/
protected $strict = false;
}
+46
View File
@@ -0,0 +1,46 @@
<?php
namespace plugin\admin\app\model;
use support\Model;
/**
* OpmDsMenu 模型
* 表说明:opm_ds_menu 数据表模型
* 对应数据表:opm_ds_menu
* @property string $id id(非空,主键)
* @property int $parent_menu_id parent_menu_id
* @property string $menu menu
* @property string $menu_name menu_name
* @property string $menu_icon menu_icon
* @property string $menu_url menu_url
* @property int $sort_number sort_number
* @property int $is_display is_display 1 显示 2 隐藏
* @property string $created_at created_at
*/
class OpmDsMenu extends Model
{
/**
* 数据表名
* @var string
*/
protected $table = 'opm_ds_menu';
/**
* 主键字段名
* @var string
*/
protected $pk = 'id';
/**
* 关闭自动时间戳(如需开启请改为 true,需确保表有 create_time/update_time 字段)
* @var bool
*/
protected $autoWriteTimestamp = false;
/**
* 字段严格检查(false=允许操作未定义字段)
* @var bool
*/
protected $strict = false;
}
+54
View File
@@ -0,0 +1,54 @@
<?php
namespace plugin\admin\app\model;
use support\Model;
/**
* OpmDsRawData 模型
* 表说明:opm_ds_raw_data 数据表模型
* 对应数据表:opm_ds_raw_data
* @property string $id id(非空,主键)
* @property string $raw_data raw_data
* @property string $link link
* @property int $is_analysis is_analysis(默认值:1
* @property string $created_at created_at
* @property string $cmd_type cmd_type
* @property string $sensor_time_seq sensor_time_seq
* @property string $sensor_sn sensor_sn
* @property string $gateway_sn gateway_sn 网关SN
* @property string $device_sn device_sn 设备SN
* @property string $msg_data msg_data 主要报文
* @property string $is_duplicate is_duplicate 是否重复 0 第0条 1 第1条 2 第2条(默认值:0)
* @property int $is_decode is_decode 是否解算 0 未解算 1 raw表已解算 2 info表已解算(默认值:0)
* @property int $data_length data_length raw_data长度
* @property string $cmd_type2 cmd_type2 报文命令
* @property int $point_count point_count 数据点数
* @property int $duplicate_count duplicate_count 重复次数
*/
class OpmDsRawData extends Model
{
/**
* 数据表名
* @var string
*/
protected $table = 'opm_ds_raw_data';
/**
* 主键字段名
* @var string
*/
protected $pk = 'id';
/**
* 关闭自动时间戳(如需开启请改为 true,需确保表有 create_time/update_time 字段)
* @var bool
*/
protected $autoWriteTimestamp = false;
/**
* 字段严格检查(false=允许操作未定义字段)
* @var bool
*/
protected $strict = false;
}
+42
View File
@@ -0,0 +1,42 @@
<?php
namespace plugin\admin\app\model;
use support\Model;
/**
* OpmDsRegion 模型
* 表说明:opm_ds_region 数据表模型
* 对应数据表:opm_ds_region
* @property string $id id(非空,主键)
* @property string $province province
* @property string $city city
* @property string $county county
* @property string $created_at created_at
*/
class OpmDsRegion extends Model
{
/**
* 数据表名
* @var string
*/
protected $table = 'opm_ds_region';
/**
* 主键字段名
* @var string
*/
protected $pk = 'id';
/**
* 关闭自动时间戳(如需开启请改为 true,需确保表有 create_time/update_time 字段)
* @var bool
*/
protected $autoWriteTimestamp = false;
/**
* 字段严格检查(false=允许操作未定义字段)
* @var bool
*/
protected $strict = false;
}
@@ -0,0 +1,47 @@
<?php
namespace plugin\admin\app\model;
use support\Model;
/**
* OpmDsReportData 模型
* 表说明:opm_ds_report_data 数据表模型
* 对应数据表:opm_ds_report_data
* @property string $id id(非空,主键)
* @property int $sensor_id sensor_id
* @property int $cycle_id cycle_id
* @property int $run_id run_id
* @property string $name name
* @property string $temperature temperature
* @property string $pressure pressure
* @property string $sensor_time sensor_time
* @property int $is_push is_push(默认值:1
* @property int $hospital_id hospital_id
*/
class OpmDsReportData extends Model
{
/**
* 数据表名
* @var string
*/
protected $table = 'opm_ds_report_data';
/**
* 主键字段名
* @var string
*/
protected $pk = 'id';
/**
* 关闭自动时间戳(如需开启请改为 true,需确保表有 create_time/update_time 字段)
* @var bool
*/
protected $autoWriteTimestamp = false;
/**
* 字段严格检查(false=允许操作未定义字段)
* @var bool
*/
protected $strict = false;
}
+48
View File
@@ -0,0 +1,48 @@
<?php
namespace plugin\admin\app\model;
use support\Model;
/**
* OpmDsReportLog 模型
* 表说明:opm_ds_report_log 数据表模型
* 对应数据表:opm_ds_report_log
* @property string $id id(非空,主键)
* @property string $manufactor manufactor
* @property string $hospital hospital
* @property string $url url
* @property string $json json
* @property string $status status
* @property string $link link
* @property string $created_at created_at
* @property int $is_push is_push(默认值:1
* @property string $resu resu
* @property string $type type
*/
class OpmDsReportLog extends Model
{
/**
* 数据表名
* @var string
*/
protected $table = 'opm_ds_report_log';
/**
* 主键字段名
* @var string
*/
protected $pk = 'id';
/**
* 关闭自动时间戳(如需开启请改为 true,需确保表有 create_time/update_time 字段)
* @var bool
*/
protected $autoWriteTimestamp = false;
/**
* 字段严格检查(false=允许操作未定义字段)
* @var bool
*/
protected $strict = false;
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace plugin\admin\app\model;
use support\Model;
/**
* OpmDsRole 模型
* 表说明:opm_ds_role 数据表模型
* 对应数据表:opm_ds_role
* @property string $id id(非空,主键)
* @property string $role role
* @property string $created_at created_at
*/
class OpmDsRole extends Model
{
/**
* 数据表名
* @var string
*/
protected $table = 'opm_ds_role';
/**
* 主键字段名
* @var string
*/
protected $pk = 'id';
/**
* 关闭自动时间戳(如需开启请改为 true,需确保表有 create_time/update_time 字段)
* @var bool
*/
protected $autoWriteTimestamp = false;
/**
* 字段严格检查(false=允许操作未定义字段)
* @var bool
*/
protected $strict = false;
}
+56
View File
@@ -0,0 +1,56 @@
<?php
namespace plugin\admin\app\model;
use plugin\admin\app\model\Base;
/**
* OpmDsSensor 模型
* 表说明:opm_ds_sensor 数据表模型
* 对应数据表:opm_ds_sensor
* @property string $id id(非空,主键)
* @property int $hospital_id hospital_id 医院ID
* @property int $department_id department_id 科室ID
* @property string $sn sn 传感器SN
* @property int $type type 类型
* @property string $created_at created_at
* @property string $fixed_p fixed_p 温度标准值
* @property string $per_p per_p 压力标准值
* @property string $coding coding 设备编码
* @property string $monitorType monitorType 监测类型编码(默认值:1100)
* @property string $monitorSubType monitorSubType 监测子类型编码(默认值:1101,1102)
* @property string $model model 设备型号(默认值:OPM-DT1000
* @property string $manufactor manufactor 生产厂家(默认值:北京智感云科技有限公司)
* @property string $testContent testContent 监测内容(默认值:监测灭菌锅的温度,压力值)
* @property string $sendCycle sendCycle 发送频率(默认值:15
* @property string $patrolCycle patrolCycle 巡检周期(默认值:100
* @property string $repairCycle repairCycle 检修周期(默认值:100
* @property string $note note 备注
* @property int $is_report is_report(默认值:1
*/
class OpmDsSensor extends Base
{
/**
* 数据表名
* @var string
*/
protected $table = 'opm_ds_sensor';
/**
* 主键字段名
* @var string
*/
protected $pk = 'id';
/**
* 关闭自动时间戳(如需开启请改为 true,需确保表有 create_time/update_time 字段)
* @var bool
*/
protected $autoWriteTimestamp = false;
/**
* 字段严格检查(false=允许操作未定义字段)
* @var bool
*/
protected $strict = false;
}
@@ -0,0 +1,51 @@
<?php
namespace plugin\admin\app\model;
use support\Model;
/**
* OpmDsTestreport 模型
* 表说明:检测报告表
* 对应数据表:opm_ds_testreport
* @property int $id id 主键(非空,主键)
* @property string $device_code device_code 设备编码唯一标识(非空)
* @property string $report_code report_code 报告唯一标识
* @property string $report_year report_year 报告年份
* @property string $detect_qualify_date detect_qualify_date 报告检测合格日期
* @property string $detect_inst detect_inst 报告检测机构
* @property string $detect_report_name detect_report_name 检测报告名称
* @property string $detect_date detect_date 检测报告检测时间
* @property string $detect_ret detect_ret 检测报告检测结果
* @property string $detect_report detect_report 检测报告文件
* @property int $is_post is_post 是否上传:0否,1已上传(默认值:0)
* @property int $hospital_id hospital_id 医院ID(非空,默认值:0)
* @property int $type type 检测报告类型(非空,默认值:0)
* @property string $created_at created_at
*/
class OpmDsTestreport extends Model
{
/**
* 数据表名
* @var string
*/
protected $table = 'opm_ds_testreport';
/**
* 主键字段名
* @var string
*/
protected $pk = 'id';
/**
* 关闭自动时间戳(如需开启请改为 true,需确保表有 create_time/update_time 字段)
* @var bool
*/
protected $autoWriteTimestamp = false;
/**
* 字段严格检查(false=允许操作未定义字段)
* @var bool
*/
protected $strict = false;
}
@@ -0,0 +1,45 @@
<?php
namespace plugin\admin\app\model;
use support\Model;
/**
* OpmDsVerifyData 模型
* 表说明:opm_ds_verify_data 数据表模型
* 对应数据表:opm_ds_verify_data
* @property string $id id(非空,主键)
* @property string $verify_data verify_data
* @property string $link link
* @property int $is_analysis is_analysis(默认值:1
* @property string $cmd_type cmd_type
* @property string $sensor_time_seq sensor_time_seq
* @property string $sensor_sn sensor_sn
* @property string $created_at created_at
*/
class OpmDsVerifyData extends Model
{
/**
* 数据表名
* @var string
*/
protected $table = 'opm_ds_verify_data';
/**
* 主键字段名
* @var string
*/
protected $pk = 'id';
/**
* 关闭自动时间戳(如需开启请改为 true,需确保表有 create_time/update_time 字段)
* @var bool
*/
protected $autoWriteTimestamp = false;
/**
* 字段严格检查(false=允许操作未定义字段)
* @var bool
*/
protected $strict = false;
}
@@ -0,0 +1,53 @@
<?php
namespace plugin\admin\app\model;
use plugin\admin\app\model\Base;
/**
* OpmDsWarnRecord 模型
* 表说明:opm_ds_warn_record 数据表模型
* 对应数据表:opm_ds_warn_record
* @property int $id id(非空,主键,默认值:1)
* @property int $hospital_id hospital_id
* @property int $cycle_id cycle_id
* @property int $device_id device_id
* @property string $warn_data warn_data
* @property string $notifier notifier
* @property string $notification_time notification_time
* @property int $status status 1报警 2处理
* @property string $action action 处置方法
* @property string $action_name action_name 处置人员
* @property string $action_time action_time 处置时间
* @property int $type type 1 温度 2压力 3时间
* @property string $created_at created_at
* @property int $notifier_type notifier_type 1短信 2电话 3微信(默认值:1)
* @property int $level level 1 初级 2中级 3高级(默认值:1)
* @property int $is_sync is_sync(默认值:1
*/
class OpmDsWarnRecord extends Base
{
/**
* 数据表名
* @var string
*/
protected $table = 'opm_ds_warn_record';
/**
* 主键字段名
* @var string
*/
protected $pk = 'id';
/**
* 关闭自动时间戳(如需开启请改为 true,需确保表有 create_time/update_time 字段)
* @var bool
*/
protected $autoWriteTimestamp = false;
/**
* 字段严格检查(false=允许操作未定义字段)
* @var bool
*/
protected $strict = false;
}
+49
View File
@@ -0,0 +1,49 @@
<?php
namespace plugin\admin\app\model;
use plugin\admin\app\model\Base;
/**
* OpmDsWarnRule 模型
* 表说明:opm_ds_warn_rule 数据表模型
* 对应数据表:opm_ds_warn_rule
* @property string $id id(非空,主键)
* @property int $hospital_id hospital_id
* @property int $device_id device_id
* @property int $type type 1温度 2压力 3时间
* @property int $level level 1初级 2中级 3高级
* @property string $warn_upper_limit warn_upper_limit
* @property string $warn_lower_limit warn_lower_limit
* @property string $contact contact
* @property string $mobile mobile
* @property int $notice_type notice_type 1短信 2电话 3微信
* @property int $is_open is_open 1开启 2关闭(默认值:1)
* @property string $created_at created_at
*/
class OpmDsWarnRule extends Base
{
/**
* 数据表名
* @var string
*/
protected $table = 'opm_ds_warn_rule';
/**
* 主键字段名
* @var string
*/
protected $pk = 'id';
/**
* 关闭自动时间戳(如需开启请改为 true,需确保表有 create_time/update_time 字段)
* @var bool
*/
protected $autoWriteTimestamp = false;
/**
* 字段严格检查(false=允许操作未定义字段)
* @var bool
*/
protected $strict = false;
}