Просмотр исходного кода

直接上报预付费阀控系统

yinyujing лет назад: 3
Родитель
Сommit
2ccf40c9cc

BIN
Lib/HPSocket4C.dll


+ 9 - 2
NB_IOT_TCP_HP_SOCKET/App.config

@@ -2,7 +2,7 @@
 <configuration>
   <appSettings>
     <add key="APPName" value="大表通讯服务器" />
-    <add key="db" value="Data Source=127.0.0.1;Initial Catalog=sdww_qz;Persist Security Info=True;User ID=sa;Password=123456;Pooling=yes;MultipleActiveResultSets=True" />
+    <add key="db" value="Data Source=47.105.45.253;Initial Catalog=RuralWaterPipNetWork;Persist Security Info=True;User ID=sa;Password=wwkj@2136828;Pooling=yes;MultipleActiveResultSets=True" />
     <!--心跳间隔时间(毫秒)-->
     <add key="ConnectionTimeOut" value="120000" />
     <!--执行断开静默链接间隔时间毫秒-->
@@ -25,13 +25,20 @@
     <!--自动启动标志1:自动启动;0:不自动启动-->
     <add key="AutoStart" value="0" />
     <!--上报IP-->
-    <add key="ReportIP" value="192.168.17.151" />
+    <add key="ReportIP" value="" />
     <!--上报端口-->
     <add key="ReportPort" value="123" />
     <!--监听端口-->
     <add key="MonitorPort" value="" />
     <!--是否记录所有日志 1:是,0:否(只记录错误日志)-->
     <add key="IsAllLog" value="1" />
+    <!--是否记录所有日志 1:是,0:否(只记录错误日志)-->
+    <add key="IsAllLog" value="1" />
+
+    <!-- 上报抄表数据对应的数据库字段(历史记录表MeterAssessment_***) -->
+    <add key="DataColumnHis" value="NetCumulativeFlow|净累计流量,PositiveCumulativeFlow|正累计流量,NegativeCumulativeFlow|负累计流量,InstantaneousFlow|瞬时流量,Pressure|压力,BatteryVoltageValue|电池电压,signalQuality|信号质量" />
+    <!-- 上报抄表数据对应的数据库字段(水表表MeterAssessmentBase) -->
+    <add key="DataColumnMeter" value="NetCumulativeFlow|净累计流量,PositiveCumulativeFlow|正累计流量,NegativeCumulativeFlow|负累计流量,InstantaneousFlow|瞬时流量,Pressure|压力,BatteryVoltageValue|电池电压,signalQuality|信号质量" />
   </appSettings>
   <startup>
     <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />

+ 89 - 59
NB_IOT_TCP_HP_SOCKET/MainForm_TCP.Designer.cs

@@ -88,23 +88,24 @@
             // 
             // contextMenuStrip1
             // 
+            this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
             this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.显示ToolStripMenuItem,
             this.退出ToolStripMenuItem});
             this.contextMenuStrip1.Name = "contextMenuStrip1";
-            this.contextMenuStrip1.Size = new System.Drawing.Size(101, 48);
+            this.contextMenuStrip1.Size = new System.Drawing.Size(117, 64);
             // 
             // 显示ToolStripMenuItem
             // 
             this.显示ToolStripMenuItem.Name = "显示ToolStripMenuItem";
-            this.显示ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
+            this.显示ToolStripMenuItem.Size = new System.Drawing.Size(116, 30);
             this.显示ToolStripMenuItem.Text = "显示";
             this.显示ToolStripMenuItem.Click += new System.EventHandler(this.显示ToolStripMenuItem_Click);
             // 
             // 退出ToolStripMenuItem
             // 
             this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem";
-            this.退出ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
+            this.退出ToolStripMenuItem.Size = new System.Drawing.Size(116, 30);
             this.退出ToolStripMenuItem.Text = "退出";
             this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click);
             // 
@@ -114,10 +115,11 @@
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
             this.lbErrorData.FormattingEnabled = true;
-            this.lbErrorData.ItemHeight = 12;
-            this.lbErrorData.Location = new System.Drawing.Point(6, 15);
+            this.lbErrorData.ItemHeight = 18;
+            this.lbErrorData.Location = new System.Drawing.Point(9, 22);
+            this.lbErrorData.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.lbErrorData.Name = "lbErrorData";
-            this.lbErrorData.Size = new System.Drawing.Size(747, 52);
+            this.lbErrorData.Size = new System.Drawing.Size(1118, 76);
             this.lbErrorData.TabIndex = 0;
             // 
             // groupBox3
@@ -126,9 +128,11 @@
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
             this.groupBox3.Controls.Add(this.lbErrorData);
-            this.groupBox3.Location = new System.Drawing.Point(11, 3);
+            this.groupBox3.Location = new System.Drawing.Point(16, 4);
+            this.groupBox3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.groupBox3.Name = "groupBox3";
-            this.groupBox3.Size = new System.Drawing.Size(753, 75);
+            this.groupBox3.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.groupBox3.Size = new System.Drawing.Size(1130, 112);
             this.groupBox3.TabIndex = 8;
             this.groupBox3.TabStop = false;
             this.groupBox3.Text = "错误信息";
@@ -136,47 +140,48 @@
             // toolStripStatusLabel6
             // 
             this.toolStripStatusLabel6.Name = "toolStripStatusLabel6";
-            this.toolStripStatusLabel6.Size = new System.Drawing.Size(68, 17);
+            this.toolStripStatusLabel6.Size = new System.Drawing.Size(100, 24);
             this.toolStripStatusLabel6.Text = "系统时间:";
             // 
             // toolStripStatusLabel5
             // 
             this.toolStripStatusLabel5.Name = "toolStripStatusLabel5";
-            this.toolStripStatusLabel5.Size = new System.Drawing.Size(11, 17);
+            this.toolStripStatusLabel5.Size = new System.Drawing.Size(15, 24);
             this.toolStripStatusLabel5.Text = "|";
             // 
             // toolStripStatusLabel4
             // 
             this.toolStripStatusLabel4.Name = "toolStripStatusLabel4";
-            this.toolStripStatusLabel4.Size = new System.Drawing.Size(92, 17);
+            this.toolStripStatusLabel4.Size = new System.Drawing.Size(136, 24);
             this.toolStripStatusLabel4.Text = "系统持续运行:";
             // 
             // toolStripStatusLabel7
             // 
             this.toolStripStatusLabel7.Name = "toolStripStatusLabel7";
-            this.toolStripStatusLabel7.Size = new System.Drawing.Size(11, 17);
+            this.toolStripStatusLabel7.Size = new System.Drawing.Size(15, 24);
             this.toolStripStatusLabel7.Text = "|";
             // 
             // toolStripStatusLabel3
             // 
             this.toolStripStatusLabel3.Name = "toolStripStatusLabel3";
-            this.toolStripStatusLabel3.Size = new System.Drawing.Size(92, 17);
+            this.toolStripStatusLabel3.Size = new System.Drawing.Size(136, 24);
             this.toolStripStatusLabel3.Text = "客户端连接数:";
             // 
             // toolStripStatusLabel2
             // 
             this.toolStripStatusLabel2.Name = "toolStripStatusLabel2";
-            this.toolStripStatusLabel2.Size = new System.Drawing.Size(11, 17);
+            this.toolStripStatusLabel2.Size = new System.Drawing.Size(15, 24);
             this.toolStripStatusLabel2.Text = "|";
             // 
             // toolStripStatusLabel1
             // 
             this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
-            this.toolStripStatusLabel1.Size = new System.Drawing.Size(35, 17);
+            this.toolStripStatusLabel1.Size = new System.Drawing.Size(50, 24);
             this.toolStripStatusLabel1.Text = "状态:";
             // 
             // statusStrip1
             // 
+            this.statusStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
             this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.toolStripStatusLabel1,
             this.toolStripStatusLabel2,
@@ -185,18 +190,20 @@
             this.toolStripStatusLabel4,
             this.toolStripStatusLabel5,
             this.toolStripStatusLabel6});
-            this.statusStrip1.Location = new System.Drawing.Point(0, 473);
+            this.statusStrip1.Location = new System.Drawing.Point(0, 711);
             this.statusStrip1.Name = "statusStrip1";
-            this.statusStrip1.Size = new System.Drawing.Size(800, 22);
+            this.statusStrip1.Padding = new System.Windows.Forms.Padding(2, 0, 21, 0);
+            this.statusStrip1.Size = new System.Drawing.Size(1200, 31);
             this.statusStrip1.TabIndex = 7;
             this.statusStrip1.Text = "statusStrip1";
             // 
             // button2
             // 
             this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.button2.Location = new System.Drawing.Point(285, 277);
+            this.button2.Location = new System.Drawing.Point(429, 415);
+            this.button2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.button2.Name = "button2";
-            this.button2.Size = new System.Drawing.Size(75, 23);
+            this.button2.Size = new System.Drawing.Size(112, 34);
             this.button2.TabIndex = 2;
             this.button2.Text = "清空显示";
             this.button2.UseVisualStyleBackColor = true;
@@ -209,9 +216,11 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.groupBox2.Controls.Add(this.button2);
             this.groupBox2.Controls.Add(this.lbReceiveData);
-            this.groupBox2.Location = new System.Drawing.Point(6, 4);
+            this.groupBox2.Location = new System.Drawing.Point(9, 6);
+            this.groupBox2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.groupBox2.Name = "groupBox2";
-            this.groupBox2.Size = new System.Drawing.Size(366, 306);
+            this.groupBox2.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.groupBox2.Size = new System.Drawing.Size(550, 458);
             this.groupBox2.TabIndex = 2;
             this.groupBox2.TabStop = false;
             this.groupBox2.Text = "接收数据";
@@ -222,18 +231,20 @@
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
             this.lbReceiveData.FormattingEnabled = true;
-            this.lbReceiveData.ItemHeight = 12;
-            this.lbReceiveData.Location = new System.Drawing.Point(6, 20);
+            this.lbReceiveData.ItemHeight = 18;
+            this.lbReceiveData.Location = new System.Drawing.Point(9, 30);
+            this.lbReceiveData.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.lbReceiveData.Name = "lbReceiveData";
-            this.lbReceiveData.Size = new System.Drawing.Size(354, 256);
+            this.lbReceiveData.Size = new System.Drawing.Size(530, 364);
             this.lbReceiveData.TabIndex = 1;
             // 
             // button1
             // 
             this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.button1.Location = new System.Drawing.Point(287, 277);
+            this.button1.Location = new System.Drawing.Point(430, 415);
+            this.button1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.button1.Name = "button1";
-            this.button1.Size = new System.Drawing.Size(75, 23);
+            this.button1.Size = new System.Drawing.Size(112, 34);
             this.button1.TabIndex = 1;
             this.button1.Text = "清空显示";
             this.button1.UseVisualStyleBackColor = true;
@@ -245,10 +256,11 @@
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
             this.lbSendData.FormattingEnabled = true;
-            this.lbSendData.ItemHeight = 12;
-            this.lbSendData.Location = new System.Drawing.Point(6, 20);
+            this.lbSendData.ItemHeight = 18;
+            this.lbSendData.Location = new System.Drawing.Point(9, 30);
+            this.lbSendData.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.lbSendData.Name = "lbSendData";
-            this.lbSendData.Size = new System.Drawing.Size(356, 256);
+            this.lbSendData.Size = new System.Drawing.Size(532, 364);
             this.lbSendData.TabIndex = 0;
             // 
             // groupBox1
@@ -258,27 +270,31 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.groupBox1.Controls.Add(this.button1);
             this.groupBox1.Controls.Add(this.lbSendData);
-            this.groupBox1.Location = new System.Drawing.Point(3, 4);
+            this.groupBox1.Location = new System.Drawing.Point(4, 6);
+            this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Size = new System.Drawing.Size(368, 306);
+            this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.groupBox1.Size = new System.Drawing.Size(552, 458);
             this.groupBox1.TabIndex = 1;
             this.groupBox1.TabStop = false;
             this.groupBox1.Text = "发送数据";
             // 
             // txtPort
             // 
-            this.txtPort.Location = new System.Drawing.Point(167, 15);
+            this.txtPort.Location = new System.Drawing.Point(250, 22);
+            this.txtPort.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.txtPort.Name = "txtPort";
             this.txtPort.ReadOnly = true;
-            this.txtPort.Size = new System.Drawing.Size(40, 21);
+            this.txtPort.Size = new System.Drawing.Size(58, 28);
             this.txtPort.TabIndex = 19;
             // 
             // txtIpAddress
             // 
-            this.txtIpAddress.Location = new System.Drawing.Point(7, 14);
+            this.txtIpAddress.Location = new System.Drawing.Point(10, 21);
+            this.txtIpAddress.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.txtIpAddress.Name = "txtIpAddress";
             this.txtIpAddress.ReadOnly = true;
-            this.txtIpAddress.Size = new System.Drawing.Size(101, 21);
+            this.txtIpAddress.Size = new System.Drawing.Size(150, 28);
             this.txtIpAddress.TabIndex = 18;
             this.txtIpAddress.Text = "0.0.0.0";
             // 
@@ -287,9 +303,10 @@
             this.btnStop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.btnStop.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.btnStop.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
-            this.btnStop.Location = new System.Drawing.Point(710, 6);
+            this.btnStop.Location = new System.Drawing.Point(1065, 9);
+            this.btnStop.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.btnStop.Name = "btnStop";
-            this.btnStop.Size = new System.Drawing.Size(47, 34);
+            this.btnStop.Size = new System.Drawing.Size(70, 51);
             this.btnStop.TabIndex = 17;
             this.btnStop.Text = "停止";
             this.btnStop.UseVisualStyleBackColor = true;
@@ -300,9 +317,10 @@
             this.btnStart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.btnStart.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.btnStart.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
-            this.btnStart.Location = new System.Drawing.Point(657, 6);
+            this.btnStart.Location = new System.Drawing.Point(986, 9);
+            this.btnStart.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.btnStart.Name = "btnStart";
-            this.btnStart.Size = new System.Drawing.Size(47, 34);
+            this.btnStart.Size = new System.Drawing.Size(70, 51);
             this.btnStart.TabIndex = 16;
             this.btnStart.Text = "启动";
             this.btnStart.UseVisualStyleBackColor = true;
@@ -313,7 +331,8 @@
             this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.splitContainer1.Location = new System.Drawing.Point(11, 3);
+            this.splitContainer1.Location = new System.Drawing.Point(16, 4);
+            this.splitContainer1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.splitContainer1.Name = "splitContainer1";
             // 
             // splitContainer1.Panel1
@@ -323,8 +342,9 @@
             // splitContainer1.Panel2
             // 
             this.splitContainer1.Panel2.Controls.Add(this.groupBox2);
-            this.splitContainer1.Size = new System.Drawing.Size(753, 319);
-            this.splitContainer1.SplitterDistance = 374;
+            this.splitContainer1.Size = new System.Drawing.Size(1130, 477);
+            this.splitContainer1.SplitterDistance = 561;
+            this.splitContainer1.SplitterWidth = 6;
             this.splitContainer1.TabIndex = 9;
             // 
             // panel1
@@ -341,52 +361,59 @@
             this.panel1.Controls.Add(this.txtIpAddress);
             this.panel1.Controls.Add(this.btnStop);
             this.panel1.Controls.Add(this.btnStart);
-            this.panel1.Location = new System.Drawing.Point(12, 6);
+            this.panel1.Location = new System.Drawing.Point(18, 9);
+            this.panel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(776, 48);
+            this.panel1.Size = new System.Drawing.Size(1163, 71);
             this.panel1.TabIndex = 6;
             // 
             // label2
             // 
             this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(224, 19);
+            this.label2.Location = new System.Drawing.Point(336, 28);
+            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(77, 12);
+            this.label2.Size = new System.Drawing.Size(116, 18);
             this.label2.TabIndex = 27;
             this.label2.Text = "网站监听端口";
             // 
             // label1
             // 
             this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(111, 19);
+            this.label1.Location = new System.Drawing.Point(166, 28);
+            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(53, 12);
+            this.label1.Size = new System.Drawing.Size(80, 18);
             this.label1.TabIndex = 26;
             this.label1.Text = "上报端口";
             // 
             // txtMonitorPort
             // 
-            this.txtMonitorPort.Location = new System.Drawing.Point(306, 15);
+            this.txtMonitorPort.Location = new System.Drawing.Point(459, 22);
+            this.txtMonitorPort.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.txtMonitorPort.Name = "txtMonitorPort";
             this.txtMonitorPort.ReadOnly = true;
-            this.txtMonitorPort.Size = new System.Drawing.Size(40, 21);
+            this.txtMonitorPort.Size = new System.Drawing.Size(58, 28);
             this.txtMonitorPort.TabIndex = 25;
             // 
             // button4
             // 
-            this.button4.Location = new System.Drawing.Point(474, 12);
+            this.button4.Location = new System.Drawing.Point(711, 18);
+            this.button4.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.button4.Name = "button4";
-            this.button4.Size = new System.Drawing.Size(75, 23);
+            this.button4.Size = new System.Drawing.Size(112, 34);
             this.button4.TabIndex = 24;
             this.button4.Text = "实时监控";
             this.button4.UseVisualStyleBackColor = true;
+            this.button4.Visible = false;
             this.button4.Click += new System.EventHandler(this.button4_Click);
             // 
             // button3
             // 
-            this.button3.Location = new System.Drawing.Point(362, 12);
+            this.button3.Location = new System.Drawing.Point(543, 18);
+            this.button3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.button3.Name = "button3";
-            this.button3.Size = new System.Drawing.Size(75, 23);
+            this.button3.Size = new System.Drawing.Size(112, 34);
             this.button3.TabIndex = 23;
             this.button3.Text = "参数设置";
             this.button3.UseVisualStyleBackColor = true;
@@ -403,7 +430,8 @@
             this.splitContainer2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.splitContainer2.Location = new System.Drawing.Point(12, 60);
+            this.splitContainer2.Location = new System.Drawing.Point(18, 90);
+            this.splitContainer2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.splitContainer2.Name = "splitContainer2";
             this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
             // 
@@ -414,19 +442,21 @@
             // splitContainer2.Panel2
             // 
             this.splitContainer2.Panel2.Controls.Add(this.groupBox3);
-            this.splitContainer2.Size = new System.Drawing.Size(776, 410);
-            this.splitContainer2.SplitterDistance = 325;
+            this.splitContainer2.Size = new System.Drawing.Size(1164, 615);
+            this.splitContainer2.SplitterDistance = 487;
+            this.splitContainer2.SplitterWidth = 6;
             this.splitContainer2.TabIndex = 10;
             // 
             // MainForm_TCP
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(800, 495);
+            this.ClientSize = new System.Drawing.Size(1200, 742);
             this.Controls.Add(this.splitContainer2);
             this.Controls.Add(this.statusStrip1);
             this.Controls.Add(this.panel1);
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
+            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.Name = "MainForm_TCP";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Text = "大表通讯服务器TCP";

+ 30 - 25
NB_IOT_TCP_HP_SOCKET/MainForm_TCP.cs

@@ -943,7 +943,7 @@ namespace NB_IOT_TCP_HP_SOCKET
                             if (!msg.Result)
                             {
                                 // 阀门控制回包
-                                if (msg.Message == "参数包")
+                                if (msg.Message == "参数包")
                                 {
                                     insourcingData.DataType = "0";
                                     //1.解析参数包
@@ -966,7 +966,7 @@ namespace NB_IOT_TCP_HP_SOCKET
                                             if (rs)
                                             {
                                                 PSProtocol protocol2 = new PSProtocol(psp.DestNumber, psp.SourceNumber, backParamSendCode);
-                                                protocol2.Type = psp.Type;
+                                                protocol2.Type = FrameType.Battery_EndComm;
 
                                                 if (ProtocolAnalysisTools.OuterPack(protocol2, out byte[] buffer3).Result)
                                                 {
@@ -997,7 +997,7 @@ namespace NB_IOT_TCP_HP_SOCKET
                                                 if (result)
                                                 {
                                                     PSProtocol protocol2 = new PSProtocol(psp.DestNumber, psp.SourceNumber, backParamSendCode);
-                                                    protocol2.Type = psp.Type;
+                                                    protocol2.Type = FrameType.Battery_EndComm;
 
                                                     if (ProtocolAnalysisTools.OuterPack(protocol2, out byte[] buffer3).Result)
                                                     {
@@ -1210,51 +1210,53 @@ namespace NB_IOT_TCP_HP_SOCKET
                                     {
                                         string valveState = "";
                                         string backValveSate = "";
+                                        string iStatus = "";
                                         switch (cjt.Data[0])
                                         {
                                             case 0x55:
                                                 valveState = "开阀";
                                                 backValveSate = "OPEN";
+                                                iStatus = "0";
                                                 break;
                                             case 0x99:
                                                 valveState = "关阀";
                                                 backValveSate = "CLOSE";
+                                                iStatus = "1";
                                                 break;
                                             case 0xFF:
                                                 valveState = "异常";
                                                 backValveSate = "ERROR";
+                                                iStatus = "2";
                                                 break;
                                         }
 
-                                        sql = "declare @sql varchar(200) if col_length('设备信息','阀门状态') is null begin set @sql = 'alter table 设备信息 add 阀门状态 varchar(20)' EXEC(@sql) end";
-                                        sql += " if col_length('设备信息', '阀门状态更新时间') is null begin set @sql = 'alter table 设备信息 add 阀门状态更新时间 datetime' EXEC(@sql) end ";
-                                        DBHelper.Query(sql);
 
-                                        sql = "select Top 1 ID,isnull(阀门状态,'') as valveState,isnull(考核表编码,'') as devCode from 设备信息 where 通讯设备ID=" + dt.Rows[0]["transId"].ToString();
+                                        sql = "select * from 设备信息 where 通讯设备ID=" + dt.Rows[0]["transId"].ToString();
                                         DataTable dataTable = DBHelper.ExecuteDataTable(sql, CommandType.Text, null);
                                         int num = dataTable.Rows.Count;
                                         if (num > 0)//存在一条记录
                                         {
-                                            string devCode = dataTable.Rows[0]["devCode"].ToString();
+                                            //string devCode = dataTable.Rows[0]["devCode"].ToString();
                                             string devId = dataTable.Rows[0]["ID"].ToString();
+                                            string meterId = dataTable.Rows[0]["MeterId"].ToString();
 
                                             // 更新阀门状态
-                                            sql = "update 设备信息 Set 阀门状态='" + valveState + "',阀门状态更新时间=getdate() Where ID=" + devId;
+                                            sql = "UPDATE [MeterAssessmentBase] SET  valveStatus = " + iStatus + " WHERE MeterAssessmentId = " + meterId;
                                             DBHelper.Query(sql);
 
                                             // 如果配置了第三方阀门状态同步接口,则回调接口
-                                            if (!string.IsNullOrEmpty(devCode) && !string.IsNullOrEmpty(backValveSate) && !string.IsNullOrEmpty(ruralWaterURL))
-                                            {
-                                                try
-                                                {
-                                                    ProtocolAnalysisTools.postSend(ruralWaterURL, "otherUniqueIdentification=" + devCode + "&status=" + backValveSate);
-                                                }
-                                                catch (Exception ex)
-                                                {
-                                                    AddMsg(ex.Message + ">>>" + ex.StackTrace, lbErrorData);
-                                                }
-
-                                            }
+                                            //if (!string.IsNullOrEmpty(devCode) && !string.IsNullOrEmpty(backValveSate) && !string.IsNullOrEmpty(ruralWaterURL))
+                                            //{
+                                            //    try
+                                            //    {
+                                            //        ProtocolAnalysisTools.postSend(ruralWaterURL, "otherUniqueIdentification=" + devCode + "&status=" + backValveSate);
+                                            //    }
+                                            //    catch (Exception ex)
+                                            //    {
+                                            //        AddMsg(ex.Message + ">>>" + ex.StackTrace, lbErrorData);
+                                            //    }
+
+                                            //}
 
                                         }
                                     }
@@ -1294,7 +1296,7 @@ namespace NB_IOT_TCP_HP_SOCKET
                                                     // 如果是第三方控制指令则给第三方返回结果
                                                     if (sendInfo != null)
                                                     {
-                                                        ProtocolAnalysisTools.postSend(sendInfo.URL, sendInfo.Params);
+                                                        //ProtocolAnalysisTools.postSend(sendInfo.URL, sendInfo.Params);
                                                     }
                                                 }
 
@@ -1348,7 +1350,8 @@ namespace NB_IOT_TCP_HP_SOCKET
                                 }
 
                                 // 保存抄表数据
-                                ProtocolAnalysisTools.SaveRecord(list);
+                                //ProtocolAnalysisTools.SaveRecord(list);
+                                ProtocolAnalysisTools.SaveRecordNew(list);
                             }
                         }
 
@@ -1481,6 +1484,7 @@ namespace NB_IOT_TCP_HP_SOCKET
             {
                 string deviceId = dataTable.Rows[i]["deviceId"].ToString();
                 string stationTypeId = dataTable.Rows[i]["用户站参数"].ToString();
+                string meterId = dataTable.Rows[i]["MeterId"].ToString();
                 StationType stationType = new StationType(stationTypeId);
                 Dictionary<string, CommOption> analogCommOptions = stationType.GetAnalogCommOptions();
 
@@ -1524,6 +1528,7 @@ namespace NB_IOT_TCP_HP_SOCKET
                     record.DataSource = "定时存储";
                 }
                 record.DeviceId = deviceId;
+                record.MeterId = meterId;
                 hislist.Add(record);
             }
 
@@ -1598,7 +1603,7 @@ namespace NB_IOT_TCP_HP_SOCKET
                     }
                     else
                     {
-                        AddMsg($" > [{clientInfo.ConnId},OnSend] -> {clientInfo.IpAddress}:{clientInfo.Port} {clientInfo.SourceNumber} ({buffer3.Length} bytes) CD_CellMonitor下发设参打包成功 \n {BitConverter.ToString(buffer3, 0, buffer3.Length).Replace("-", " ")} ", lbErrorData);
+                        AddMsg($" > [{clientInfo.ConnId},OnSend] -> {clientInfo.IpAddress}:{clientInfo.Port} {clientInfo.SourceNumber} ({buffer3.Length} bytes) CD_CellMonitor下发设参打包成功 \n {BitConverter.ToString(buffer3, 0, buffer3.Length).Replace("-", " ")} ", lbReceiveData);
                         // 下发设参数
                         bool sendFlag = server.Send(clientInfo.ConnId, buffer3, buffer3.Length);
                         // 发送成功更新发送次数和发送时间
@@ -1774,7 +1779,7 @@ namespace NB_IOT_TCP_HP_SOCKET
             {
                 // 关闭所有的线程
                 this.Dispose();
-                this.Close();
+                Environment.Exit(0);
             }
         }
     }

+ 14 - 0
NB_IOT_TCP_HP_SOCKET/WWKJUtil/HistoryRecord.cs

@@ -17,6 +17,8 @@ namespace NB_IOT_TCP_HP_SOCKET.WWKJUtil
 
         private string dataSource;
 
+        private string meterId;
+
         public string DataSource
         {
             get
@@ -41,6 +43,18 @@ namespace NB_IOT_TCP_HP_SOCKET.WWKJUtil
             }
         }
 
+        public string MeterId
+        {
+            get
+            {
+                return this.meterId;
+            }
+            set
+            {
+                this.meterId = value;
+            }
+        }
+
         public DateTime RecordTime
         {
             get

+ 191 - 4
NB_IOT_TCP_HP_SOCKET/WWKJUtil/ProtocolAnalysisTools.cs

@@ -191,7 +191,7 @@ namespace NB_IOT_TCP_HP_SOCKET.WWKJUtil
             char ch2;
             if ((((data[0] == 0x68) && (data[1] == 0xb0))) && (SumCheck(data, 0, data.Length - 2) == data[data.Length - 2]))
             {
-                return new ResMsg(false, "参数包");
+                return new ResMsg(false, "参数包");
             }
 
             if (data.Length < 0x17)
@@ -495,7 +495,7 @@ namespace NB_IOT_TCP_HP_SOCKET.WWKJUtil
             for (int i = startIndex; i < endIndex; i++)
             {
                 num = num + buffer[i];
-                num = num % 256;
+                num = num % 0x100;
             }
             return (byte)num;
         }
@@ -616,6 +616,108 @@ namespace NB_IOT_TCP_HP_SOCKET.WWKJUtil
             }
         }
 
+        /// <summary>
+        /// 保存抄表历史记录(直接保存到预收费系统表中)
+        /// </summary>
+        /// <param name="list"></param>
+        public static void SaveRecordNew(List<HistoryRecord> list)
+        {
+            // 上报抄表数据对应的数据库字段(历史记录表MeterAssessment_***)
+            string dataColumnHis = ConfigurationManager.AppSettings["DataColumnHis"];
+            string[] dataColumnHisArr = dataColumnHis.Split(',');
+            // 接收数据与数据库表对应关系
+            Dictionary<string, string> cols = new Dictionary<string, string>();
+            foreach (string dataColumn in dataColumnHisArr) 
+            {
+                string[] dataColumnArr = dataColumn.Split('|');
+                cols[dataColumnArr[0]] = dataColumnArr[1];
+            }
+            // 存放每个设备的最后一条数据
+            Dictionary<string, HistoryRecord> lastData = new Dictionary<string, HistoryRecord>();
+            if (list != null && list.Count > 1)
+            {
+                list.Sort(SortList);
+            }
+            foreach (HistoryRecord record2 in list)
+            {
+                try
+                {
+                    string deviceid = record2.DeviceId;
+                    string meterId = record2.MeterId;
+                    string tablename = "MeterAssessment_" + meterId;
+                    // 判断同一抄表时间的历史记录是否存在
+                    if (!CheckRecordExsitNew(tablename, record2.RecordTime))
+                    {
+                        StringBuilder strSql = new StringBuilder();
+                        strSql.Append(" insert into ").Append(tablename).Append(" ( GetDateTime,createTime");
+                        List<CommData> dataList = record2.DataList;
+                        StringBuilder cellValue = new StringBuilder();
+                        foreach (KeyValuePair<string, string> kvp in cols) 
+                        {
+                            CommData commData = dataList.Find(e => e.Name == kvp.Value);
+                            if (commData != null) 
+                            {
+                                strSql.Append(",").Append(kvp.Key);
+                                if ((((commData.Value == null) || (commData.Value == "")) || ((commData.Value == "未知") || (commData.Value == "--"))) || (commData.Value == "非数字"))
+                                {
+                                    cellValue.Append(",0");
+                                }
+                                else
+                                {
+                                    if (commData.Tag == null || "".Equals(commData.Tag) || "BIT".Equals(commData.Tag.ToUpper()))
+                                    {
+                                        cellValue.Append(",'").Append(commData.Value).Append("'");
+                                    }
+                                    else
+                                    {
+                                        cellValue.Append(",").Append(commData.Value);
+                                    }
+                                }
+                            }
+                        }
+                        strSql.Append(") values ('").Append(record2.RecordTime.ToString()).Append("',GETDATE()").Append(cellValue.ToString()).Append(")");
+
+                        int rs = DBHelper.Query(strSql.ToString());
+
+                        if (rs > 0)
+                        {
+                            if (lastData.ContainsKey(meterId))
+                            {
+                                HistoryRecord historyRecord = lastData[meterId];
+                                if (record2.RecordTime >= historyRecord.RecordTime)
+                                {
+                                    lastData[meterId] = record2;
+                                }
+                            }
+                            else
+                            {
+                                lastData[meterId] = record2;
+                            }
+                        }
+                    }
+                }
+                catch (Exception ex)
+                {
+                    LogUtil.WriteLog(ex.Message + ">>>" + ex.StackTrace);
+                    continue;
+                }
+            }
+
+            // 更新最后状态信息
+            foreach (KeyValuePair<string, HistoryRecord> kvp in lastData)
+            {
+                try
+                {
+                    UpdateDeviceLastDataNew(kvp);
+                }
+                catch (Exception ex)
+                {
+                    LogUtil.WriteLog(ex.Message + ">>>" + ex.StackTrace);
+                    continue;
+                }
+            }
+        }
+
         /// <summary>
         /// 判断历史记录是否存在
         /// </summary>
@@ -637,6 +739,24 @@ namespace NB_IOT_TCP_HP_SOCKET.WWKJUtil
             return false;
         }
 
+        /// <summary>
+        /// 判断历史记录是否存在
+        /// </summary>
+        /// <param name="tablename"></param>
+        /// <param name="dtpicktime"></param>
+        /// <returns></returns>
+        private static bool CheckRecordExsitNew(string tablename, DateTime dtpicktime)
+        {
+            string strSql = string.Concat(new object[] { "select * from ", tablename, " where GetDateTime = '", dtpicktime, "'" });
+
+            DataTable table = DBHelper.ExecuteDataTable(strSql, CommandType.Text, null);
+            if (table.Rows.Count != 0)
+            {
+                return true;
+            }
+            return false;
+        }
+
         /// <summary>
         /// 判断历史记录表或最后状态表是否存在,不存在则新建
         /// </summary>
@@ -670,7 +790,7 @@ namespace NB_IOT_TCP_HP_SOCKET.WWKJUtil
         /// <returns></returns>
         public static DataTable GetDeviceList(string transId)
         {
-            string sql = "SELECT a.传输协议参数,c.ID as transId,c.名称,c.设备地址,c.设备协议,c.设备协议参数,b.ID as deviceId,b.用户站参数 FROM [传输设备] a, 设备信息 b, 通讯设备 c where b.传输设备ID = a.ID and b.通讯设备ID = c.ID and a.是否启用 = '是' and b.是否启用 = '是'and c.是否启用 = '是' and a.传输协议参数 like '%" + transId +"%'";
+            string sql = "SELECT a.传输协议参数,c.ID as transId,c.名称,c.设备地址,c.设备协议,c.设备协议参数,b.ID as deviceId,b.用户站参数,b.MeterId FROM [传输设备] a, 设备信息 b, 通讯设备 c where b.传输设备ID = a.ID and b.通讯设备ID = c.ID and a.是否启用 = '是' and b.是否启用 = '是'and c.是否启用 = '是' and a.传输协议参数 like '%" + transId +"%'";
             return DBHelper.ExecuteDataTable(sql, CommandType.Text, null);
         }
 
@@ -756,6 +876,71 @@ namespace NB_IOT_TCP_HP_SOCKET.WWKJUtil
             }
         }
 
+        /// <summary>
+        /// 更新设备最后数据
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <param name="recDate"></param>
+        /// <param name="dataList"></param>
+        private static void UpdateDeviceLastDataNew(KeyValuePair<string, HistoryRecord> kvp)
+        {
+            // 上报抄表数据对应的数据库字段(水表表MeterAssessmentBase)
+            string dataColumnMeter = ConfigurationManager.AppSettings["DataColumnMeter"];
+            string[] dataColumnMeterArr = dataColumnMeter.Split(',');
+            // 接收数据与数据库表对应关系
+            Dictionary<string, string> cols = new Dictionary<string, string>();
+            foreach (string dataColumn in dataColumnMeterArr)
+            {
+                string[] dataColumnArr = dataColumn.Split('|');
+                cols[dataColumnArr[0]] = dataColumnArr[1];
+            }
+            string meterId = kvp.Key;
+            string recDate = kvp.Value.RecordTime.ToString();
+            List<CommData> dataList = kvp.Value.DataList;
+            string dataSource = kvp.Value.DataSource;
+            StringBuilder strSql = new StringBuilder();
+            strSql.Append("SELECT * FROM MeterAssessmentBase where MeterAssessmentId = ").Append(meterId);
+            DataTable dataTable = DBHelper.ExecuteDataTable(strSql.ToString(), CommandType.Text, null);
+            strSql.Clear();
+            StringBuilder valueStr = new StringBuilder();
+
+            if ((dataList == null) || (dataList.Count == 0))
+            {
+                return;
+            }
+
+            if (Convert.ToDateTime(recDate) >= Convert.ToDateTime(dataTable.Rows[0]["GetDateTime"]))
+            {
+                strSql.Append("update MeterAssessmentBase set GetDateTime = '").Append(recDate).Append("'");
+
+                foreach (KeyValuePair<string, string> kvpTmp in cols)
+                {
+                    CommData commData = dataList.Find(e => e.Name == kvpTmp.Value);
+                    if (commData != null)
+                    {
+                        if ((((commData.Value == null) || (commData.Value == "")) || ((commData.Value == "未知") || (commData.Value == "--"))) || (commData.Value == "非数字"))
+                        {
+                            strSql.Append(",[").Append(kvpTmp.Key).Append("]='0'");
+                        }
+                        else
+                        {
+                            if (commData.Tag == null || "".Equals(commData.Tag) || "BIT".Equals(commData.Tag.ToUpper()))
+                            {
+                                strSql.Append(",[").Append(kvpTmp.Key).Append("]='").Append(commData.Value).Append("'");
+                            }
+                            else
+                            {
+                                strSql.Append(",[").Append(kvpTmp.Key).Append("]=").Append(commData.Value).Append("");
+                            }
+                        }
+                    }
+                }
+
+                strSql.Append(" where MeterAssessmentId = ").Append(meterId);
+                DBHelper.Query(strSql.ToString());
+            }
+        }
+
         /// <summary>
         /// MODBUS解析基础量--模拟量
         /// </summary>
@@ -890,7 +1075,7 @@ namespace NB_IOT_TCP_HP_SOCKET.WWKJUtil
                     using (StreamReader sr = new StreamReader(res.GetResponseStream(), myEncode))
                     {
                         strResult = sr.ReadToEnd();
-                        LogUtil.WriteLog("回调农村供水营业收费系统,地址:" + url + ",参数:param" + ",返回:" + strResult);
+                        LogUtil.WriteLog("回调收费系统,地址:" + url + ",参数:param" + ",返回:" + strResult);
                         return strResult;
                     }
                 }
@@ -967,6 +1152,8 @@ namespace NB_IOT_TCP_HP_SOCKET.WWKJUtil
             DBHelper.Query(sql);
             if (!string.IsNullOrEmpty(task.Guid))
             {
+                sql = " update [rwsCommandSendRecord] set [sendStatus] = 1, [reviseTime] = GETDATE(), [ReciveStatus] = 1 where [guid] = '" + task.Guid + "'";
+                DBHelper.Query(sql);
                 if (task.ReplayStatus.Equals("0"))//回调
                 {
                     string param = "guid=" + task.Guid + "&status=SUCCESS&execMsg=";

+ 16 - 7
NB_IOT_TCP_HP_SOCKET/WWKJUtil/RemoteTask.cs

@@ -108,7 +108,7 @@ namespace NB_IOT_TCP_HP_SOCKET.WWKJUtil
                 if (ProtocolAnalysisTools.CheckTableExist("CommandList", "", false) && ProtocolAnalysisTools.CheckTableExist("TaskList", "", false))
                 {
                     // 1.获取正常任务
-                    string sql = "select  top 1 * from TaskList a left join CommandList b on a.TaskID=b.TaskID where b.Type <> '工作模式' and a.State != '完成' and b.CtrlValveNum < " + ConfigurationManager.AppSettings["ParamSendMaxNum"] + " and a.PreDevID = " + devID + " Order By a.TaskID";
+                    string sql = "select * from TaskList a left join CommandList b on a.TaskID=b.TaskID where b.Type <> '工作模式' and a.State != '完成' and b.CtrlValveNum < " + ConfigurationManager.AppSettings["ParamSendMaxNum"] + " and a.PreDevID = " + devID + " Order By a.TaskID";
                     DataTable dataTable = DBHelper.ExecuteDataTable(sql, CommandType.Text, null);
                     int num = dataTable.Rows.Count;
                     for (int i = 0; i < num; i++)
@@ -122,7 +122,16 @@ namespace NB_IOT_TCP_HP_SOCKET.WWKJUtil
                         return;
                     }
                     //2.获取阀门任务
-                    string vsql = "select * from (select Top 1 a.TaskID,a.PreDevID,GPRSNumber,b.Type,a.Guid,a.returnUrl,a.ReplayStatus,b.SendCode,b.CtrlValveNum,b.State from TaskList a left join CommandList b on a.TaskID=b.TaskID where b.Type='工作模式' and a.PreDevID = " + devID + " Order By a.TaskID desc) Tab  where CtrlValveNum < " + ConfigurationManager.AppSettings["ParamSendMaxNum"] + " and State != '完成'";
+                    //string vsql = "select Top 1 a.TaskID,a.PreDevID,GPRSNumber,b.Type,a.Guid,a.returnUrl,a.ReplayStatus,b.SendCode,b.CtrlValveNum,b.State from TaskList a left join CommandList b on a.TaskID=b.TaskID where b.Type='工作模式' and a.PreDevID = " + devID + " Order By a.TaskID desc) Tab  where CtrlValveNum < " + ConfigurationManager.AppSettings["ParamSendMaxNum"] + " and State != '完成'";
+                    string vsql = "SELECT TOP 1 a.TaskID FROM TaskList a LEFT JOIN CommandList b ON a.TaskID= b.TaskID WHERE b.Type= '工作模式' AND a.PreDevID = " + devID + " AND b.State = '完成' ORDER BY a.TaskID DESC";
+                    DataTable dt = DBHelper.ExecuteDataTable(vsql, CommandType.Text, null);
+                    int taskIdNew = 0;
+                    if (dt != null && dt.Rows.Count == 1) 
+                    {
+                        taskIdNew = Convert.ToInt32(dt.Rows[0]["TaskID"]);
+                    }
+                    vsql = "SELECT TOP 1 a.TaskID, a.PreDevID, GPRSNumber, b.Type, a.Guid, a.returnUrl, a.ReplayStatus, b.SendCode, b.CtrlValveNum, b.State FROM TaskList a LEFT JOIN CommandList b ON a.TaskID= b.TaskID WHERE b.Type= '工作模式' AND a.PreDevID = " + devID;
+                    vsql += " AND CtrlValveNum < " + ConfigurationManager.AppSettings["ParamSendMaxNum"] + " AND b.State != '完成' AND a.TaskID > " + taskIdNew + " ORDER BY a.TaskID DESC";
                     //mSql = DBManager.CurrentConnectString;
                     DataTable vdataTable = DBHelper.ExecuteDataTable(vsql, CommandType.Text, null);
                     int vnum = vdataTable.Rows.Count;
@@ -230,13 +239,13 @@ namespace NB_IOT_TCP_HP_SOCKET.WWKJUtil
             FileInfo yInfo = (FileInfo)y;
 
 
-            //依名排序  
-            //return xInfo.FullName.CompareTo(yInfo.FullName);//
-            //return yInfo.FullName.CompareTo(xInfo.FullName);//遞減  
+            //依名排序  
+            //return xInfo.FullName.CompareTo(yInfo.FullName);//
+            //return yInfo.FullName.CompareTo(xInfo.FullName);//递减  
 
             //依修改日期排序  
-            return xInfo.LastWriteTime.CompareTo(yInfo.LastWriteTime);//
-            //return yInfo.LastWriteTime.CompareTo(xInfo.LastWriteTime);//遞減  
+            return xInfo.LastWriteTime.CompareTo(yInfo.LastWriteTime);//
+            //return yInfo.LastWriteTime.CompareTo(xInfo.LastWriteTime);//递减  
         }
         #endregion
     }

+ 2 - 2
NB_IOT_TCP_HP_SOCKET/WWKJUtil/StationType.cs

@@ -37,9 +37,9 @@ namespace NB_IOT_TCP_HP_SOCKET.WWKJUtil
                     if (node["DevTyp_Id"].InnerText == deviceTypeId)
                     {
                         this._name = node["DevTyp_Name"].InnerText;//设备类型
-                        if (node["DevTyp_Derivates"] != null)
+                        if (node["DevTyp_Derivate"] != null)
                         {
-                            XmlNodeList childNodes = node["DevTyp_Derivates"].ChildNodes;
+                            XmlNodeList childNodes = node["DevTyp_Derivate"].ChildNodes;
                             List<string> list2 = new List<string>();
                             foreach (XmlNode node2 in childNodes)
                             {