Browse Source

1、冷量计采集进出水温度;

dev
mh 5 months ago
parent
commit
ab4b2fb3f4
  1. 39
      2024新增脚本.sql
  2. 5
      user-service/src/main/java/com/mh/user/strategy/ModbusProtocolStrategy.java
  3. 7
      user-service/src/main/resources/application.yml

39
2024新增脚本.sql

@ -247,3 +247,42 @@ ALTER TABLE data_result ADD register_addr varchar(50) NULL;
EXEC sys.sp_addextendedproperty 'MS_Description', N'寄存器地址', 'schema', N'dbo', 'table', N'data_result', 'column', N'register_addr'; EXEC sys.sp_addextendedproperty 'MS_Description', N'寄存器地址', 'schema', N'dbo', 'table', N'data_result', 'column', N'register_addr';
ALTER TABLE data_result ADD register_name varchar(50) NULL; ALTER TABLE data_result ADD register_name varchar(50) NULL;
EXEC sys.sp_addextendedproperty 'MS_Description', N'寄存器名称', 'schema', N'dbo', 'table', N'data_result', 'column', N'register_name'; EXEC sys.sp_addextendedproperty 'MS_Description', N'寄存器名称', 'schema', N'dbo', 'table', N'data_result', 'column', N'register_name';
-- 2024-11-21 添加进出水温度
INSERT
INTO
meter_manage (mt_type, mt_name, other_name, mt_brand, mt_num, mt_code, register_addr, func_code, identify_code, mt_caliber_pulse, mt_range, mt_ratio, mt_init_value, digits, data_type, cur_value, cur_time, mt_is_sum, create_time, update_time, unit, sort, data_com, device_id, gateway_id, param_id, protocol_type, communication_type, remark, system_id, project_id, grade, register_size, is_use)
VALUES(2, N'冷量计', N'进水温度值', N'建恒冷量计', N'44', N'44', N'0073', N'03', NULL, N'1600', 999999.990, 1, 0.000, 0, 2, NULL, NULL, 1, NULL, NULL, NULL, 53, NULL, 1, 2, 1, 1, 1, NULL, 1, 3, 141, 2, 1);
INSERT
INTO
meter_manage (mt_type, mt_name, other_name, mt_brand, mt_num, mt_code, register_addr, func_code, identify_code, mt_caliber_pulse, mt_range, mt_ratio, mt_init_value, digits, data_type, cur_value, cur_time, mt_is_sum, create_time, update_time, unit, sort, data_com, device_id, gateway_id, param_id, protocol_type, communication_type, remark, system_id, project_id, grade, register_size, is_use)
VALUES(2, N'冷量计', N'出水温度值', N'建恒冷量计', N'44', N'44', N'0075', N'03', NULL, N'1600', 999999.990, 1, 0.000, 0, 2, NULL, NULL, 1, NULL, NULL, NULL, 54, NULL, 1, 2, 1, 1, 1, NULL, 1, 3, 142, 2, 1);
INSERT
INTO
meter_manage (mt_type, mt_name, other_name, mt_brand, mt_num, mt_code, register_addr, func_code, identify_code, mt_caliber_pulse, mt_range, mt_ratio, mt_init_value, digits, data_type, cur_value, cur_time, mt_is_sum, create_time, update_time, unit, sort, data_com, device_id, gateway_id, param_id, protocol_type, communication_type, remark, system_id, project_id, grade, register_size, is_use)
VALUES(2, N'冷量计', N'进水温度值', N'建恒冷量计', N'41', N'41', N'0073', N'03', NULL, N'1600', 999999.990, 1, 0.000, 0, 2, NULL, NULL, 1, NULL, NULL, NULL, 55, NULL, 1, 2, 1, 1, 1, NULL, 1, 3, 141, 2, 1);
INSERT
INTO
meter_manage (mt_type, mt_name, other_name, mt_brand, mt_num, mt_code, register_addr, func_code, identify_code, mt_caliber_pulse, mt_range, mt_ratio, mt_init_value, digits, data_type, cur_value, cur_time, mt_is_sum, create_time, update_time, unit, sort, data_com, device_id, gateway_id, param_id, protocol_type, communication_type, remark, system_id, project_id, grade, register_size, is_use)
VALUES(2, N'冷量计', N'出水温度值', N'建恒冷量计', N'41', N'41', N'0075', N'03', NULL, N'1600', 999999.990, 1, 0.000, 0, 2, NULL, NULL, 1, NULL, NULL, NULL, 56, NULL, 1, 2, 1, 1, 1, NULL, 1, 3, 142, 2, 1);
INSERT
INTO
device_code_param (device_addr, device_type, str_data, data_port, baud_rate, brand, fun_code, register_addr, device_name, create_time, parity, project_id, digit, register_name, grade, mm_id, data_type, protocol_type)
VALUES(N'41', N'2', N'29030049000213F5', N'6002', 9600, N'建恒冷量计', N'03', N'0073', N'冷量计', '2024-11-21 17:30:55.010', N'none', N'3', 0, N'进水温度值', 141, 65, 2, 1);
INSERT
INTO
device_code_param (device_addr, device_type, str_data, data_port, baud_rate, brand, fun_code, register_addr, device_name, create_time, parity, project_id, digit, register_name, grade, mm_id, data_type, protocol_type)
VALUES(N'41', N'2', N'2903004B0002B235', N'6002', 9600, N'建恒冷量计', N'03', N'0075', N'冷量计', '2024-11-21 17:30:55.010', N'none', N'3', 0, N'出水温度值', 142, 66, 2, 1);
INSERT
INTO
device_code_param (device_addr, device_type, str_data, data_port, baud_rate, brand, fun_code, register_addr, device_name, create_time, parity, project_id, digit, register_name, grade, mm_id, data_type, protocol_type)
VALUES(N'44', N'2', N'2C030049000213A0', N'6002', 9600, N'建恒冷量计', N'03', N'0073', N'冷量计', '2024-11-21 17:30:55.010', N'none', N'3', 0, N'进水温度值', 141, 63, 2, 1);
INSERT
INTO
device_code_param (device_addr, device_type, str_data, data_port, baud_rate, brand, fun_code, register_addr, device_name, create_time, parity, project_id, digit, register_name, grade, mm_id, data_type, protocol_type)
VALUES(N'44', N'2', N'2C03004B0002B260', N'6002', 9600, N'建恒冷量计', N'03', N'0075', N'冷量计', '2024-11-21 17:30:55.010', N'none', N'3', 0, N'出水温度值', 142, 64, 2, 1);

5
user-service/src/main/java/com/mh/user/strategy/ModbusProtocolStrategy.java

@ -205,7 +205,10 @@ public void analysisCloudOrder485(final String data, final DeviceCodeParamEntity
System.out.println("插入时间30" + dateStr); System.out.println("插入时间30" + dateStr);
} }
try { try {
if (registerAddr.equals("0004") || registerAddr.equals("0020")) { if (registerAddr.equals("0004")
|| registerAddr.equals("0020")
|| registerAddr.equals("0073")
|| registerAddr.equals("0075")) {
dataResultCh.setDeviceAddr(cloudId); dataResultCh.setDeviceAddr(cloudId);
dataResultCh.setDeviceType(deviceCodeParam.getDeviceType()); dataResultCh.setDeviceType(deviceCodeParam.getDeviceType());
dataResultCh.setFunCode(deviceCodeParam.getFunCode()); dataResultCh.setFunCode(deviceCodeParam.getFunCode());

7
user-service/src/main/resources/application.yml

@ -1,3 +1,10 @@
spring: spring:
profiles: profiles:
active: dev active: dev
servlet:
multipart:
max-file-size: 50MB
max-request-size: 50MB
server:
undertow:
max-http-post-size: 20MB
Loading…
Cancel
Save