mh
3 months ago
50 changed files with 2108 additions and 563 deletions
@ -0,0 +1,217 @@ |
|||||||
|
-- 2024-07-31 (未执行) |
||||||
|
alter table project_info add longitude numeric(10,2) null; |
||||||
|
exec sp_addextendedproperty N'MS_Description', N'经度', N'schema', N'dbo', N'table', N'project_info', N'column', N'longitude'; |
||||||
|
|
||||||
|
alter table project_info add latitude numeric(10,2) null; |
||||||
|
exec sp_addextendedproperty N'MS_Description', N'纬度', N'schema', N'dbo', N'table', N'project_info', N'column', N'latitude'; |
||||||
|
|
||||||
|
alter table project_info add create_time datetime null; |
||||||
|
exec sp_addextendedproperty N'MS_Description', N'创建时间', N'schema', N'dbo', N'table', N'project_info', N'column', N'create_time'; |
||||||
|
|
||||||
|
alter table project_info add pic_content text null; |
||||||
|
exec sp_addextendedproperty N'MS_Description', N'图片内容', N'schema', N'dbo', N'table', N'project_info', N'column', N'pic_content'; |
||||||
|
|
||||||
|
-- 2024-08-13 创建字典表数据 |
||||||
|
CREATE TABLE sys_dict ( |
||||||
|
id bigint NOT NULL, |
||||||
|
value nvarchar(100) COLLATE Chinese_PRC_CI_AS NOT NULL, |
||||||
|
label nvarchar(100) COLLATE Chinese_PRC_CI_AS NOT NULL, |
||||||
|
[type] nvarchar(100) COLLATE Chinese_PRC_CI_AS NOT NULL, |
||||||
|
description nvarchar(100) COLLATE Chinese_PRC_CI_AS NOT NULL, |
||||||
|
sort decimal(10,0) NOT NULL, |
||||||
|
create_by nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL, |
||||||
|
create_time datetime2 NULL, |
||||||
|
last_update_by nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL, |
||||||
|
last_update_time datetime2 NULL, |
||||||
|
remarks nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, |
||||||
|
del_flag tinyint NULL, |
||||||
|
status bit null, |
||||||
|
parent_id bigint null |
||||||
|
CONSTRAINT PK__sys_dict__3213E83F527BBC48 PRIMARY KEY (id) |
||||||
|
); |
||||||
|
|
||||||
|
-- Extended properties |
||||||
|
|
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'字典表', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编号', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'id'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'数据值', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'value'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标签名', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'label'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类型', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'type'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'描述', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'description'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序(升序)', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'sort'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'create_by'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'create_time'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'更新人', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'last_update_by'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'更新时间', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'last_update_time'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注信息', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'remarks'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否删除 -1:已删除 0:正常', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'del_flag'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态(0正常 1停用)', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'status'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'父id:0最高级', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'sys_dict', @level2type=N'Column', @level2name=N'parent_id'; |
||||||
|
|
||||||
|
-- 2024-08-22 |
||||||
|
-- 资产设备管理 |
||||||
|
create table devices_manage |
||||||
|
( |
||||||
|
id bigint identity primary key not null, -- id |
||||||
|
device_name nvarchar(100) null, -- 设备名称 |
||||||
|
device_brand nvarchar(100) null, -- 设备品牌 |
||||||
|
em_brand nvarchar(100) null, -- 机电品牌 |
||||||
|
rated_input_power numeric(24, 2) null, -- 额定输入功率 |
||||||
|
rated_refrigeration_capacity numeric(24, 2) null, -- 额定制冷量 |
||||||
|
rated_cop numeric(24, 2) null, -- 额定COP |
||||||
|
rated_flow numeric(24, 2) null, -- 额定流量 |
||||||
|
production_time datetime null, -- 生产日期 |
||||||
|
create_time datetime null, -- 创建时间 |
||||||
|
update_time datetime null, -- 更新时间 |
||||||
|
create_by nvarchar(50) null, -- 创建人 |
||||||
|
is_frequency bit null, -- 是否变频 |
||||||
|
device_type bigint null, -- 设备类型id(字典配置) |
||||||
|
system_id bigint null, -- 项目类型id |
||||||
|
remark nvarchar(255) null, -- 备注 |
||||||
|
grade int null -- 保留 |
||||||
|
) |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'资产设备管理', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编号', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'id'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'设备名称', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'device_name'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'设备品牌', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'device_brand'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'机电品牌', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'em_brand'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'额定输入功率', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'rated_input_power'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'额定制冷量', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'rated_refrigeration_capacity'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'额定COP', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'rated_cop'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'额定流量', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'rated_flow'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'生产日期', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'production_time'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'create_time'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'更新时间', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'update_time'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'create_by'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否变频', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'is_frequency'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'设备类型id(字典配置)', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'device_type'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目类型id', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'system_id'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'remark'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'数据标识', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'grade'; |
||||||
|
|
||||||
|
-- 仪表管理 |
||||||
|
create table meter_manage ( |
||||||
|
id bigint identity primary key not null, -- 编号 |
||||||
|
mt_type bigint null, -- 仪表类型(从字典值获取) |
||||||
|
mt_name nvarchar(100) null, -- 仪表名称 |
||||||
|
other_name nvarchar(100) null, -- 仪表别名 |
||||||
|
mt_brand nvarchar(100) null, -- 仪表品牌 |
||||||
|
mt_num nvarchar(20) null, -- 仪表表面号 |
||||||
|
mt_code nvarchar(20) null, -- 仪表采集码 |
||||||
|
register_addr nvarchar(20), -- 寄存器地址 |
||||||
|
func_code nvarchar(20) null, -- 功能码 |
||||||
|
identify_code nvarchar(20) null, -- 仪表识别码 |
||||||
|
mt_caliber_pulse nvarchar(20) null, -- 仪表口径或者脉冲常数 |
||||||
|
mt_range numeric(24,3) null, -- 仪表范围 |
||||||
|
mt_ratio int null, -- 仪表倍率 |
||||||
|
mt_init_value numeric(24,3) null, -- 初始值 |
||||||
|
digits int null, -- 小数位数 |
||||||
|
data_type int null, -- 数据类型16位、32位、64位 |
||||||
|
cur_value numeric(24,3) null, -- 当前值 |
||||||
|
cur_time datetime null, -- 当前值时间 |
||||||
|
mt_is_sum bit null, -- 是否总表 |
||||||
|
create_time datetime null, -- 创建时间 |
||||||
|
update_time datetime null, -- 更新时间 |
||||||
|
unit nvarchar(20) null, -- 单位 |
||||||
|
sort bigint null, -- 排序 |
||||||
|
data_com nvarchar(100) null, -- 通信端口 |
||||||
|
device_id bigint null, -- 对应device_manage的id |
||||||
|
gateway_id bigint null, -- 对应网关管理表gateway_manage的id |
||||||
|
param_id bigint null, -- 对应参数id |
||||||
|
protocol_type bigint null, -- 协议类型(字典表) |
||||||
|
communication_type int NULL, -- 通讯方式 |
||||||
|
remark nvarchar(255) null, -- 备注 |
||||||
|
system_id bigint null, -- 项目类型id |
||||||
|
grade int null -- 保留 |
||||||
|
) |
||||||
|
|
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'仪表管理', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编号', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'id'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'仪表类型(从字典值获取)', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'mt_type_id'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'仪表名称', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'mt_name'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'仪表别名', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'other_name'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'仪表品牌', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'mt_brand'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'仪表表面号', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'mt_num'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'仪表采集码', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'mt_code'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'寄存器地址', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'register_addr'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'功能码', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'func_code'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'仪表识别码', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'identify_code'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'仪表口径或者脉冲常数', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'mt_caliber_pulse'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'仪表范围', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'mt_range'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'仪表倍率', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'mt_ratio'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'初始值', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'mt_init_value'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'小数位数', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'meter_manage', @level2type=N'Column', @level2name=N'digits'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'数据类型16位、32位、64位', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'data_type'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'当前值', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'cur_value'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'当前值时间', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'cur_time'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否总表', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'mt_is_sum'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'create_time'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'更新时间', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'update_time'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'单位', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'unit'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'sort'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'对应device_manage的id', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'device_id'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'对应网关管理表gateway_manage的id', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'gateway_id'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'对应参数id', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'param_id'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'协议类型(字典表)', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'protocol_id'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'通讯方式', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'communication_type'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'remark'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目类型ID', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'system_id'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'保留', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'devices_manage', @level2type=N'Column', @level2name=N'grade'; |
||||||
|
|
||||||
|
|
||||||
|
-- 网关管理表 |
||||||
|
CREATE TABLE gateway_manage ( |
||||||
|
id bigint identity(1,1) NOT NULL, |
||||||
|
gw_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL, |
||||||
|
gw_ip varchar(20) COLLATE Chinese_PRC_CI_AS NULL, |
||||||
|
gw_addr varchar(100) COLLATE Chinese_PRC_CI_AS NULL, |
||||||
|
port int NULL, |
||||||
|
collection_loop int NULL, |
||||||
|
create_time datetime NULL, |
||||||
|
update_time datetime NULL, |
||||||
|
connect_time datetime NULL, |
||||||
|
internet_card varchar(50) COLLATE Chinese_PRC_CI_AS NULL, |
||||||
|
operator_type int NULL, |
||||||
|
remark varchar(100) COLLATE Chinese_PRC_CI_AS NULL, |
||||||
|
communication_type int NULL, |
||||||
|
grade int NULL, |
||||||
|
system_id bigint null, -- 项目类型id |
||||||
|
CONSTRAINT pk_gateway_manage PRIMARY KEY (id) |
||||||
|
); |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'网关管理', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编号', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'id'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'网关名称', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'gw_name'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'网关IP地址', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'gw_ip'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'网关对应的编号地址', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'gw_addr'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'网关端口', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'port'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'采集周期', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'collection_loop'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'create_time'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'更新时间', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'update_time'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'连接时间', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'connect_time'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'卡号', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'internet_card'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'运营商类型 0:中国移动 1:中国联通 2:中国电信', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'operator_type'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'remark'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'通信类型(字典表)', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'communication_type_id'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'预留字段', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'grade'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目类型id', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'gateway_manage', @level2type=N'Column', @level2name=N'system_id'; |
||||||
|
|
||||||
|
-- 设备采集参数表 |
||||||
|
create table device_params( |
||||||
|
id bigint primary key identity(1,1) not null, -- 编号 |
||||||
|
mt_type int not null, -- 仪表类型(从字典表中拿) |
||||||
|
baud_rate int not null, -- 波特率 |
||||||
|
data_bit int not null, -- 数据位 |
||||||
|
stop_bit int not null, -- 停止位 |
||||||
|
parity nvarchar(10) not null, -- 校验位 |
||||||
|
remark varchar(100) null -- 备注 |
||||||
|
) |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'设备采集参数表', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'device_params'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编号', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'device_params', @level2type=N'Column', @level2name=N'id'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'仪表类型(从字典中获取)', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'device_params', @level2type=N'Column', @level2name=N'mt_type'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'波特率', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'device_params', @level2type=N'Column', @level2name=N'baud_rate'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'数据位', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'device_params', @level2type=N'Column', @level2name=N'data_bit'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'停止位', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'device_params', @level2type=N'Column', @level2name=N'stop_bit'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'校验位', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'device_params', @level2type=N'Column', @level2name=N'parity'; |
||||||
|
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注', @level0type=N'Schema', @level0name=N'dbo', @level1type=N'Table', @level1name=N'device_params', @level2type=N'Column', @level2name=N'remark'; |
||||||
|
|
||||||
|
-- 2024-08-22 |
@ -1,296 +0,0 @@ |
|||||||
//package com.mh.user.controller;
|
|
||||||
//
|
|
||||||
//import com.alibaba.fastjson.JSONObject;
|
|
||||||
//import com.mh.common.http.HttpResult;
|
|
||||||
//import com.mh.user.dto.DeviceMessageDTO;
|
|
||||||
//import com.mh.user.entity.*;
|
|
||||||
//import com.mh.user.manage.QuartzManager;
|
|
||||||
//import com.mh.user.service.chillers.DeviceDisplayService;
|
|
||||||
//import com.mh.user.constants.Constant;
|
|
||||||
//import com.mh.user.service.chillers.DeviceManageService;
|
|
||||||
//import com.mh.user.service.chillers.DeviceParamService;
|
|
||||||
//import com.mh.user.service.chillers.GatewayManageService;
|
|
||||||
//import com.mh.user.utils.GetReadOrder485;
|
|
||||||
//import com.mh.user.utils.QuerySendThread;
|
|
||||||
//import com.mh.user.constants.SocketMessage;
|
|
||||||
//import com.mh.user.utils.TimeDifferenceUtil;
|
|
||||||
//import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
//import org.springframework.web.bind.annotation.*;
|
|
||||||
//
|
|
||||||
//import javax.annotation.Resource;
|
|
||||||
//import java.text.ParseException;
|
|
||||||
//import java.util.HashMap;
|
|
||||||
//import java.util.List;
|
|
||||||
//import java.util.Map;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * @author ljf
|
|
||||||
// * @title :
|
|
||||||
// * @description : 设备管理接口
|
|
||||||
// * @updateTime 2020-05-29
|
|
||||||
// * @updateTime 2020-07-17
|
|
||||||
// * @throws :
|
|
||||||
// */
|
|
||||||
//@RestController
|
|
||||||
//public class DeviceManageController {
|
|
||||||
//
|
|
||||||
// private final DeviceDisplayService deviceDisplayService;
|
|
||||||
// private final GatewayManageService gatewayManageService;
|
|
||||||
// private final DeviceManageService deviceManageService;
|
|
||||||
// private final DeviceParamService deviceParamService;
|
|
||||||
//
|
|
||||||
// public DeviceManageController(DeviceDisplayService deviceDisplayService, GatewayManageService gatewayManageService, DeviceManageService deviceManageService, DeviceParamService deviceParamService) {
|
|
||||||
// this.deviceDisplayService = deviceDisplayService;
|
|
||||||
// this.gatewayManageService = gatewayManageService;
|
|
||||||
// this.deviceManageService = deviceManageService;
|
|
||||||
// this.deviceParamService = deviceParamService;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Resource
|
|
||||||
// QuartzManager quartzManager;
|
|
||||||
//
|
|
||||||
// @Autowired
|
|
||||||
// private SocketMessage socketMessage;
|
|
||||||
//
|
|
||||||
// // 查询设备信息状态
|
|
||||||
// @GetMapping("/operation/getColdStation")
|
|
||||||
// public HttpResult getColdStation(@RequestParam(value = "deviceType", required = true) String deviceType) {
|
|
||||||
// List<DeviceMessageDTO> deviceMessageList = deviceDisplayService.queryDeviceStatus(deviceType);
|
|
||||||
// Map<String, Object> formValues = new HashMap<>();
|
|
||||||
// formValues.put("formValues",deviceMessageList);
|
|
||||||
// return HttpResult.ok("success", formValues);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // 对设备进行操作处理
|
|
||||||
// @PostMapping("/operation/operationDevice")
|
|
||||||
// public HttpResult operationDevice(@RequestBody List<OrderEntity> changeValues) {
|
|
||||||
// String result;
|
|
||||||
// try {
|
|
||||||
// List<OrderMessageEntity> orderMessageEntityList;
|
|
||||||
// // type值 0:修改频率, 1:修改开关状态, 2: 关闭冷却泵之前,查询最近关闭的冷却塔时间,3: 群控手自动切换类型,4: 修改温度, 5: 修改压力
|
|
||||||
//// // 添加网页发送指令状态 update by ljf on 2020-08-07
|
|
||||||
// Constant.CONTROL_WEB_FLAG = true;
|
|
||||||
// // 暂停采集
|
|
||||||
//// quartzManager.pauseJob("DDC","JobDDCGroup");
|
|
||||||
//// Thread.sleep(2000);
|
|
||||||
// // 修改成不用暂停采集处理
|
|
||||||
// GetReadOrder485 getReadOrder485 = new GetReadOrder485();
|
|
||||||
// // 判断是否是去关闭冷却泵,如果是,需要检查最近冷却塔有没有关闭并且关闭时间大于8分钟
|
|
||||||
// // 判断changeValues大小
|
|
||||||
// int size = changeValues.size();
|
|
||||||
// int type = changeValues.get(0).getType();
|
|
||||||
// if (type == 3 && size == 1) {
|
|
||||||
// // 生成指令
|
|
||||||
// orderMessageEntityList = getReadOrder485.createOrder(changeValues);
|
|
||||||
// if (orderMessageEntityList.size() != 0) {
|
|
||||||
// // 开启发送指令
|
|
||||||
// NettyChillerControlClient nettyChillerControlClient = new NettyChillerControlClient();
|
|
||||||
//// nettyChillerControlClient.connect(8081, "192.168.1.131", orderMessageEntityList);
|
|
||||||
// nettyChillerControlClient.connect(socketMessage.getPort(), socketMessage.getIP(), orderMessageEntityList);
|
|
||||||
// // 开启线程监测标志
|
|
||||||
// QuerySendThread querySendThread = new QuerySendThread();
|
|
||||||
// querySendThread.start();
|
|
||||||
// if (Constant.SEND_STATUS) {
|
|
||||||
// result = "success";
|
|
||||||
// } else {
|
|
||||||
// result = "fail";
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// result = "fail";
|
|
||||||
// }
|
|
||||||
// } else if (type == 2 && size == 1) {
|
|
||||||
// TimeDifferenceUtil timeDifferenceUtil = new TimeDifferenceUtil();
|
|
||||||
// Boolean a = timeDifferenceUtil.timeDifference(socketMessage.getOverTime());
|
|
||||||
// if (a) {
|
|
||||||
// // 生成指令
|
|
||||||
// orderMessageEntityList = getReadOrder485.createOrder(changeValues);
|
|
||||||
// if (orderMessageEntityList.size() != 0) {
|
|
||||||
// // 开启发送指令
|
|
||||||
// NettyChillerControlClient nettyChillerControlClient = new NettyChillerControlClient();
|
|
||||||
//// nettyChillerControlClient.connect(8081, "192.168.1.131", orderMessageEntityList);
|
|
||||||
// nettyChillerControlClient.connect(socketMessage.getPort(), socketMessage.getIP(), orderMessageEntityList);
|
|
||||||
// // 开启线程监测标志
|
|
||||||
// QuerySendThread querySendThread = new QuerySendThread();
|
|
||||||
// querySendThread.start();
|
|
||||||
// if (Constant.SEND_STATUS) {
|
|
||||||
// result = "success";
|
|
||||||
// } else {
|
|
||||||
// result = "fail";
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// result = "fail";
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// result = "冷却塔关机还没有超过8分钟";
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// // 生成指令
|
|
||||||
// orderMessageEntityList = getReadOrder485.createOrder(changeValues);
|
|
||||||
// if (orderMessageEntityList.size() != 0) {
|
|
||||||
// // 开启发送指令
|
|
||||||
// NettyChillerControlClient nettyChillerControlClient = new NettyChillerControlClient();
|
|
||||||
//// nettyChillerControlClient.connect(8081, "192.168.1.131", orderMessageEntityList);
|
|
||||||
// nettyChillerControlClient.connect(socketMessage.getPort(), socketMessage.getIP(), orderMessageEntityList);
|
|
||||||
// // 开启线程监测标志
|
|
||||||
// QuerySendThread querySendThread = new QuerySendThread();
|
|
||||||
// querySendThread.start();
|
|
||||||
// if (Constant.SEND_STATUS) {
|
|
||||||
// result = "success";
|
|
||||||
// } else {
|
|
||||||
// result = "fail";
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// result = "fail";
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// Constant.CONTROL_WEB_FLAG = false;
|
|
||||||
// // 不需要停止采集
|
|
||||||
//// Constant.WEB_FLAG = false;
|
|
||||||
//// // 延迟5秒处理,等待线程处理数据
|
|
||||||
// Thread.sleep(500);
|
|
||||||
//// // 重新开启定时采集
|
|
||||||
//// quartzManager.resumeAllJob();
|
|
||||||
//// quartzManager.resumeJob("DDC","JobDDCGroup");
|
|
||||||
// } catch (InterruptedException | ParseException e) {
|
|
||||||
// e.printStackTrace();
|
|
||||||
// result = "fail";
|
|
||||||
// }
|
|
||||||
// // 异常情况处理
|
|
||||||
// return HttpResult.ok(result);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 查询网关信息
|
|
||||||
// * @param requestJson
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// @PostMapping("/gateWay/getGateWayList")
|
|
||||||
// public HttpResult gateWayList(@RequestBody String requestJson){
|
|
||||||
// JSONObject jsonObject =JSONObject.parseObject(requestJson);
|
|
||||||
// Integer operator = null;
|
|
||||||
// Integer grade = null;
|
|
||||||
// if(jsonObject.get("operator") != null){
|
|
||||||
// if(jsonObject.get("operator").equals("中国移动")){
|
|
||||||
// operator = 0;
|
|
||||||
// }else if(jsonObject.get("operator").equals("中国联通")){
|
|
||||||
// operator = 1;
|
|
||||||
// }else if(jsonObject.get("operator").equals("中国电信")){
|
|
||||||
// operator = 2;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if(jsonObject.get("grade") != null){
|
|
||||||
// if(jsonObject.get("grade").equals("正常")){
|
|
||||||
// grade = 0;
|
|
||||||
// }else if(jsonObject.get("grade").equals("不在线")){
|
|
||||||
// grade = 1;
|
|
||||||
// }else if(jsonObject.get("grade").equals("异常")){
|
|
||||||
// grade = 2;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// List<GatewayManageEntity> gateWayList = gatewayManageService.queryByOther(grade,operator);
|
|
||||||
// JSONObject tableData = new JSONObject();
|
|
||||||
// tableData.put("tableData",gateWayList);
|
|
||||||
// return HttpResult.ok(tableData);
|
|
||||||
//// System.out.println(requestJson);
|
|
||||||
//// return null;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 新增或更新网关信息
|
|
||||||
// * @param reqestJson
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// @PostMapping("/gateWay/addOrUpdateGateWayInfo")
|
|
||||||
// public HttpResult addOrUpdateGateWayInfo(@RequestBody GatewayManageEntity reqestJson){
|
|
||||||
// try {
|
|
||||||
// System.out.println(reqestJson.toString());
|
|
||||||
// gatewayManageService.addOrUpdateGateWayInfo(reqestJson);
|
|
||||||
// return HttpResult.ok();
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// e.printStackTrace();
|
|
||||||
// return HttpResult.error(e.getMessage());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 删除网关/基表/基表参数信息
|
|
||||||
// * @param requestJson
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// @PostMapping("/device/deleteDeviceInfo")
|
|
||||||
// public HttpResult deleteDeviceInfo(@RequestBody String requestJson){
|
|
||||||
// JSONObject jsonObject =JSONObject.parseObject(requestJson);
|
|
||||||
// System.out.println(jsonObject.get("deviceId"));
|
|
||||||
// try {
|
|
||||||
// deviceManageService.deleteDeviceInfo((Integer)jsonObject.get("deviceId"),jsonObject.get("deviceType").toString());
|
|
||||||
// return HttpResult.ok();
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// e.printStackTrace();
|
|
||||||
// return HttpResult.error(e.getMessage());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 查询基表管理中的基表数据
|
|
||||||
// * @param requestJson
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// @PostMapping("/baseMeter/getBaseMeterList")
|
|
||||||
// public HttpResult getBaseMeterList(@RequestBody String requestJson){
|
|
||||||
// JSONObject jsonObject =JSONObject.parseObject(requestJson);
|
|
||||||
// List<DeviceManageEntity> list = deviceManageService.getDeviceByOther(jsonObject.get("deviceNum").toString());
|
|
||||||
// JSONObject tableData = new JSONObject();
|
|
||||||
// tableData.put("tableData",list);
|
|
||||||
// return HttpResult.ok(tableData);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 增加或更新基表信息数据
|
|
||||||
// * @param requestJson
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// @PostMapping("/baseMeter/addOrUpdateBaseMeter")
|
|
||||||
// public HttpResult addOrUpdateBaseMeter(@RequestBody DeviceManageEntity requestJson){
|
|
||||||
// try {
|
|
||||||
// deviceManageService.addOrUpdateBaseMeter(requestJson);
|
|
||||||
// return HttpResult.ok();
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// e.printStackTrace();
|
|
||||||
// return HttpResult.error("检查输入的设备码是否有误!");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 查询基表参数管理中的基表参数数据
|
|
||||||
// * @param requestJson
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// @PostMapping("/baseMeterParam/getBaseMeterParamList")
|
|
||||||
// public HttpResult getBaseMeterParamList(@RequestBody String requestJson){
|
|
||||||
// JSONObject jsonObject =JSONObject.parseObject(requestJson);
|
|
||||||
// System.out.println(jsonObject.get("baseMeterType"));
|
|
||||||
// String baseMeterType = (String) jsonObject.get("baseMeterType");
|
|
||||||
// List<DeviceParameterEntity> list = deviceParamService.getBaseMeterParamList(baseMeterType);
|
|
||||||
// JSONObject tableData = new JSONObject();
|
|
||||||
// tableData.put("tableData",list);
|
|
||||||
// return HttpResult.ok(tableData);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 添加或更新基表参数信息
|
|
||||||
// * @param requestJson
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// @PostMapping("/baseMeterParam/addOrUpdateBaseMeterParam")
|
|
||||||
// public HttpResult addOrUpdateBaseMeterParam(@RequestBody DeviceParameterEntity requestJson){
|
|
||||||
// try {
|
|
||||||
// deviceParamService.addOrUpdateBaseMeterParam(requestJson);
|
|
||||||
// return HttpResult.ok();
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// e.printStackTrace();
|
|
||||||
// return HttpResult.error(e.getMessage());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//}
|
|
@ -0,0 +1,60 @@ |
|||||||
|
package com.mh.user.controller; |
||||||
|
|
||||||
|
import com.mh.common.http.HttpResult; |
||||||
|
import com.mh.common.page.PageRequest; |
||||||
|
import com.mh.common.page.PageResult; |
||||||
|
import com.mh.user.annotation.SysLogger; |
||||||
|
import com.mh.user.entity.DevicesManageEntity; |
||||||
|
import com.mh.user.service.DevicesManageService; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 仪表管理控制层 |
||||||
|
* @date 2024-08-23 08:53:03 |
||||||
|
*/ |
||||||
|
@RestController |
||||||
|
@RequestMapping("/devicesManage") |
||||||
|
public class DevicesManageController { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private DevicesManageService devicesManageService; |
||||||
|
|
||||||
|
@SysLogger(value="资产管理信息",optDesc = "查询资产管理信息") |
||||||
|
@PostMapping("/findByPage") |
||||||
|
public PageResult queryGatewayManage(@RequestBody PageRequest pageRequest) { |
||||||
|
return devicesManageService.queryByPage(pageRequest); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="资产管理信息",optDesc = "编辑资产管理信息") |
||||||
|
@PostMapping("/update") |
||||||
|
public HttpResult updateProInfo(DevicesManageEntity entity) { |
||||||
|
devicesManageService.update(entity); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="资产管理信息",optDesc = "根据项目id查询对应信息") |
||||||
|
@GetMapping("/findById") |
||||||
|
public HttpResult findById(@RequestParam("id") Integer id) { |
||||||
|
DevicesManageEntity entity = devicesManageService.findById(id); |
||||||
|
return HttpResult.ok(entity); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="资产管理信息",optDesc = "添加资产管理信息") |
||||||
|
@PostMapping("/save") |
||||||
|
public HttpResult saveGw(DevicesManageEntity entity) { |
||||||
|
devicesManageService.save(entity); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="资产管理信息",optDesc = "删除资产管理信息") |
||||||
|
@GetMapping("/deleteById") |
||||||
|
public HttpResult deleteProInfo(@RequestParam String id) { |
||||||
|
devicesManageService.delete(id); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,60 @@ |
|||||||
|
package com.mh.user.controller; |
||||||
|
|
||||||
|
import com.mh.common.http.HttpResult; |
||||||
|
import com.mh.common.page.PageRequest; |
||||||
|
import com.mh.common.page.PageResult; |
||||||
|
import com.mh.user.annotation.SysLogger; |
||||||
|
import com.mh.user.entity.DeviceParamsEntity; |
||||||
|
import com.mh.user.service.DeviceParamsService; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 设备参数管理控制层 |
||||||
|
* @date 2024-08-23 08:53:03 |
||||||
|
*/ |
||||||
|
@RestController |
||||||
|
@RequestMapping("/deviceParams") |
||||||
|
public class DevicesParamsController { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private DeviceParamsService deviceParamsService; |
||||||
|
|
||||||
|
@SysLogger(value="资产管理信息",optDesc = "查询资产管理信息") |
||||||
|
@PostMapping("/findByPage") |
||||||
|
public PageResult queryGatewayManage(@RequestBody PageRequest pageRequest) { |
||||||
|
return deviceParamsService.queryByPage(pageRequest); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="资产管理信息",optDesc = "编辑资产管理信息") |
||||||
|
@PostMapping("/update") |
||||||
|
public HttpResult updateProInfo(DeviceParamsEntity entity) { |
||||||
|
deviceParamsService.update(entity); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="资产管理信息",optDesc = "根据项目id查询对应信息") |
||||||
|
@GetMapping("/findById") |
||||||
|
public HttpResult findById(@RequestParam("id") Integer id) { |
||||||
|
DeviceParamsEntity entity = deviceParamsService.findById(id); |
||||||
|
return HttpResult.ok(entity); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="资产管理信息",optDesc = "添加资产管理信息") |
||||||
|
@PostMapping("/save") |
||||||
|
public HttpResult saveGw(DeviceParamsEntity entity) { |
||||||
|
deviceParamsService.save(entity); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="资产管理信息",optDesc = "删除资产管理信息") |
||||||
|
@GetMapping("/deleteById") |
||||||
|
public HttpResult deleteProInfo(@RequestParam String id) { |
||||||
|
deviceParamsService.delete(id); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,61 @@ |
|||||||
|
package com.mh.user.controller; |
||||||
|
|
||||||
|
import com.mh.common.http.HttpResult; |
||||||
|
import com.mh.common.page.PageRequest; |
||||||
|
import com.mh.common.page.PageResult; |
||||||
|
import com.mh.user.annotation.SysLogger; |
||||||
|
import com.mh.user.entity.GatewayManageEntity; |
||||||
|
import com.mh.user.service.GatewayManageService; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 网关管理接口控制类 |
||||||
|
* @date 2024-08-22 17:19:21 |
||||||
|
*/ |
||||||
|
@RestController |
||||||
|
@RequestMapping("/gw") |
||||||
|
public class GatewayManageController { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private GatewayManageService gatewayManageService; |
||||||
|
|
||||||
|
@SysLogger(value="网关管理信息",optDesc = "查询网关管理信息") |
||||||
|
@PostMapping("/findByPage") |
||||||
|
public PageResult queryGatewayManage(@RequestBody PageRequest pageRequest) { |
||||||
|
return gatewayManageService.queryByPage(pageRequest); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="网关管理信息",optDesc = "编辑网关管理信息") |
||||||
|
@PostMapping("/update") |
||||||
|
public HttpResult updateProInfo(GatewayManageEntity gatewayManageEntity) { |
||||||
|
gatewayManageService.update(gatewayManageEntity); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="网关管理信息",optDesc = "根据项目id查询对应信息") |
||||||
|
@GetMapping("/findById") |
||||||
|
public HttpResult findById(@RequestParam("id") Integer id) { |
||||||
|
GatewayManageEntity gatewayManageEntity = gatewayManageService.findById(id); |
||||||
|
return HttpResult.ok(gatewayManageEntity); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="网关管理信息",optDesc = "添加网关管理信息") |
||||||
|
@PostMapping("/save") |
||||||
|
public HttpResult saveGw(GatewayManageEntity gatewayManageEntity) { |
||||||
|
gatewayManageService.save(gatewayManageEntity); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="网关管理信息",optDesc = "删除网关管理信息") |
||||||
|
@GetMapping("/deleteById") |
||||||
|
public HttpResult deleteProInfo(@RequestParam String id) { |
||||||
|
gatewayManageService.delete(id); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,60 @@ |
|||||||
|
package com.mh.user.controller; |
||||||
|
|
||||||
|
import com.mh.common.http.HttpResult; |
||||||
|
import com.mh.common.page.PageRequest; |
||||||
|
import com.mh.common.page.PageResult; |
||||||
|
import com.mh.user.annotation.SysLogger; |
||||||
|
import com.mh.user.entity.MeterManageEntity; |
||||||
|
import com.mh.user.service.MeterManageService; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 仪表管理控制层 |
||||||
|
* @date 2024-08-23 08:53:03 |
||||||
|
*/ |
||||||
|
@RestController |
||||||
|
@RequestMapping("/mtManage") |
||||||
|
public class MeterManageController { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private MeterManageService meterManageService; |
||||||
|
|
||||||
|
@SysLogger(value="仪表管理信息",optDesc = "查询仪表管理信息") |
||||||
|
@PostMapping("/findByPage") |
||||||
|
public PageResult queryGatewayManage(@RequestBody PageRequest pageRequest) { |
||||||
|
return meterManageService.queryByPage(pageRequest); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="仪表管理信息",optDesc = "编辑仪表管理信息") |
||||||
|
@PostMapping("/update") |
||||||
|
public HttpResult updateProInfo(MeterManageEntity entity) { |
||||||
|
meterManageService.update(entity); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="仪表管理信息",optDesc = "根据项目id查询对应信息") |
||||||
|
@GetMapping("/findById") |
||||||
|
public HttpResult findById(@RequestParam("id") Integer id) { |
||||||
|
MeterManageEntity entity = meterManageService.findById(id); |
||||||
|
return HttpResult.ok(entity); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="仪表管理信息",optDesc = "添加仪表管理信息") |
||||||
|
@PostMapping("/save") |
||||||
|
public HttpResult saveGw(MeterManageEntity entity) { |
||||||
|
meterManageService.save(entity); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="仪表管理信息",optDesc = "删除仪表管理信息") |
||||||
|
@GetMapping("/deleteById") |
||||||
|
public HttpResult deleteProInfo(@RequestParam String id) { |
||||||
|
meterManageService.delete(id); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,60 @@ |
|||||||
|
package com.mh.user.controller; |
||||||
|
|
||||||
|
import com.mh.common.http.HttpResult; |
||||||
|
import com.mh.common.page.PageRequest; |
||||||
|
import com.mh.common.page.PageResult; |
||||||
|
import com.mh.user.annotation.SysLogger; |
||||||
|
import com.mh.user.model.SysDict; |
||||||
|
import com.mh.user.service.SysDictService; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 系统字典管理 |
||||||
|
* @date 2024-08-23 10:59:09 |
||||||
|
*/ |
||||||
|
@RestController |
||||||
|
@RequestMapping("/dict") |
||||||
|
public class SysDictController { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private SysDictService sysDictService; |
||||||
|
|
||||||
|
@SysLogger(value="系统字典管理",optDesc = "查询系统字典管理") |
||||||
|
@PostMapping("/findByPage") |
||||||
|
public PageResult queryGatewayManage(@RequestBody PageRequest pageRequest) { |
||||||
|
return sysDictService.findPage(pageRequest); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="系统字典管理",optDesc = "编辑系统字典管理") |
||||||
|
@PostMapping("/update") |
||||||
|
public HttpResult update(SysDict entity) { |
||||||
|
sysDictService.updateByPrimaryKey(entity); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="系统字典管理",optDesc = "根据项目id查询对应信息") |
||||||
|
@GetMapping("/findById") |
||||||
|
public HttpResult findById(@RequestParam("id") Long id) { |
||||||
|
SysDict entity = sysDictService.findById(id); |
||||||
|
return HttpResult.ok(entity); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="系统字典管理",optDesc = "添加系统字典管理") |
||||||
|
@PostMapping("/save") |
||||||
|
public HttpResult save(SysDict entity) { |
||||||
|
sysDictService.save(entity); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
@SysLogger(value="系统字典管理",optDesc = "删除系统字典管理") |
||||||
|
@GetMapping("/deleteById") |
||||||
|
public HttpResult delete(@RequestParam Long id) { |
||||||
|
sysDictService.deleteByPrimaryKey(id); |
||||||
|
return HttpResult.ok(); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,69 @@ |
|||||||
|
package com.mh.user.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 设备采集参数实体类 |
||||||
|
* @date 2024-08-22 17:04:12 |
||||||
|
*/ |
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
@TableName("device_params") |
||||||
|
public class DeviceParamsEntity { |
||||||
|
|
||||||
|
/** |
||||||
|
* 主键 |
||||||
|
*/ |
||||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||||
|
private Long id; |
||||||
|
|
||||||
|
/** |
||||||
|
* 仪表类型(从字典表中拿) |
||||||
|
*/ |
||||||
|
private int mtType; |
||||||
|
|
||||||
|
/** |
||||||
|
* 波特率 |
||||||
|
*/ |
||||||
|
private int baudRate; |
||||||
|
|
||||||
|
/** |
||||||
|
* 数据位 |
||||||
|
*/ |
||||||
|
private int dataBit; |
||||||
|
|
||||||
|
/** |
||||||
|
* 停止位 |
||||||
|
*/ |
||||||
|
private int stopBit; |
||||||
|
|
||||||
|
/** |
||||||
|
* 校验位 |
||||||
|
*/ |
||||||
|
private String parity; |
||||||
|
|
||||||
|
/** |
||||||
|
* 备注 |
||||||
|
*/ |
||||||
|
private String remark; |
||||||
|
|
||||||
|
@Override |
||||||
|
public String toString() { |
||||||
|
return "DeviceParamsEntity{" + |
||||||
|
"id=" + id + |
||||||
|
", mtType=" + mtType + |
||||||
|
", baudRate=" + baudRate + |
||||||
|
", dataBit=" + dataBit + |
||||||
|
", stopBit=" + stopBit + |
||||||
|
", parity=" + parity + |
||||||
|
", remark='" + remark + '\'' + |
||||||
|
'}'; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,142 @@ |
|||||||
|
package com.mh.user.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 资产设备管理 |
||||||
|
* @date 2024-08-22 16:11:30 |
||||||
|
*/ |
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
@TableName("devices_manage") |
||||||
|
public class DevicesManageEntity implements Serializable { |
||||||
|
|
||||||
|
/** |
||||||
|
* 编号 |
||||||
|
*/ |
||||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||||
|
private Long id; |
||||||
|
|
||||||
|
/** |
||||||
|
* 设备名称 |
||||||
|
*/ |
||||||
|
private String deviceName; |
||||||
|
|
||||||
|
/** |
||||||
|
* 设备品牌 |
||||||
|
*/ |
||||||
|
private String deviceBrand; |
||||||
|
|
||||||
|
/** |
||||||
|
* 机电品牌 |
||||||
|
*/ |
||||||
|
private String emBrand; |
||||||
|
|
||||||
|
/** |
||||||
|
* 额定输入功率 |
||||||
|
*/ |
||||||
|
private BigDecimal ratedInputPower; |
||||||
|
|
||||||
|
/** |
||||||
|
* 额定制冷量 |
||||||
|
*/ |
||||||
|
private BigDecimal ratedRefrigerationCapacity; |
||||||
|
|
||||||
|
/** |
||||||
|
* 额定COP |
||||||
|
*/ |
||||||
|
private BigDecimal ratedCop; |
||||||
|
|
||||||
|
/** |
||||||
|
* 额定流量 |
||||||
|
*/ |
||||||
|
private BigDecimal ratedFlow; |
||||||
|
|
||||||
|
/** |
||||||
|
* 生产日期 |
||||||
|
*/ |
||||||
|
private String productionTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* 创建时间 |
||||||
|
*/ |
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||||
|
private Date createTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* 更新时间 |
||||||
|
*/ |
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||||
|
private Date updateTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* 创建人 |
||||||
|
*/ |
||||||
|
private String createBy; |
||||||
|
|
||||||
|
/** |
||||||
|
* 是否变频 |
||||||
|
*/ |
||||||
|
private byte isFrequency; |
||||||
|
|
||||||
|
/** |
||||||
|
* 设备类型 |
||||||
|
*/ |
||||||
|
private long deviceType; |
||||||
|
|
||||||
|
/** |
||||||
|
* 备注 |
||||||
|
*/ |
||||||
|
private String remark; |
||||||
|
|
||||||
|
/** |
||||||
|
* 等级 |
||||||
|
*/ |
||||||
|
private int grade; |
||||||
|
|
||||||
|
/** |
||||||
|
* 系统类型id |
||||||
|
*/ |
||||||
|
private Long systemId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 项目id |
||||||
|
*/ |
||||||
|
private Long projectId; |
||||||
|
|
||||||
|
@Override |
||||||
|
public String toString() { |
||||||
|
return "DevicesManageEntity{" + |
||||||
|
"id=" + id + |
||||||
|
", deviceName='" + deviceName + '\'' + |
||||||
|
", deviceBrand='" + deviceBrand + '\'' + |
||||||
|
", emBrand='" + emBrand + '\'' + |
||||||
|
", ratedInputPower=" + ratedInputPower + |
||||||
|
", ratedRefrigerationCapacity=" + ratedRefrigerationCapacity + |
||||||
|
", ratedCop=" + ratedCop + |
||||||
|
", ratedFlow=" + ratedFlow + |
||||||
|
", productionTime=" + productionTime + |
||||||
|
", createTime=" + createTime + |
||||||
|
", updateTime=" + updateTime + |
||||||
|
", createBy='" + createBy + '\'' + |
||||||
|
", isFrequency=" + isFrequency + |
||||||
|
", deviceType=" + deviceType + |
||||||
|
", remark='" + remark + '\'' + |
||||||
|
", grade=" + grade + |
||||||
|
", systemId=" + systemId + |
||||||
|
", projectId=" + projectId + |
||||||
|
'}'; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,228 @@ |
|||||||
|
package com.mh.user.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 仪表管理 |
||||||
|
* @date 2024-08-22 16:35:19 |
||||||
|
*/ |
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
@TableName("meter_manage") |
||||||
|
public class MeterManageEntity implements Serializable { |
||||||
|
|
||||||
|
/** |
||||||
|
* 编号 |
||||||
|
*/ |
||||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||||
|
private Long id; |
||||||
|
|
||||||
|
/** |
||||||
|
* 仪表类型 |
||||||
|
*/ |
||||||
|
private Long mtType; |
||||||
|
|
||||||
|
/** |
||||||
|
* 仪表名称 |
||||||
|
*/ |
||||||
|
private String mtName; |
||||||
|
|
||||||
|
/** |
||||||
|
* 其他名称 |
||||||
|
*/ |
||||||
|
private String otherName; |
||||||
|
|
||||||
|
/** |
||||||
|
* 仪表品牌 |
||||||
|
*/ |
||||||
|
private String mtBrand; |
||||||
|
|
||||||
|
/** |
||||||
|
* 仪表编号 |
||||||
|
*/ |
||||||
|
private String mtNum; |
||||||
|
|
||||||
|
/** |
||||||
|
* 仪表地址 |
||||||
|
*/ |
||||||
|
private String mtCode; |
||||||
|
|
||||||
|
/** |
||||||
|
* 寄存器地址 |
||||||
|
*/ |
||||||
|
private String registerAddr; |
||||||
|
|
||||||
|
/** |
||||||
|
* 功能码 |
||||||
|
*/ |
||||||
|
private String funcCode; |
||||||
|
|
||||||
|
/** |
||||||
|
* 数据标识码 |
||||||
|
*/ |
||||||
|
private String identifyCode; |
||||||
|
|
||||||
|
/** |
||||||
|
* 口径以及脉冲常数 |
||||||
|
*/ |
||||||
|
private String mtCaliberPulse; |
||||||
|
|
||||||
|
/** |
||||||
|
* 仪表范围 |
||||||
|
*/ |
||||||
|
private BigDecimal mtRange; |
||||||
|
|
||||||
|
/** |
||||||
|
* 仪表比例 |
||||||
|
*/ |
||||||
|
private int mtRatio; |
||||||
|
|
||||||
|
/** |
||||||
|
* 初始值 |
||||||
|
*/ |
||||||
|
private BigDecimal mtInitValue; |
||||||
|
|
||||||
|
/** |
||||||
|
* 保留位数 |
||||||
|
*/ |
||||||
|
private int digits; |
||||||
|
|
||||||
|
/** |
||||||
|
* 数据类型 |
||||||
|
*/ |
||||||
|
private int dataType; |
||||||
|
|
||||||
|
/** |
||||||
|
* 当前值 |
||||||
|
*/ |
||||||
|
private BigDecimal curValue; |
||||||
|
|
||||||
|
/** |
||||||
|
* 当前时间 |
||||||
|
*/ |
||||||
|
private Date curTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* 是否是总表 |
||||||
|
*/ |
||||||
|
private byte mtIsSum; |
||||||
|
|
||||||
|
/** |
||||||
|
* 创建时间 |
||||||
|
*/ |
||||||
|
private Date createTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* 更新时间 |
||||||
|
*/ |
||||||
|
private Date updateTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* 单位 |
||||||
|
*/ |
||||||
|
private String unit; |
||||||
|
|
||||||
|
/** |
||||||
|
* 排序 |
||||||
|
*/ |
||||||
|
private Long sort; |
||||||
|
|
||||||
|
/** |
||||||
|
* 通讯串口 |
||||||
|
*/ |
||||||
|
private String dataCom; |
||||||
|
|
||||||
|
/** |
||||||
|
* 设备id |
||||||
|
*/ |
||||||
|
private Long deviceId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 网关id |
||||||
|
*/ |
||||||
|
private Long gatewayId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 参数id |
||||||
|
*/ |
||||||
|
private Long paramId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 协议类型 |
||||||
|
*/ |
||||||
|
private Long protocolType; |
||||||
|
|
||||||
|
/** |
||||||
|
* 备注 |
||||||
|
*/ |
||||||
|
private String remark; |
||||||
|
|
||||||
|
/** |
||||||
|
* 保留位 |
||||||
|
*/ |
||||||
|
private int grade; |
||||||
|
|
||||||
|
/** |
||||||
|
* 系统类型id |
||||||
|
*/ |
||||||
|
private Long systemId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 项目id |
||||||
|
*/ |
||||||
|
private Long projectId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 通讯类型 |
||||||
|
*/ |
||||||
|
private Long communicationType; |
||||||
|
|
||||||
|
@Override |
||||||
|
public String toString() { |
||||||
|
return "MeterManageEntity{" + |
||||||
|
"id=" + id + |
||||||
|
", mtType=" + mtType + |
||||||
|
", mtName='" + mtName + '\'' + |
||||||
|
", otherName='" + otherName + '\'' + |
||||||
|
", mtBrand='" + mtBrand + '\'' + |
||||||
|
", mtNum='" + mtNum + '\'' + |
||||||
|
", mtCode='" + mtCode + '\'' + |
||||||
|
", registerAddr='" + registerAddr + '\'' + |
||||||
|
", funcCode='" + funcCode + '\'' + |
||||||
|
", identifyCode='" + identifyCode + '\'' + |
||||||
|
", mtCaliberPulse='" + mtCaliberPulse + '\'' + |
||||||
|
", mtRange=" + mtRange + |
||||||
|
", mtRatio=" + mtRatio + |
||||||
|
", mtInitValue=" + mtInitValue + |
||||||
|
", digits=" + digits + |
||||||
|
", dataType=" + dataType + |
||||||
|
", curValue=" + curValue + |
||||||
|
", curTime=" + curTime + |
||||||
|
", mtIsSum=" + mtIsSum + |
||||||
|
", createTime=" + createTime + |
||||||
|
", updateTime=" + updateTime + |
||||||
|
", unit='" + unit + '\'' + |
||||||
|
", sort=" + sort + |
||||||
|
", dataCom='" + dataCom + '\'' + |
||||||
|
", deviceId=" + deviceId + |
||||||
|
", gatewayId=" + gatewayId + |
||||||
|
", paramId=" + paramId + |
||||||
|
", protocolType=" + protocolType + |
||||||
|
", remark='" + remark + '\'' + |
||||||
|
", grade=" + grade + |
||||||
|
", systemId=" + systemId + |
||||||
|
", projectId=" + projectId + |
||||||
|
'}'; |
||||||
|
} |
||||||
|
} |
@ -1,20 +1,192 @@ |
|||||||
package com.mh.user.entity; |
package com.mh.user.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
import com.baomidou.mybatisplus.annotation.TableName; |
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
import lombok.Data; |
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||||
|
import org.springframework.web.multipart.MultipartFile; |
||||||
|
|
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
@TableName("project_info") |
@TableName("project_info") |
||||||
@Data |
|
||||||
public class ProjectInfoEntity { |
public class ProjectInfoEntity { |
||||||
|
|
||||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||||
private Long id; |
private Long id; |
||||||
private String projectName; //项目名称
|
|
||||||
private String pAddress; //地址
|
@TableField("project_name") |
||||||
|
private String projectName; //项目名称
|
||||||
|
|
||||||
|
@TableField("p_address") |
||||||
|
private String pAddress; //地址
|
||||||
|
|
||||||
|
@TableField("p_scale") |
||||||
private int pScale; |
private int pScale; |
||||||
private String pic; //图片
|
|
||||||
private String tel; //电话
|
@TableField("pic") |
||||||
private String systemId; //系统编号
|
private String pic; //图片地址
|
||||||
|
|
||||||
|
@TableField("pic_content") |
||||||
|
private String picContent; // 图片内容
|
||||||
|
|
||||||
|
@TableField("tel") |
||||||
|
private String tel; //电话
|
||||||
|
|
||||||
|
@TableField("system_id") |
||||||
|
private String systemId; //系统编号
|
||||||
|
|
||||||
|
@TableField("remarks") |
||||||
private String remarks; |
private String remarks; |
||||||
|
|
||||||
|
/** |
||||||
|
* 经度 |
||||||
|
*/ |
||||||
|
@TableField("longitude") |
||||||
|
private BigDecimal longitude; |
||||||
|
|
||||||
|
/** |
||||||
|
* 纬度 |
||||||
|
*/ |
||||||
|
@TableField("latitude") |
||||||
|
private BigDecimal latitude; |
||||||
|
|
||||||
|
/** |
||||||
|
* 创建时间 |
||||||
|
*/ |
||||||
|
@TableField("create_time") |
||||||
|
private Date createTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* 文件流 |
||||||
|
*/ |
||||||
|
@TableField(exist = false) |
||||||
|
@JsonIgnore |
||||||
|
private MultipartFile file; |
||||||
|
|
||||||
|
public Long getId() { |
||||||
|
return id; |
||||||
|
} |
||||||
|
|
||||||
|
public void setId(Long id) { |
||||||
|
this.id = id; |
||||||
|
} |
||||||
|
|
||||||
|
public String getProjectName() { |
||||||
|
return projectName; |
||||||
|
} |
||||||
|
|
||||||
|
public void setProjectName(String projectName) { |
||||||
|
this.projectName = projectName; |
||||||
|
} |
||||||
|
|
||||||
|
public String getpAddress() { |
||||||
|
return pAddress; |
||||||
|
} |
||||||
|
|
||||||
|
public void setpAddress(String pAddress) { |
||||||
|
this.pAddress = pAddress; |
||||||
|
} |
||||||
|
|
||||||
|
public int getpScale() { |
||||||
|
return pScale; |
||||||
|
} |
||||||
|
|
||||||
|
public void setpScale(int pScale) { |
||||||
|
this.pScale = pScale; |
||||||
|
} |
||||||
|
|
||||||
|
public String getPic() { |
||||||
|
return pic; |
||||||
|
} |
||||||
|
|
||||||
|
public void setPic(String pic) { |
||||||
|
this.pic = pic; |
||||||
|
} |
||||||
|
|
||||||
|
public String getPicContent() { |
||||||
|
return picContent; |
||||||
|
} |
||||||
|
|
||||||
|
public void setPicContent(String picContent) { |
||||||
|
this.picContent = picContent; |
||||||
|
} |
||||||
|
|
||||||
|
public String getTel() { |
||||||
|
return tel; |
||||||
|
} |
||||||
|
|
||||||
|
public void setTel(String tel) { |
||||||
|
this.tel = tel; |
||||||
|
} |
||||||
|
|
||||||
|
public String getSystemId() { |
||||||
|
return systemId; |
||||||
|
} |
||||||
|
|
||||||
|
public void setSystemId(String systemId) { |
||||||
|
this.systemId = systemId; |
||||||
|
} |
||||||
|
|
||||||
|
public String getRemarks() { |
||||||
|
return remarks; |
||||||
|
} |
||||||
|
|
||||||
|
public void setRemarks(String remarks) { |
||||||
|
this.remarks = remarks; |
||||||
|
} |
||||||
|
|
||||||
|
public BigDecimal getLongitude() { |
||||||
|
return longitude; |
||||||
|
} |
||||||
|
|
||||||
|
public void setLongitude(BigDecimal longitude) { |
||||||
|
this.longitude = longitude; |
||||||
|
} |
||||||
|
|
||||||
|
public BigDecimal getLatitude() { |
||||||
|
return latitude; |
||||||
|
} |
||||||
|
|
||||||
|
public void setLatitude(BigDecimal latitude) { |
||||||
|
this.latitude = latitude; |
||||||
|
} |
||||||
|
|
||||||
|
public Date getCreateTime() { |
||||||
|
return createTime; |
||||||
|
} |
||||||
|
|
||||||
|
public void setCreateTime(Date createTime) { |
||||||
|
this.createTime = createTime; |
||||||
|
} |
||||||
|
|
||||||
|
public MultipartFile getFile() { |
||||||
|
return file; |
||||||
|
} |
||||||
|
|
||||||
|
public void setFile(MultipartFile file) { |
||||||
|
this.file = file; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String toString() { |
||||||
|
return "ProjectInfoEntity{" + |
||||||
|
"id=" + id + |
||||||
|
", projectName='" + projectName + '\'' + |
||||||
|
", pAddress='" + pAddress + '\'' + |
||||||
|
", pScale=" + pScale + |
||||||
|
", pic='" + pic + '\'' + |
||||||
|
", picContent='" + picContent + '\'' + |
||||||
|
", tel='" + tel + '\'' + |
||||||
|
", systemId='" + systemId + '\'' + |
||||||
|
", remarks='" + remarks + '\'' + |
||||||
|
", longitude=" + longitude + |
||||||
|
", latitude=" + latitude + |
||||||
|
", createTime=" + createTime + |
||||||
|
", file=" + file + |
||||||
|
'}'; |
||||||
|
} |
||||||
|
|
||||||
} |
} |
||||||
|
|
||||||
|
@ -0,0 +1,16 @@ |
|||||||
|
package com.mh.user.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.mh.user.entity.DeviceParamsEntity; |
||||||
|
import org.apache.ibatis.annotations.Mapper; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 设备采集参数 |
||||||
|
* @date 2024-08-23 09:28:57 |
||||||
|
*/ |
||||||
|
@Mapper |
||||||
|
public interface DeviceParamsMapper extends BaseMapper<DeviceParamsEntity> { |
||||||
|
} |
@ -0,0 +1,16 @@ |
|||||||
|
package com.mh.user.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.mh.user.entity.DevicesManageEntity; |
||||||
|
import org.apache.ibatis.annotations.Mapper; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 资产设备管理 |
||||||
|
* @date 2024-08-23 10:22:16 |
||||||
|
*/ |
||||||
|
@Mapper |
||||||
|
public interface DevicesManageMapper extends BaseMapper<DevicesManageEntity> { |
||||||
|
} |
@ -0,0 +1,16 @@ |
|||||||
|
package com.mh.user.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.mh.user.entity.MeterManageEntity; |
||||||
|
import org.apache.ibatis.annotations.Mapper; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 仪表管理对接数据库 |
||||||
|
* @date 2024-08-23 09:03:13 |
||||||
|
*/ |
||||||
|
@Mapper |
||||||
|
public interface MeterManageMapper extends BaseMapper<MeterManageEntity> { |
||||||
|
} |
@ -0,0 +1,17 @@ |
|||||||
|
package com.mh.user.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.mh.user.model.SysDict; |
||||||
|
import org.apache.ibatis.annotations.Mapper; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 系统字典管理 |
||||||
|
* @date 2024-08-23 11:15:47 |
||||||
|
*/ |
||||||
|
@Mapper |
||||||
|
public interface SysDictMapper extends BaseMapper<SysDict> { |
||||||
|
boolean deleteByPrimaryKey(Long id); |
||||||
|
} |
@ -0,0 +1,24 @@ |
|||||||
|
package com.mh.user.service; |
||||||
|
|
||||||
|
import com.mh.common.page.PageRequest; |
||||||
|
import com.mh.common.page.PageResult; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 基础服务类:增删查改 |
||||||
|
* @date 2024-08-23 09:06:19 |
||||||
|
*/ |
||||||
|
public interface BaseService<T> { |
||||||
|
|
||||||
|
PageResult queryByPage(PageRequest pageRequest); |
||||||
|
|
||||||
|
void update(T entity); |
||||||
|
|
||||||
|
T findById(Integer id); |
||||||
|
|
||||||
|
void save(T entity); |
||||||
|
|
||||||
|
void delete(String id); |
||||||
|
} |
@ -0,0 +1,13 @@ |
|||||||
|
package com.mh.user.service; |
||||||
|
|
||||||
|
import com.mh.user.entity.DeviceParamsEntity; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 设备采集服务类 |
||||||
|
* @date 2024-08-23 09:33:34 |
||||||
|
*/ |
||||||
|
public interface DeviceParamsService extends BaseService<DeviceParamsEntity> { |
||||||
|
} |
@ -0,0 +1,13 @@ |
|||||||
|
package com.mh.user.service; |
||||||
|
|
||||||
|
import com.mh.user.entity.DevicesManageEntity; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 资产设备管理 |
||||||
|
* @date 2024-08-23 10:24:33 |
||||||
|
*/ |
||||||
|
public interface DevicesManageService extends BaseService<DevicesManageEntity> { |
||||||
|
} |
@ -0,0 +1,13 @@ |
|||||||
|
package com.mh.user.service; |
||||||
|
|
||||||
|
import com.mh.user.entity.MeterManageEntity; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 仪表管理 |
||||||
|
* @date 2024-08-23 08:59:46 |
||||||
|
*/ |
||||||
|
public interface MeterManageService extends BaseService<MeterManageEntity> { |
||||||
|
} |
@ -1,55 +1,50 @@ |
|||||||
package com.mh.user.service.chillers; |
//package com.mh.user.service.chillers;
|
||||||
|
//
|
||||||
import com.mh.user.entity.GatewayManageEntity; |
//import com.mh.user.entity.GatewayManageEntity;
|
||||||
import org.apache.ibatis.annotations.Param; |
//import org.apache.ibatis.annotations.Param;
|
||||||
|
//
|
||||||
import java.util.List; |
//import java.util.List;
|
||||||
|
//
|
||||||
/** |
///**
|
||||||
* 网关管理服务类 |
// * 网关管理服务类
|
||||||
* author:ljf |
// * author:ljf
|
||||||
* create—date:2020-05-21 |
// * create—date:2020-05-21
|
||||||
*/ |
// */
|
||||||
public interface GatewayManageService { |
//public interface GatewayManageService {
|
||||||
|
//
|
||||||
/** |
// /**
|
||||||
* 根据条件查询网关信息 |
// * 根据条件查询网关信息
|
||||||
* @param grade |
// * @param grade
|
||||||
* @param operator |
// * @param operator
|
||||||
* @return |
// * @return
|
||||||
*/ |
// */
|
||||||
List<GatewayManageEntity> queryByOther(Integer grade, Integer operator); |
// List<GatewayManageEntity> queryByOther(Integer grade, Integer operator);
|
||||||
|
//
|
||||||
/** |
//
|
||||||
* 新增或更新网关信息 |
// // 添加网关设备
|
||||||
* @param gatewayManageEntity |
// String insertGatewayManage(GatewayManageEntity gatewayManageEntity);
|
||||||
*/ |
//
|
||||||
void addOrUpdateGateWayInfo(GatewayManageEntity gatewayManageEntity); |
// // 根据网关ID删除网关设备
|
||||||
|
// void deleteGatewayManageByID(int gatewayID);
|
||||||
// 添加网关设备
|
//
|
||||||
String insertGatewayManage(GatewayManageEntity gatewayManageEntity); |
// // 根据网关ID查询设备信息
|
||||||
|
// GatewayManageEntity queryGatewayByID(Long gatewayID);
|
||||||
// 根据网关ID删除网关设备
|
//
|
||||||
void deleteGatewayManageByID(int gatewayID); |
// // 查询全部
|
||||||
|
// List<GatewayManageEntity> queryAll();
|
||||||
// 根据网关ID查询设备信息
|
//
|
||||||
GatewayManageEntity queryGatewayByID(Long gatewayID); |
// // 设备总数
|
||||||
|
// int queryByOtherCount(int page, int size, int gatewayID);
|
||||||
// 查询全部
|
//
|
||||||
List<GatewayManageEntity> queryAll(); |
// // 更新网关管理器的最新连接数据
|
||||||
|
// void updateGatewayManage(String IP,String port);
|
||||||
// 设备总数
|
//
|
||||||
int queryByOtherCount(int page, int size, int gatewayID); |
// // 更新网关管理器的最新连接数据
|
||||||
|
// void updateGatewayManage2(String port);
|
||||||
// 更新网关管理器的最新连接数据
|
//
|
||||||
void updateGatewayManage(String IP,String port); |
// // 根据grade查询对应的网关路由信息
|
||||||
|
// GatewayManageEntity queryGatewayByGrade(Long grade);
|
||||||
// 更新网关管理器的最新连接数据
|
//
|
||||||
void updateGatewayManage2(String port); |
// //根据端口或者IP或者心跳包查询网关对应的项目名称
|
||||||
|
// String selectProjectName(String str);
|
||||||
// 根据grade查询对应的网关路由信息
|
//}
|
||||||
GatewayManageEntity queryGatewayByGrade(Long grade); |
|
||||||
|
|
||||||
//根据端口或者IP或者心跳包查询网关对应的项目名称
|
|
||||||
String selectProjectName(String str); |
|
||||||
} |
|
||||||
|
@ -1,103 +1,89 @@ |
|||||||
package com.mh.user.service.chillers.impl; |
//package com.mh.user.service.chillers.impl;
|
||||||
|
//
|
||||||
import com.mh.user.entity.GatewayManageEntity; |
//import com.mh.user.entity.GatewayManageEntity;
|
||||||
import com.mh.user.mapper.chillers.GatewayManageMapper; |
//import com.mh.user.mapper.chillers.GatewayManageMapper;
|
||||||
import com.mh.user.service.chillers.GatewayManageService; |
//import com.mh.user.service.chillers.GatewayManageService;
|
||||||
import org.springframework.stereotype.Service; |
//import org.springframework.stereotype.Service;
|
||||||
|
//
|
||||||
import java.util.List; |
//import java.util.List;
|
||||||
|
//
|
||||||
/** |
///**
|
||||||
* @author ljf |
// * @author ljf
|
||||||
* @title : |
// * @title :
|
||||||
* @description : 网关管理实现类 |
// * @description : 网关管理实现类
|
||||||
* @updateTime 2020-05-21 |
// * @updateTime 2020-05-21
|
||||||
* @throws : |
// * @throws :
|
||||||
*/ |
// */
|
||||||
@Service |
//@Service
|
||||||
public class GatewayManageServiceImpl implements GatewayManageService { |
//public class GatewayManageServiceImpl implements GatewayManageService {
|
||||||
|
//
|
||||||
// 通过构造函数注入,引用Mapper
|
// // 通过构造函数注入,引用Mapper
|
||||||
private final GatewayManageMapper gatewayManageMapper; |
// private final GatewayManageMapper gatewayManageMapper;
|
||||||
|
//
|
||||||
public GatewayManageServiceImpl(GatewayManageMapper gatewayManageMapper) { |
// public GatewayManageServiceImpl(GatewayManageMapper gatewayManageMapper) {
|
||||||
this.gatewayManageMapper = gatewayManageMapper; |
// this.gatewayManageMapper = gatewayManageMapper;
|
||||||
} |
// }
|
||||||
|
//
|
||||||
/** |
// /**
|
||||||
* 按条件查询网关信息 |
// * 按条件查询网关信息
|
||||||
* @param grade |
// * @param grade
|
||||||
* @param operator |
// * @param operator
|
||||||
* @return |
// * @return
|
||||||
*/ |
// */
|
||||||
@Override |
// @Override
|
||||||
public List<GatewayManageEntity> queryByOther(Integer grade, Integer operator) { |
// public List<GatewayManageEntity> queryByOther(Integer grade, Integer operator) {
|
||||||
return gatewayManageMapper.queryByOther(grade, operator); |
// return gatewayManageMapper.queryByOther(grade, operator);
|
||||||
} |
// }
|
||||||
|
//
|
||||||
/** |
// @Override
|
||||||
* 新增或更新网关信息 |
// public String insertGatewayManage(GatewayManageEntity gatewayManageEntity) {
|
||||||
* @param gatewayManageEntity |
// // 判断是否已经包含
|
||||||
*/ |
// GatewayManageEntity gatewayManageEntity1 = gatewayManageMapper.queryGatewayByID(gatewayManageEntity.getId());
|
||||||
@Override |
// if (gatewayManageEntity1.getId() != null) {
|
||||||
public void addOrUpdateGateWayInfo(GatewayManageEntity gatewayManageEntity) { |
// return "数据重复,请重新插入";
|
||||||
if(gatewayManageEntity.getType().equals("edit")){ |
// } else {
|
||||||
// 更新
|
// gatewayManageMapper.insertGatewayManage(gatewayManageEntity);
|
||||||
gatewayManageMapper.updateGateWayInfo(gatewayManageEntity); |
// return "数据插入成功";
|
||||||
} else if (gatewayManageEntity.getType().equals("add")) { |
// }
|
||||||
// 新增
|
// }
|
||||||
gatewayManageMapper.insertGateWayInfo(gatewayManageEntity); |
//
|
||||||
} |
// @Override
|
||||||
} |
// public void deleteGatewayManageByID(int gatewayID) {
|
||||||
@Override |
// gatewayManageMapper.deleteGatewayManageByID(gatewayID);
|
||||||
public String insertGatewayManage(GatewayManageEntity gatewayManageEntity) { |
// }
|
||||||
// 判断是否已经包含
|
//
|
||||||
GatewayManageEntity gatewayManageEntity1 = gatewayManageMapper.queryGatewayByID(gatewayManageEntity.getId()); |
// @Override
|
||||||
if (gatewayManageEntity1.getId() != null) { |
// public GatewayManageEntity queryGatewayByID(Long gatewayID) {
|
||||||
return "数据重复,请重新插入"; |
// return gatewayManageMapper.queryGatewayByID(gatewayID);
|
||||||
} else { |
// }
|
||||||
gatewayManageMapper.insertGatewayManage(gatewayManageEntity); |
//
|
||||||
return "数据插入成功"; |
// @Override
|
||||||
} |
// public List<GatewayManageEntity> queryAll() {
|
||||||
} |
// return gatewayManageMapper.queryAll();
|
||||||
|
// }
|
||||||
@Override |
//
|
||||||
public void deleteGatewayManageByID(int gatewayID) { |
// @Override
|
||||||
gatewayManageMapper.deleteGatewayManageByID(gatewayID); |
// public int queryByOtherCount(int page, int size, int gatewayID) {
|
||||||
} |
// return gatewayManageMapper.queryByOtherCount(page, size, gatewayID);
|
||||||
|
// }
|
||||||
@Override |
//
|
||||||
public GatewayManageEntity queryGatewayByID(Long gatewayID) { |
// @Override
|
||||||
return gatewayManageMapper.queryGatewayByID(gatewayID); |
// public void updateGatewayManage(String IP,String port) {
|
||||||
} |
// gatewayManageMapper.updateGatewayManage(IP,port);
|
||||||
|
// }
|
||||||
@Override |
//
|
||||||
public List<GatewayManageEntity> queryAll() { |
// @Override
|
||||||
return gatewayManageMapper.queryAll(); |
// public void updateGatewayManage2(String port) {
|
||||||
} |
// gatewayManageMapper.updateGatewayManage2(port);
|
||||||
|
// }
|
||||||
@Override |
//
|
||||||
public int queryByOtherCount(int page, int size, int gatewayID) { |
// @Override
|
||||||
return gatewayManageMapper.queryByOtherCount(page, size, gatewayID); |
// public GatewayManageEntity queryGatewayByGrade(Long grade) {
|
||||||
} |
// return gatewayManageMapper.queryGatewayByGrade(grade);
|
||||||
|
// }
|
||||||
@Override |
//
|
||||||
public void updateGatewayManage(String IP,String port) { |
// @Override
|
||||||
gatewayManageMapper.updateGatewayManage(IP,port); |
// public String selectProjectName(String str) {
|
||||||
} |
// return gatewayManageMapper.selectProjectName(str);
|
||||||
|
// }
|
||||||
@Override |
//}
|
||||||
public void updateGatewayManage2(String port) { |
|
||||||
gatewayManageMapper.updateGatewayManage2(port); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public GatewayManageEntity queryGatewayByGrade(Long grade) { |
|
||||||
return gatewayManageMapper.queryGatewayByGrade(grade); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public String selectProjectName(String str) { |
|
||||||
return gatewayManageMapper.selectProjectName(str); |
|
||||||
} |
|
||||||
} |
|
||||||
|
@ -0,0 +1,68 @@ |
|||||||
|
package com.mh.user.service.impl; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||||
|
import com.github.pagehelper.PageHelper; |
||||||
|
import com.github.pagehelper.PageInfo; |
||||||
|
import com.mh.common.page.MybatisPageHelper; |
||||||
|
import com.mh.common.page.PageRequest; |
||||||
|
import com.mh.common.page.PageResult; |
||||||
|
import com.mh.common.utils.StringUtils; |
||||||
|
import com.mh.user.entity.DeviceParamsEntity; |
||||||
|
import com.mh.user.entity.GatewayManageEntity; |
||||||
|
import com.mh.user.mapper.DeviceParamsMapper; |
||||||
|
import com.mh.user.service.DeviceParamsService; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 设备采集服务类实现类 |
||||||
|
* @date 2024-08-23 09:34:07 |
||||||
|
*/ |
||||||
|
@Service |
||||||
|
public class DeviceParamsServiceImpl implements DeviceParamsService { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private DeviceParamsMapper deviceParamsMapper; |
||||||
|
|
||||||
|
@Override |
||||||
|
public PageResult queryByPage(PageRequest pageRequest) { |
||||||
|
String mtType = StringUtils.getColumnFilterValue(pageRequest, "mtType"); |
||||||
|
// 设置分页参数
|
||||||
|
int pageNum = pageRequest.getPageNum(); |
||||||
|
int pageSize = pageRequest.getPageSize(); |
||||||
|
if (pageNum != 0) { |
||||||
|
PageHelper.startPage(pageNum, pageSize); |
||||||
|
} |
||||||
|
QueryWrapper<DeviceParamsEntity> queryWrapper = new QueryWrapper<DeviceParamsEntity>(); |
||||||
|
if (!StringUtils.isBlank(mtType)) { |
||||||
|
queryWrapper.eq("mt_type", mtType); |
||||||
|
} |
||||||
|
List<DeviceParamsEntity> manageEntities = deviceParamsMapper.selectList(queryWrapper.orderByDesc("id")); |
||||||
|
return MybatisPageHelper.getPageResult(pageRequest, new PageInfo<>(manageEntities)); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void update(DeviceParamsEntity entity) { |
||||||
|
deviceParamsMapper.updateById(entity); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public DeviceParamsEntity findById(Integer id) { |
||||||
|
return deviceParamsMapper.selectById(id); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void save(DeviceParamsEntity entity) { |
||||||
|
deviceParamsMapper.insert(entity); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void delete(String id) { |
||||||
|
deviceParamsMapper.deleteById(id); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,71 @@ |
|||||||
|
package com.mh.user.service.impl; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||||
|
import com.github.pagehelper.PageHelper; |
||||||
|
import com.github.pagehelper.PageInfo; |
||||||
|
import com.mh.common.page.MybatisPageHelper; |
||||||
|
import com.mh.common.page.PageRequest; |
||||||
|
import com.mh.common.page.PageResult; |
||||||
|
import com.mh.common.utils.StringUtils; |
||||||
|
import com.mh.user.entity.DevicesManageEntity; |
||||||
|
import com.mh.user.mapper.DevicesManageMapper; |
||||||
|
import com.mh.user.service.DevicesManageService; |
||||||
|
import com.mh.user.utils.SecurityUtils; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
import java.util.Date; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 资产设备管理实现类 |
||||||
|
* @date 2024-08-23 10:25:06 |
||||||
|
*/ |
||||||
|
@Service |
||||||
|
public class DevicesManageServiceImpl implements DevicesManageService { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private DevicesManageMapper devicesManageMapper; |
||||||
|
|
||||||
|
@Override |
||||||
|
public PageResult queryByPage(PageRequest pageRequest) { |
||||||
|
String systemID = StringUtils.getColumnFilterValue(pageRequest, "systemId"); |
||||||
|
// 设置分页参数
|
||||||
|
int pageNum = pageRequest.getPageNum(); |
||||||
|
int pageSize = pageRequest.getPageSize(); |
||||||
|
if (pageNum != 0) { |
||||||
|
PageHelper.startPage(pageNum, pageSize); |
||||||
|
} |
||||||
|
List<DevicesManageEntity> manageEntities = devicesManageMapper.selectList( |
||||||
|
new QueryWrapper<DevicesManageEntity>() |
||||||
|
.eq("system_id", systemID) |
||||||
|
.orderByDesc("create_time")); |
||||||
|
return MybatisPageHelper.getPageResult(pageRequest, new PageInfo<>(manageEntities)); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void update(DevicesManageEntity entity) { |
||||||
|
entity.setUpdateTime(new Date()); |
||||||
|
devicesManageMapper.updateById(entity); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public DevicesManageEntity findById(Integer id) { |
||||||
|
return devicesManageMapper.selectById(id); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void save(DevicesManageEntity entity) { |
||||||
|
entity.setCreateBy(SecurityUtils.getUsername()); |
||||||
|
entity.setCreateTime(new Date()); |
||||||
|
devicesManageMapper.insert(entity); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void delete(String id) { |
||||||
|
devicesManageMapper.deleteById(id); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,79 @@ |
|||||||
|
package com.mh.user.service.impl; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||||
|
import com.github.pagehelper.PageHelper; |
||||||
|
import com.github.pagehelper.PageInfo; |
||||||
|
import com.mh.common.page.MybatisPageHelper; |
||||||
|
import com.mh.common.page.PageRequest; |
||||||
|
import com.mh.common.page.PageResult; |
||||||
|
import com.mh.common.utils.StringUtils; |
||||||
|
import com.mh.user.entity.GatewayManageEntity; |
||||||
|
import com.mh.user.mapper.chillers.GatewayManageMapper; |
||||||
|
import com.mh.user.service.GatewayManageService; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
import java.util.Date; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 网关管理实现类 |
||||||
|
* @date 2024-08-22 17:36:41 |
||||||
|
*/ |
||||||
|
@Service |
||||||
|
public class GatewayManageServiceImpl implements GatewayManageService { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private GatewayManageMapper gatewayManageMapper; |
||||||
|
|
||||||
|
@Override |
||||||
|
public PageResult queryByPage(PageRequest pageRequest) { |
||||||
|
String systemID = StringUtils.getColumnFilterValue(pageRequest, "systemId"); |
||||||
|
// 设置分页参数
|
||||||
|
int pageNum = pageRequest.getPageNum(); |
||||||
|
int pageSize = pageRequest.getPageSize(); |
||||||
|
if (pageNum != 0) { |
||||||
|
PageHelper.startPage(pageNum, pageSize); |
||||||
|
} |
||||||
|
List<GatewayManageEntity> manageEntities = gatewayManageMapper.selectList( |
||||||
|
new QueryWrapper<GatewayManageEntity>() |
||||||
|
.eq("system_id", systemID) |
||||||
|
.orderByDesc("create_time")); |
||||||
|
return MybatisPageHelper.getPageResult(pageRequest, new PageInfo<>(manageEntities)); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void update(GatewayManageEntity gatewayManageEntity) { |
||||||
|
gatewayManageEntity.setUpdateTime(new Date()); |
||||||
|
gatewayManageMapper.updateById(gatewayManageEntity); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public GatewayManageEntity findById(Integer id) { |
||||||
|
return gatewayManageMapper.selectById(id); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void save(GatewayManageEntity gatewayManageEntity) { |
||||||
|
gatewayManageEntity.setCreateTime(new Date()); |
||||||
|
gatewayManageMapper.insert(gatewayManageEntity); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void delete(String id) { |
||||||
|
gatewayManageMapper.deleteById(id); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String selectProjectName(String port) { |
||||||
|
return gatewayManageMapper.selectProjectName(port); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void updateGatewayManage2(String port) { |
||||||
|
gatewayManageMapper.updateGatewayManage2(port); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,69 @@ |
|||||||
|
package com.mh.user.service.impl; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||||
|
import com.github.pagehelper.PageHelper; |
||||||
|
import com.github.pagehelper.PageInfo; |
||||||
|
import com.mh.common.page.MybatisPageHelper; |
||||||
|
import com.mh.common.page.PageRequest; |
||||||
|
import com.mh.common.page.PageResult; |
||||||
|
import com.mh.common.utils.StringUtils; |
||||||
|
import com.mh.user.entity.MeterManageEntity; |
||||||
|
import com.mh.user.mapper.MeterManageMapper; |
||||||
|
import com.mh.user.service.MeterManageService; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
import java.util.Date; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description 仪表管理实现类 |
||||||
|
* @date 2024-08-23 09:02:18 |
||||||
|
*/ |
||||||
|
@Service |
||||||
|
public class MeterManageServiceImpl implements MeterManageService { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private MeterManageMapper meterManageMapper; |
||||||
|
|
||||||
|
@Override |
||||||
|
public PageResult queryByPage(PageRequest pageRequest) { |
||||||
|
String systemID = StringUtils.getColumnFilterValue(pageRequest, "systemId"); |
||||||
|
// 设置分页参数
|
||||||
|
int pageNum = pageRequest.getPageNum(); |
||||||
|
int pageSize = pageRequest.getPageSize(); |
||||||
|
if (pageNum != 0) { |
||||||
|
PageHelper.startPage(pageNum, pageSize); |
||||||
|
} |
||||||
|
List<MeterManageEntity> meterManageEntities = meterManageMapper.selectList( |
||||||
|
new QueryWrapper<MeterManageEntity>() |
||||||
|
.eq("system_id", systemID) |
||||||
|
.orderByDesc("create_time")); |
||||||
|
return MybatisPageHelper.getPageResult(pageRequest, new PageInfo<>(meterManageEntities)); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void update(MeterManageEntity entity) { |
||||||
|
entity.setUpdateTime(new Date()); |
||||||
|
meterManageMapper.updateById(entity); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public MeterManageEntity findById(Integer id) { |
||||||
|
return meterManageMapper.selectById(id); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void save(MeterManageEntity entity) { |
||||||
|
entity.setCreateTime(new Date()); |
||||||
|
meterManageMapper.insert(entity); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void delete(String id) { |
||||||
|
meterManageMapper.deleteById(id); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,87 @@ |
|||||||
|
package com.mh.user.service.impl; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||||
|
import com.github.pagehelper.PageHelper; |
||||||
|
import com.github.pagehelper.PageInfo; |
||||||
|
import com.mh.common.page.MybatisPageHelper; |
||||||
|
import com.mh.common.page.PageRequest; |
||||||
|
import com.mh.common.page.PageResult; |
||||||
|
import com.mh.common.utils.StringUtils; |
||||||
|
import com.mh.user.entity.MeterManageEntity; |
||||||
|
import com.mh.user.mapper.SysDictMapper; |
||||||
|
import com.mh.user.model.SysDict; |
||||||
|
import com.mh.user.service.SysDictService; |
||||||
|
import com.mh.user.utils.SecurityUtils; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
import java.util.Collections; |
||||||
|
import java.util.Date; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project mh_esi |
||||||
|
* @description |
||||||
|
* @date 2024-08-23 11:13:38 |
||||||
|
*/ |
||||||
|
@Service |
||||||
|
public class SysDictServiceImpl implements SysDictService { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private SysDictMapper sysDictMapper; |
||||||
|
|
||||||
|
@Override |
||||||
|
public boolean deleteByPrimaryKey(Long id) { |
||||||
|
return sysDictMapper.deleteByPrimaryKey(id); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public List<SysDict> findByLabel(String label) { |
||||||
|
return Collections.emptyList(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public int save(SysDict record) { |
||||||
|
record.setCreateBy(SecurityUtils.getUsername()); |
||||||
|
record.setCreateTime(new Date()); |
||||||
|
return sysDictMapper.insert(record); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public int delete(SysDict record) { |
||||||
|
return sysDictMapper.deleteById(record); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public int delete(List<SysDict> records) { |
||||||
|
return 0; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public SysDict findById(Long id) { |
||||||
|
return sysDictMapper.selectById(id); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public PageResult findPage(PageRequest pageRequest) { |
||||||
|
String systemID = StringUtils.getColumnFilterValue(pageRequest, "systemId"); |
||||||
|
// 设置分页参数
|
||||||
|
int pageNum = pageRequest.getPageNum(); |
||||||
|
int pageSize = pageRequest.getPageSize(); |
||||||
|
if (pageNum != 0) { |
||||||
|
PageHelper.startPage(pageNum, pageSize); |
||||||
|
} |
||||||
|
List<SysDict> sysDictList = sysDictMapper.selectList( |
||||||
|
new QueryWrapper<SysDict>().orderByDesc("create_time")); |
||||||
|
return MybatisPageHelper.getPageResult(pageRequest, new PageInfo<>(sysDictList)); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void updateByPrimaryKey(SysDict entity) { |
||||||
|
entity.setLastUpdateBy(SecurityUtils.getUsername()); |
||||||
|
entity.setLastUpdateTime(new Date()); |
||||||
|
sysDictMapper.updateById(entity); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue