Yue 1 месяц назад
Родитель
Сommit
cbf9d62256

+ 2 - 2
SERVER/Meter_Service/config.yaml

@@ -6,8 +6,8 @@ vber:
   fwdPort: 14002 #数据转发端口
   mode: debug
 mysql:
-  host: 47.112.30.247
-  port: 23306
+  host: 192.168.0.104
+  port: 3306
   username: root
   password: 123456
   name: vbdsm_meter

+ 1 - 0
SERVER/Meter_Service/dataStruct/struct.go

@@ -77,6 +77,7 @@ type MeterRef struct {
 	PvRef float32
 	LvRef float32
 }
+
 type MeterRatio struct {
 	Ct int `json:"ct"`
 	Pt int `json:"pt"`

+ 86 - 0
SERVER/Meter_Service/database/vbdsm_meter.sql

@@ -0,0 +1,86 @@
+/*
+ Navicat Premium Data Transfer
+
+ Source Server         : L_104
+ Source Server Type    : MySQL
+ Source Server Version : 50743
+ Source Host           : 192.168.0.104:3306
+ Source Schema         : vbdsm_meter
+
+ Target Server Type    : MySQL
+ Target Server Version : 50743
+ File Encoding         : 65001
+
+ Date: 15/10/2024 13:14:07
+*/
+
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- Table structure for t_app_api_info
+-- ----------------------------
+DROP TABLE IF EXISTS `t_app_api_info`;
+CREATE TABLE `t_app_api_info`  (
+  `app_id` int(11) NOT NULL,
+  `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+  `url` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL,
+  PRIMARY KEY (`app_id`, `type`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of t_app_api_info
+-- ----------------------------
+INSERT INTO `t_app_api_info` VALUES (1000, 'GetDevices', '/Device/MockList');
+INSERT INTO `t_app_api_info` VALUES (1000, 'SendCmd', '/device/sendCmd');
+INSERT INTO `t_app_api_info` VALUES (1001, 'GetDevices', '/device/getList');
+INSERT INTO `t_app_api_info` VALUES (1002, 'GetDevices', '/GetDevs');
+INSERT INTO `t_app_api_info` VALUES (1002, 'SendCmd', '/SendCmd');
+
+-- ----------------------------
+-- Table structure for t_app_info
+-- ----------------------------
+DROP TABLE IF EXISTS `t_app_info`;
+CREATE TABLE `t_app_info`  (
+  `app_id` int(11) NOT NULL AUTO_INCREMENT,
+  `app_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+  `app_secret` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+  `host` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+  `is_delete` int(11) NOT NULL,
+  PRIMARY KEY (`app_id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1003 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of t_app_info
+-- ----------------------------
+INSERT INTO `t_app_info` VALUES (1000, 'TEST', 'TEST', 'http://meter.yue.shvber.com:4031', 0);
+INSERT INTO `t_app_info` VALUES (1001, 'DEMO', 'TEST', 'http://shvber.com', 1);
+INSERT INTO `t_app_info` VALUES (1002, 'TEST01', 'W98FWTQE2Y97U3RXSD6IMX0QCI0WEUK8', 'http://shvber.com', 1);
+
+-- ----------------------------
+-- Table structure for t_meter_calc_param
+-- ----------------------------
+DROP TABLE IF EXISTS `t_meter_calc_param`;
+CREATE TABLE `t_meter_calc_param`  (
+  `id` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+  `time` int(20) NULL DEFAULT NULL,
+  `sum_power` float(10, 2) NULL DEFAULT NULL,
+  `max_power` float(10, 2) NULL DEFAULT NULL,
+  `count` int(11) NULL DEFAULT NULL,
+  `tps` float NULL DEFAULT NULL,
+  `tqs` float NULL DEFAULT NULL,
+  `fps` float NULL DEFAULT NULL,
+  `fqs` float NULL DEFAULT NULL,
+  `tpe` float NULL DEFAULT NULL,
+  `tqe` float NULL DEFAULT NULL,
+  `fpe` float NULL DEFAULT NULL,
+  `fqe` float NULL DEFAULT NULL,
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of t_meter_calc_param
+-- ----------------------------
+INSERT INTO `t_meter_calc_param` VALUES ('2024031185256281581', 20240312, 13.44, 1.12, 25, 212.8, 0, 0, 4.8, 1.60001, 0, 0, 0);
+
+SET FOREIGN_KEY_CHECKS = 1;

+ 1 - 1
SERVER/Meter_Service/service/downStreamService/proto/acrel/adw300.go

@@ -59,7 +59,7 @@ func (m *adw300Meter) SetAddress(w rtuService.RtuNetPgr, addr int) (result bool)
 	return
 }
 
-// QueryRatio 查询电表变比
+// GetRatio 查询电表变比
 func (m *adw300Meter) GetRatio(w rtuService.RtuNetPgr) (string, bool) {
 	if adu, err := w.GetHoldingRegs(0x0E, 2); err != nil {
 		logger.Error("ADW300 查询电表变比失败  ERROR:%v", err)

+ 15 - 2
SERVER/Meter_Service/service/downStreamService/proto/pmc350b/pmc350b.go

@@ -18,7 +18,7 @@ type pmc350bMeter struct {
 var (
 	pmc350bCollects = []dataStruct.ParsingDataConfig{
 		{Origin: 0, Amount: 58, Method: pmc350bUIP},
-		{Origin: 32, Amount: 8, Method: pmc350bTemperature},
+		{Origin: 86, Amount: 8, Method: pmc350bTemperature},
 		{Origin: 500, Amount: 12, Method: pmc350bEnergy},
 		{Origin: 1400, Amount: 6, Method: pmc350bIHar},
 		{Origin: 1600, Amount: 6, Method: pmc350bUHar},
@@ -67,7 +67,7 @@ func (m *pmc350bMeter) SetAddress(w rtuService.RtuNetPgr, addr int) (result bool
 	return
 }
 
-// QueryRatio 查询电表变比
+// GetRatio 查询电表变比
 func (m *pmc350bMeter) GetRatio(w rtuService.RtuNetPgr) (string, bool) {
 	if adu, err := w.GetHoldingRegs(6000, 10); err != nil {
 		logger.Error("PMC-350B 查询电表变比失败  ERROR:%v", err)
@@ -153,6 +153,19 @@ func pmc350bUIP(adu []byte, s *dataStruct.CollectData) {
 	m = uint32(adu[index])<<24 | uint32(adu[index+1])<<16 | uint32(adu[index+2])<<8 | uint32(adu[index+3])
 	s.Uc = math.Float32frombits(m)
 	index += 4
+
+	index += 4
+	//ABC线电压
+	m = uint32(adu[index])<<24 | uint32(adu[index+1])<<16 | uint32(adu[index+2])<<8 | uint32(adu[index+3])
+	index += 4
+	s.Uab = math.Float32frombits(m)
+	m = uint32(adu[index])<<24 | uint32(adu[index+1])<<16 | uint32(adu[index+2])<<8 | uint32(adu[index+3])
+	index += 4
+	s.Ubc = math.Float32frombits(m)
+	m = uint32(adu[index])<<24 | uint32(adu[index+1])<<16 | uint32(adu[index+2])<<8 | uint32(adu[index+3])
+	index += 4
+	s.Uca = math.Float32frombits(m)
+	index += 4
 	//ABC电流
 	m = uint32(adu[index])<<24 | uint32(adu[index+1])<<16 | uint32(adu[index+2])<<8 | uint32(adu[index+3])
 	index += 4