Selaa lähdekoodia

excel导入配置配置方法。

Klosszhu 3 vuotta sitten
vanhempi
commit
941870fbee
34 muutettua tiedostoa jossa 99172 lisäystä ja 234 poistoa
  1. 9 1
      Fine.OPCDaClient9000/App.config
  2. 6 0
      Fine.OPCDaClient9000/App/AppHandle.cs
  3. 4 2
      Fine.OPCDaClient9000/App/Common/AppUtil.cs
  4. 83 57
      Fine.OPCDaClient9000/ConfigForm.Designer.cs
  5. 340 2
      Fine.OPCDaClient9000/ConfigForm.cs
  6. 2 0
      Fine.OPCDaClient9000/DataMode/IoModal.cs
  7. 23 0
      Fine.OPCDaClient9000/Excel/ExcelAPIModel.cs
  8. 18 0
      Fine.OPCDaClient9000/Excel/ExcelManager.cs
  9. 16 0
      Fine.OPCDaClient9000/Excel/ExcelProjectModel.cs
  10. BIN
      Fine.OPCDaClient9000/Excel/模板下载.xlsx
  11. 29 0
      Fine.OPCDaClient9000/Fine.OPCDaClient9000.csproj
  12. 1 0
      Fine.OPCDaClient9000/Program.cs
  13. 26258 0
      Fine.OPCDaClient9000/bin/Debug/BouncyCastle.Crypto.xml
  14. BIN
      Fine.OPCDaClient9000/bin/Debug/Excel/模板下载.xlsx
  15. 22 18
      Fine.OPCDaClient9000/bin/Debug/Fine.OPCDaClient9000.exe.config
  16. 10977 0
      Fine.OPCDaClient9000/bin/Debug/ICSharpCode.SharpZipLib.xml
  17. 11817 0
      Fine.OPCDaClient9000/bin/Debug/NPOI.OOXML.xml
  18. 3189 0
      Fine.OPCDaClient9000/bin/Debug/NPOI.OpenXml4Net.xml
  19. 45803 0
      Fine.OPCDaClient9000/bin/Debug/NPOI.xml
  20. 31 0
      Fine.OPCDaClient9000/bin/Debug/config/Router/5000Test/5K回潮测试_Get.json
  21. 210 0
      Fine.OPCDaClient9000/bin/Debug/config/Router/5000Test/5K回潮测试_Post.json
  22. 38 0
      Fine.OPCDaClient9000/bin/Debug/config/Router/单点5K/5K单机_Get.json
  23. 210 0
      Fine.OPCDaClient9000/bin/Debug/config/Router/单点5K/5K单机_Post.json
  24. 18 2
      Fine.OPCDaClient9000/obj/Debug/Fine.OPCDaClient9000.csproj.FileListAbsolute.txt
  25. 0 143
      Fine.OPCDaClient9000/obj/Debug/Fine.OPCDaClient9000.exe.config
  26. 4 0
      Fine.OPCDaClient9000/packages.config
  27. 18 0
      Fine.Util/Const.cs
  28. 34 4
      Fine.Util/LogUtil.cs
  29. 1 0
      Fine.Util/obj/Debug/Fine.Util.csproj.FileListAbsolute.txt
  30. 0 1
      OpcClientMqtt/obj/Debug/OpcClientMqtt.csproj.FileListAbsolute.txt
  31. 1 1
      YS.Smart.Ctl/obj/YS.Smart.Ctl.csproj.nuget.dgspec.json
  32. 4 1
      YS.Smart.Ctl/obj/YS.Smart.Ctl.csproj.nuget.g.props
  33. 5 1
      YS.Smart.Ctl/obj/YS.Smart.Ctl.csproj.nuget.g.targets
  34. 1 1
      YS.Smart.Ctl/obj/project.assets.json

+ 9 - 1
Fine.OPCDaClient9000/App.config

@@ -9,7 +9,7 @@
 		<add key="logisrealpath" value="true" />
 		<!--如果是flase,logpath直接写文件夹相对路径-->
 		<add key="logpath" value="E:\ys\serverlog" />
-		<add key="auth" value="E230539F13CDB91D2764603BC283D909"/>
+		<add key="auth" value="E230539F13CDB91D2764603BC283D909" />
 		<add key="isauth" value="false" />
 	</appSettings>
     <startup>
@@ -134,6 +134,14 @@
         <assemblyIdentity name="Microsoft.Extensions.Configuration.Binder" publicKeyToken="adb9793829ddae60" culture="neutral" />
         <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
       </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="OpcComRcw" publicKeyToken="9a40e993cbface53" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-2.0.105.1" newVersion="2.0.105.1" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-1.8.9.0" newVersion="1.8.9.0" />
+      </dependentAssembly>
     </assemblyBinding>
   </runtime>
 </configuration>

+ 6 - 0
Fine.OPCDaClient9000/App/AppHandle.cs

@@ -72,6 +72,9 @@ namespace Fine.OPCDaClient9000.App
 
             LogUtil.WriteLog("--执行返回--" + action + ":", JsonUtil.SerializeObject(rlt));
             LogUtil.Write("-------------------------------------------------------\t\n");
+            string fullmsg= $"【Get动作】--- {action}     【Params参数】--- {pras}\t\n";
+            fullmsg += "执行返回:" + JsonUtil.SerializeObject(rlt);
+            LogUtil.WriteStep(fullmsg);
             return rlt;
         }
 
@@ -104,6 +107,9 @@ namespace Fine.OPCDaClient9000.App
 
             LogUtil.WriteLog( "--执行返回--" + action + ":", JsonUtil.SerializeObject(rlt));
             LogUtil.Write("-------------------------------------------------------\t\n");
+            string fullmsg = $"【Post动作】: --- { action}  | Params:--- { pras}\t\n";
+            fullmsg += "执行返回:" + JsonUtil.SerializeObject(rlt);
+            LogUtil.WriteStep(fullmsg);
             return rlt;
         }
     }

+ 4 - 2
Fine.OPCDaClient9000/App/Common/AppUtil.cs

@@ -89,7 +89,8 @@ namespace Fine.OPCDaClient9000.Util
             }
             else
             {
-                LogUtil.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff") + "访问失败", "无此接口,访问无效!");
+                LogUtil.WriteLog($"{action}访问失败", "无此接口,访问无效!");
+                LogUtil.WriteError($"{action}访问失败", "无此接口,访问无效!");
                 return new PLCResultAll { Sucessful = false, Message = "文档错误,访问失败" };
             }
         }
@@ -208,7 +209,8 @@ namespace Fine.OPCDaClient9000.Util
             }
             catch (Exception ex)
             {
-                LogUtil.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff") + "错误信息", iovar.APIName + ex.Message);              
+                LogUtil.WriteLog("错误信息", iovar.APIName + ex.Message);
+                LogUtil.WriteError("错误信息", iovar.APIName + ex.Message);
                 //Console.WriteLine("错误信息:{0}", ex.Message);
                 return new PLCResultAll
                 {

+ 83 - 57
Fine.OPCDaClient9000/ConfigForm.Designer.cs

@@ -28,32 +28,32 @@
         /// </summary>
         private void InitializeComponent()
         {
-            System.Windows.Forms.TreeNode treeNode81 = new System.Windows.Forms.TreeNode("Get单节点");
-            System.Windows.Forms.TreeNode treeNode82 = new System.Windows.Forms.TreeNode("Get多节点");
-            System.Windows.Forms.TreeNode treeNode83 = new System.Windows.Forms.TreeNode("Get", new System.Windows.Forms.TreeNode[] {
-            treeNode81,
-            treeNode82});
-            System.Windows.Forms.TreeNode treeNode84 = new System.Windows.Forms.TreeNode("写入单值(如温度)");
-            System.Windows.Forms.TreeNode treeNode85 = new System.Windows.Forms.TreeNode("写入多值(重量,批号,牌号)");
-            System.Windows.Forms.TreeNode treeNode86 = new System.Windows.Forms.TreeNode("写入多值(工单,批号,牌号)");
-            System.Windows.Forms.TreeNode treeNode87 = new System.Windows.Forms.TreeNode("单选写入");
-            System.Windows.Forms.TreeNode treeNode88 = new System.Windows.Forms.TreeNode("多选写入");
-            System.Windows.Forms.TreeNode treeNode89 = new System.Windows.Forms.TreeNode("不写入,只检查");
-            System.Windows.Forms.TreeNode treeNode90 = new System.Windows.Forms.TreeNode("Post", new System.Windows.Forms.TreeNode[] {
-            treeNode84,
-            treeNode85,
-            treeNode86,
-            treeNode87,
-            treeNode88,
-            treeNode89});
+            System.Windows.Forms.TreeNode treeNode61 = new System.Windows.Forms.TreeNode("Get单节点");
+            System.Windows.Forms.TreeNode treeNode62 = new System.Windows.Forms.TreeNode("Get多节点");
+            System.Windows.Forms.TreeNode treeNode63 = new System.Windows.Forms.TreeNode("Get", new System.Windows.Forms.TreeNode[] {
+            treeNode61,
+            treeNode62});
+            System.Windows.Forms.TreeNode treeNode64 = new System.Windows.Forms.TreeNode("写入单值(如温度)");
+            System.Windows.Forms.TreeNode treeNode65 = new System.Windows.Forms.TreeNode("写入多值(重量,批号,牌号)");
+            System.Windows.Forms.TreeNode treeNode66 = new System.Windows.Forms.TreeNode("写入多值(工单,批号,牌号)");
+            System.Windows.Forms.TreeNode treeNode67 = new System.Windows.Forms.TreeNode("单选写入");
+            System.Windows.Forms.TreeNode treeNode68 = new System.Windows.Forms.TreeNode("多选写入");
+            System.Windows.Forms.TreeNode treeNode69 = new System.Windows.Forms.TreeNode("不写入,只检查");
+            System.Windows.Forms.TreeNode treeNode70 = new System.Windows.Forms.TreeNode("Post", new System.Windows.Forms.TreeNode[] {
+            treeNode64,
+            treeNode65,
+            treeNode66,
+            treeNode67,
+            treeNode68,
+            treeNode69});
             this.treeView1 = new System.Windows.Forms.TreeView();
             this.groupBox1 = new System.Windows.Forms.GroupBox();
             this.textBox6 = new System.Windows.Forms.TextBox();
             this.button2 = new System.Windows.Forms.Button();
+            this.listBox1 = new System.Windows.Forms.ListBox();
             this.label1 = new System.Windows.Forms.Label();
             this.textBox1 = new System.Windows.Forms.TextBox();
             this.button1 = new System.Windows.Forms.Button();
-            this.listBox1 = new System.Windows.Forms.ListBox();
             this.label5 = new System.Windows.Forms.Label();
             this.textBox5 = new System.Windows.Forms.TextBox();
             this.label9 = new System.Windows.Forms.Label();
@@ -62,6 +62,8 @@
             this.textBox3 = new System.Windows.Forms.TextBox();
             this.label2 = new System.Windows.Forms.Label();
             this.checkBox1 = new System.Windows.Forms.CheckBox();
+            this.button4 = new System.Windows.Forms.Button();
+            this.button5 = new System.Windows.Forms.Button();
             this.groupBox1.SuspendLayout();
             this.SuspendLayout();
             // 
@@ -70,29 +72,29 @@
             this.treeView1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.treeView1.Location = new System.Drawing.Point(6, 37);
             this.treeView1.Name = "treeView1";
-            treeNode81.Name = "00";
-            treeNode81.Text = "Get单节点";
-            treeNode82.Name = "01";
-            treeNode82.Text = "Get多节点";
-            treeNode83.Name = "AA";
-            treeNode83.Text = "Get";
-            treeNode84.Name = "1";
-            treeNode84.Text = "写入单值(如温度)";
-            treeNode85.Name = "21";
-            treeNode85.Text = "写入多值(重量,批号,牌号)";
-            treeNode86.Name = "22";
-            treeNode86.Text = "写入多值(工单,批号,牌号)";
-            treeNode87.Name = "3";
-            treeNode87.Text = "单选写入";
-            treeNode88.Name = "4";
-            treeNode88.Text = "多选写入";
-            treeNode89.Name = "5";
-            treeNode89.Text = "不写入,只检查";
-            treeNode90.Name = "AA";
-            treeNode90.Text = "Post";
+            treeNode61.Name = "00";
+            treeNode61.Text = "Get单节点";
+            treeNode62.Name = "01";
+            treeNode62.Text = "Get多节点";
+            treeNode63.Name = "AA";
+            treeNode63.Text = "Get";
+            treeNode64.Name = "1";
+            treeNode64.Text = "写入单值(如温度)";
+            treeNode65.Name = "21";
+            treeNode65.Text = "写入多值(重量,批号,牌号)";
+            treeNode66.Name = "22";
+            treeNode66.Text = "写入多值(工单,批号,牌号)";
+            treeNode67.Name = "3";
+            treeNode67.Text = "单选写入";
+            treeNode68.Name = "4";
+            treeNode68.Text = "多选写入";
+            treeNode69.Name = "5";
+            treeNode69.Text = "不写入,只检查";
+            treeNode70.Name = "AA";
+            treeNode70.Text = "Post";
             this.treeView1.Nodes.AddRange(new System.Windows.Forms.TreeNode[] {
-            treeNode83,
-            treeNode90});
+            treeNode63,
+            treeNode70});
             this.treeView1.Size = new System.Drawing.Size(366, 335);
             this.treeView1.TabIndex = 0;
             // 
@@ -127,6 +129,18 @@
             this.button2.UseVisualStyleBackColor = true;
             this.button2.Click += new System.EventHandler(this.button2_Click);
             // 
+            // listBox1
+            // 
+            this.listBox1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.listBox1.FormattingEnabled = true;
+            this.listBox1.ItemHeight = 24;
+            this.listBox1.Location = new System.Drawing.Point(6, 454);
+            this.listBox1.Name = "listBox1";
+            this.listBox1.ScrollAlwaysVisible = true;
+            this.listBox1.Size = new System.Drawing.Size(366, 436);
+            this.listBox1.TabIndex = 7;
+            this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
+            // 
             // label1
             // 
             this.label1.AutoSize = true;
@@ -146,26 +160,14 @@
             // 
             // button1
             // 
-            this.button1.Location = new System.Drawing.Point(1169, 19);
+            this.button1.Location = new System.Drawing.Point(1151, 19);
             this.button1.Name = "button1";
-            this.button1.Size = new System.Drawing.Size(75, 32);
+            this.button1.Size = new System.Drawing.Size(75, 51);
             this.button1.TabIndex = 4;
             this.button1.Text = "查询";
             this.button1.UseVisualStyleBackColor = true;
             this.button1.Click += new System.EventHandler(this.button1_Click);
             // 
-            // listBox1
-            // 
-            this.listBox1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.listBox1.FormattingEnabled = true;
-            this.listBox1.ItemHeight = 24;
-            this.listBox1.Location = new System.Drawing.Point(6, 454);
-            this.listBox1.Name = "listBox1";
-            this.listBox1.ScrollAlwaysVisible = true;
-            this.listBox1.Size = new System.Drawing.Size(366, 436);
-            this.listBox1.TabIndex = 7;
-            this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
-            // 
             // label5
             // 
             this.label5.AutoSize = true;
@@ -204,7 +206,7 @@
             // 
             // button3
             // 
-            this.button3.Location = new System.Drawing.Point(1576, 121);
+            this.button3.Location = new System.Drawing.Point(1658, 125);
             this.button3.Name = "button3";
             this.button3.Size = new System.Drawing.Size(94, 42);
             this.button3.TabIndex = 22;
@@ -239,11 +241,33 @@
             this.checkBox1.Text = "点位";
             this.checkBox1.UseVisualStyleBackColor = true;
             // 
+            // button4
+            // 
+            this.button4.Location = new System.Drawing.Point(1311, 20);
+            this.button4.Name = "button4";
+            this.button4.Size = new System.Drawing.Size(75, 50);
+            this.button4.TabIndex = 26;
+            this.button4.Text = "导入";
+            this.button4.UseVisualStyleBackColor = true;
+            this.button4.Click += new System.EventHandler(this.button4_Click);
+            // 
+            // button5
+            // 
+            this.button5.Location = new System.Drawing.Point(1411, 20);
+            this.button5.Name = "button5";
+            this.button5.Size = new System.Drawing.Size(131, 50);
+            this.button5.TabIndex = 27;
+            this.button5.Text = "模板下载";
+            this.button5.UseVisualStyleBackColor = true;
+            this.button5.Click += new System.EventHandler(this.button5_Click);
+            // 
             // ConfigForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1820, 980);
+            this.ClientSize = new System.Drawing.Size(1878, 980);
+            this.Controls.Add(this.button5);
+            this.Controls.Add(this.button4);
             this.Controls.Add(this.checkBox1);
             this.Controls.Add(this.textBox3);
             this.Controls.Add(this.label2);
@@ -284,5 +308,7 @@
         private System.Windows.Forms.TextBox textBox3;
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.CheckBox checkBox1;
+        private System.Windows.Forms.Button button4;
+        private System.Windows.Forms.Button button5;
     }
 }

+ 340 - 2
Fine.OPCDaClient9000/ConfigForm.cs

@@ -1,5 +1,6 @@
 using Fine.OPCDaClient9000.App;
 using Fine.OPCDaClient9000.DataMode;
+using Fine.OPCDaClient9000.Excel;
 using Fine.OPCDaClient9000.Util;
 using Newtonsoft.Json;
 using System;
@@ -72,7 +73,8 @@ namespace Fine.OPCDaClient9000
         }
 
 
-        private void Search() {
+        private void Search()
+        {
             if (string.IsNullOrEmpty(textBox1.Text))
             {
                 return;
@@ -129,7 +131,7 @@ namespace Fine.OPCDaClient9000
             }
             textBox2.Text = listBox1.SelectedItem.ToString();
             textBox3.Text = apis.FirstOrDefault().path;
-            textBox5.Text = JsonBeauty.Execute(JsonConvert.SerializeObject(AppUtil.newsConfig.FirstOrDefault(a => a.Data.Exists(b => b.APIName == listBox1.SelectedItem.ToString())).Data.FirstOrDefault(c => c.APIName == listBox1.SelectedItem.ToString())));
+            textBox5.Text = JsonBeauty.Execute(JsonConvert.SerializeObject(AppUtil.newsConfig.FirstOrDefault(a => a.Data.Exists(b => b.APIName == listBox1.SelectedItem.ToString())).Data.FirstOrDefault(c => c.APIName == listBox1.SelectedItem.ToString()),new JsonSerializerSettings { NullValueHandling= NullValueHandling.Ignore }));
         }
 
         private void button3_Click(object sender, EventArgs e)
@@ -151,5 +153,341 @@ namespace Fine.OPCDaClient9000
             firstapi.Data.Insert(0, newmoda);
             File.WriteAllText(firstapi.path, JsonBeauty.Execute(JsonConvert.SerializeObject(firstapi.Data, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore })));
         }
+
+        private void button5_Click(object sender, EventArgs e)
+        {
+            var excel = Path.Combine(AppContext.BaseDirectory, "Excel", "模板下载.xlsx");
+            FileStream file = new FileStream(path: excel, mode: FileMode.Open, access: FileAccess.Read);
+            OpenFileDialog open = new OpenFileDialog();
+            var result = open.ShowDialog();
+            if (result == DialogResult.OK)
+            {
+                MessageBox.Show("123");
+            }
+            //using (MemoryStream memory=new MemoryStream())
+            //{
+            //    memory.CopyTo(file);
+            //    memory.Close();
+            //}
+
+        }
+
+        private void button4_Click(object sender, EventArgs e)
+        {
+            //定义一个文件打开控件
+            OpenFileDialog ofd = new OpenFileDialog();
+            //设置打开对话框的初始目录,默认目录为exe运行文件所在的路径
+            ofd.InitialDirectory = Application.StartupPath;
+            //设置打开对话框的标题
+            ofd.Title = "请选择要打开的Excel文件";
+            //设置打开对话框可以多选
+            ofd.Multiselect = true;
+            //设置对话框打开的文件类型
+            ofd.Filter = "Excel文件|*.xlsx";
+            //设置文件对话框当前选定的筛选器的索引
+            ofd.FilterIndex = 2;
+            //设置对话框是否记忆之前打开的目录
+            ofd.RestoreDirectory = true;
+            if (ofd.ShowDialog() == DialogResult.OK)
+            {
+                MessageBox.Show(ofd.FileName);
+                var list = ExcelManager.Excel2Model<ExcelProjectModel>(ofd.FileName, "项目目录");
+                foreach (var item in list)
+                {
+                    //处理基目录
+                    var basepath = Path.Combine(AppContext.BaseDirectory, "config", "Router", item.模块名称);
+                    if (!Directory.Exists(basepath))
+                    {
+                        Directory.CreateDirectory(basepath);
+                    }
+                    //处理文件
+                    var getfileName = Path.Combine(basepath, item.配置文件名称 + "_Get.json");
+                    var PostfileName = Path.Combine(basepath, item.配置文件名称 + "_Post.json");
+                    //生成文件格式并保存
+                    var apilist = ExcelManager.Excel2Model<ExcelAPIModel>(ofd.FileName, item.Sheet名称);
+                    List<IoModal> getlist = new List<IoModal>();
+                    List<IoModal> postlist = new List<IoModal>();
+                    foreach (var api in apilist)
+                    {
+                        if (string.IsNullOrEmpty(api.方法))
+                        {
+                            continue;
+                        }
+                        if (api.方法.Trim().ToLower() == "get")
+                        {
+                            var iomodal = new IoModal()
+                            {
+                                APIName = api.Api名称.Trim(),
+                                DelayTime = api.读写间隔,
+                                IsCheck = api.是否检查 == "否" ? false : true,
+                                Method = api.方法.Trim().ToLower(),
+                                PType = 0,
+                                Content = api.接口备注
+                            };
+                            var getwriteandgetkey = new List<WriteAndCheckKey>();
+                            string[] writes = string.IsNullOrEmpty(api.写入点位) ? null : api.写入点位.Split('/');
+                            string[] checks = string.IsNullOrEmpty(api.检查点位) ? null : api.检查点位.Split('/');
+                            for (int i = 0; i < writes.Length; i++)
+                            {
+                                var moda = new WriteAndCheckKey();
+                                var w = writes[i].Trim().Split('=');
+                                moda.WriteTagName = w[0].Trim();
+                                moda.StrValue = w[1].Trim();
+                                if (checks != null)
+                                {
+                                    var c = checks[i].Trim().Split('=');
+                                    moda.CheckTagName = c[0].Trim();
+                                    moda.CheckValue = c[1].Trim();
+                                }
+                                else
+                                {
+                                    moda.CheckTagName = w[0].Trim();
+                                    moda.CheckValue = w[1].Trim();
+                                }
+                                getwriteandgetkey.Add(moda);
+                            }
+                            iomodal.Params = new List<Params>() { new Params { Param = "", keys = getwriteandgetkey } };
+                            getlist.Add(iomodal);
+                        }
+
+                        if (api.方法.Trim().ToLower() == "post")
+                        {
+                            var iomodal = new IoModal()
+                            {
+                                APIName = api.Api名称.Trim(),
+                                DelayTime = api.读写间隔,
+                                IsCheck = api.是否检查 == "否" ? false : true,
+                                Method = api.方法.Trim().ToLower(),
+                                Content = api.接口备注
+                            };
+
+                            if (api.Post类型.Trim() == "1")
+                            {
+                                iomodal.PType = EAPIparType.InOneVal;
+                                var getwriteandgetkey = new List<WriteAndCheckKey>();
+                                string[] writes = string.IsNullOrEmpty(api.写入点位) ? null : api.写入点位.Split('/');
+                                string[] checks = string.IsNullOrEmpty(api.检查点位) ? null : api.检查点位.Split('/');
+                                for (int i = 0; i < writes.Length; i++)
+                                {
+                                    var moda = new WriteAndCheckKey();
+                                    //var w = writes[i].Trim().Split('=');
+                                    moda.WriteTagName = writes[i].Trim();
+                                    //moda.StrValue = w[1];
+                                    if (checks != null)
+                                    {
+                                        //var c = checks[i].Trim().Split('=');
+                                        moda.CheckTagName = checks[i].Trim();
+                                        //moda.CheckValue = c[1];
+                                    }
+                                    else
+                                    {
+                                        moda.CheckTagName = writes[i].Trim();
+                                    }
+                                    getwriteandgetkey.Add(moda);
+                                }
+                                iomodal.Params = new List<Params>() { new Params { Param = "", keys = getwriteandgetkey } };
+                                postlist.Add(iomodal);
+                            }
+                            else if (api.Post类型.Trim() == "21")
+                            {
+                                iomodal.PType = EAPIparType.inMultiValObj;
+                                var getwriteandgetkey = new List<WriteAndCheckKey>();
+                                string[] writes = string.IsNullOrEmpty(api.写入点位) ? null : api.写入点位.Split('/');
+                                string[] checks = string.IsNullOrEmpty(api.检查点位) ? null : api.检查点位.Split('/');
+
+                                var moda = new WriteAndCheckKey() { InputName = "Weight" };
+
+                                moda.WriteTagName = writes[0].Trim();
+                                if (checks != null)
+                                {
+                                    //var c = checks[i].Trim().Split('=');
+                                    moda.CheckTagName = checks[0];
+
+                                }
+                                else
+                                {
+                                    moda.CheckTagName = writes[0];
+                                }
+                                getwriteandgetkey.Add(moda);
+                                var moda2 = new WriteAndCheckKey() { InputName = "BranchNo" };
+
+                                moda2.WriteTagName = writes[1].Trim();
+                                if (checks != null)
+                                {
+                                    //var c = checks[i].Trim().Split('=');
+                                    moda2.CheckTagName = checks[1];
+
+                                }
+                                else
+                                {
+                                    moda2.CheckTagName = writes[1];
+                                }
+
+                                getwriteandgetkey.Add(moda2);
+                                var moda3 = new WriteAndCheckKey() { InputName = "BrandNo" };
+
+                                moda3.WriteTagName = writes[2].Trim();
+                                if (checks != null)
+                                {
+                                    //var c = checks[i].Trim().Split('=');
+                                    moda3.CheckTagName = checks[2];
+
+                                }
+                                else
+                                {
+                                    moda3.CheckTagName = writes[2];
+                                }
+
+                                getwriteandgetkey.Add(moda3);
+
+                                iomodal.Params = new List<Params>() { new Params { Param = "", keys = getwriteandgetkey } };
+                                postlist.Add(iomodal);
+                            }
+                            else if (api.Post类型.Trim() == "22")
+                            {
+                                iomodal.PType = EAPIparType.inMultiValObj;
+                                var getwriteandgetkey = new List<WriteAndCheckKey>();
+                                string[] writes = string.IsNullOrEmpty(api.写入点位) ? null : api.写入点位.Split('/');
+                                string[] checks = string.IsNullOrEmpty(api.检查点位) ? null : api.检查点位.Split('/');
+
+                                var moda = new WriteAndCheckKey() { InputName = "GDNum" };
+
+                                moda.WriteTagName = writes[0].Trim();
+                                if (checks != null)
+                                {
+                                    //var c = checks[i].Trim().Split('=');
+                                    moda.CheckTagName = checks[0];
+
+                                }
+                                else
+                                {
+                                    moda.CheckTagName = writes[0];
+                                }
+                                getwriteandgetkey.Add(moda);
+                                var moda2 = new WriteAndCheckKey() { InputName = "BranchNum" };
+
+                                moda2.WriteTagName = writes[1].Trim();
+                                if (checks != null)
+                                {
+                                    //var c = checks[i].Trim().Split('=');
+                                    moda2.CheckTagName = checks[1];
+
+                                }
+                                else
+                                {
+                                    moda2.CheckTagName = writes[1];
+                                }
+
+                                getwriteandgetkey.Add(moda2);
+                                var moda3 = new WriteAndCheckKey() { InputName = "BrandNum" };
+
+                                moda3.WriteTagName = writes[2].Trim();
+                                if (checks != null)
+                                {
+                                    //var c = checks[i].Trim().Split('=');
+                                    moda3.CheckTagName = checks[2];
+
+                                }
+                                else
+                                {
+                                    moda3.CheckTagName = writes[2];
+                                }
+
+                                getwriteandgetkey.Add(moda3);
+
+                                iomodal.Params = new List<Params>() { new Params { Param = "", keys = getwriteandgetkey } };
+                                postlist.Add(iomodal);
+                            }
+                            else if (api.Post类型.Trim() == "3")
+                            {
+                                iomodal.PType = EAPIparType.InSel;
+                                iomodal.Params = new List<Params>();
+                                var pars = api.Post参数.Replace(",", ",").Split(',');
+                                var writes = api.写入点位.Split('\n');
+                                var reads = string.IsNullOrEmpty(api.检查点位) ? null : api.检查点位.Split('\n');
+                                for (int i = 0; i < pars.Length; i++)
+                                {
+                                    var prams = new Params { Param = pars[i].Trim(), keys = new List<WriteAndCheckKey>() };
+                                    var wrts = writes[i].Split('/');
+                                    var chks = reads == null ? null : reads[i].Split('/');
+                                    for (int w = 0; w < wrts.Length; w++)
+                                    {
+                                        var wc = new WriteAndCheckKey { WriteTagName = wrts[w].Split('=')[0].Trim(), StrValue = wrts[w].Split('=')[1].Trim() };
+                                        if (chks != null)
+                                        {
+                                            wc.CheckTagName = chks[w].Split('=')[0].Trim();
+                                            wc.CheckValue = chks[w].Split('=')[1].Trim();
+                                        }
+                                        else
+                                        {
+                                            wc.CheckTagName = wrts[w].Split('=')[0].Trim();
+                                            wc.CheckValue = wrts[w].Split('=')[1].Trim();
+                                        }
+                                        prams.keys.Add(wc);
+                                    }
+
+                                    iomodal.Params.Add(prams);
+                                }
+                                postlist.Add(iomodal);
+                            }
+                            else if (api.Post类型.Trim() == "4")
+                            {
+                                iomodal.PType = EAPIparType.inSelAndMultiVal;
+                                iomodal.Params = new List<Params>();
+                                var pars = api.Post参数.Replace(",", ",").Split(',');
+                                var writes = api.写入点位.Split('\n');
+                                var reads = string.IsNullOrEmpty(api.检查点位) ? null : api.检查点位.Split('\n');
+                                for (int i = 0; i < pars.Length; i++)
+                                {
+                                    var prams = new Params { Param = pars[i].Trim(), keys = new List<WriteAndCheckKey>() };
+                                    var wrts = writes[i].Split('/');
+                                    var chks = reads == null ? null : reads[i].Split('/');
+
+                                    var wc = new WriteAndCheckKey();
+                                    wc.InputName = "BranchNum";
+                                    if (chks != null)
+                                    {
+                                        wc.CheckTagName = chks[0].Trim();
+                                     
+                                    }
+                                    else
+                                    {
+                                        wc.CheckTagName = wrts[0].Trim();
+                                      
+                                    }
+                                    prams.keys.Add(wc);
+
+                                    var wc1 = new WriteAndCheckKey();
+                                    wc1.InputName = "BrandNum";
+                                    if (chks != null)
+                                    {
+                                        wc1.CheckTagName = chks[1].Trim();
+                                     
+                                    }
+                                    else
+                                    {
+                                        wc1.CheckTagName = wrts[1].Trim();
+                                       
+                                    }
+                                    prams.keys.Add(wc1);
+
+
+                                    iomodal.Params.Add(prams);
+                                }
+                    
+
+                                postlist.Add(iomodal);
+                            }
+                        }
+
+
+                    }
+
+                    File.WriteAllText(getfileName, JsonBeauty.Execute(JsonConvert.SerializeObject(getlist, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore })));
+                    File.WriteAllText(PostfileName, JsonBeauty.Execute(JsonConvert.SerializeObject(postlist, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore })));
+                }
+            }
+
+        }
     }
 }

+ 2 - 0
Fine.OPCDaClient9000/DataMode/IoModal.cs

@@ -20,11 +20,13 @@ namespace Fine.OPCDaClient9000
         /// API调用名
         /// </summary>
         public string APIName { get; set; }   //API接口名
+        public string Content { get; set; }
         public bool IsCheck { get; set; } = true;  //是否进行标签读写校验,默认为:校验
         public int DelayTime { get; set; }   //读写间隔延时
         public List<Params> @Params { get; set; } = new List<Params>();
         public string Method { get;  set; } = "";
         public EAPIparType PType { get;  set; }
+
     }
 
     public class Params

+ 23 - 0
Fine.OPCDaClient9000/Excel/ExcelAPIModel.cs

@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Fine.OPCDaClient9000.Excel
+{
+    public class ExcelAPIModel
+    {
+        public string Api名称 { get; set; }
+        public string 接口备注 { get; set; }
+        public string 方法 { get; set; }
+        public int 读写间隔 { get; set; }
+        public string 是否检查 { get; set; }
+        public string 检查点位 { get; set; }
+        public string 写入点位 { get; set; }
+        public string Post类型 { get; set; }
+        public string Post参数 { get; set; }
+        public string Post格式 { get; set; }
+
+    }
+}

+ 18 - 0
Fine.OPCDaClient9000/Excel/ExcelManager.cs

@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Npoi.Mapper;
+namespace Fine.OPCDaClient9000.Excel
+{
+    public static  class ExcelManager
+    {
+        public static List<T> Excel2Model<T>(string filepath,string sheetName) where T:class
+        {
+            var mapper = new Mapper(filepath);
+            IEnumerable<RowInfo<T>> data = mapper.Take<T>(sheetName:sheetName);
+            return data.Select(a => a.Value).ToList();
+        }
+    }
+}

+ 16 - 0
Fine.OPCDaClient9000/Excel/ExcelProjectModel.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Fine.OPCDaClient9000.Excel
+{
+    class ExcelProjectModel
+    {
+        public string 模块名称 { get; set; }
+        public string 配置文件名称 { get; set; }
+        public string Sheet名称 { get; set; }
+
+    }
+}

BIN
Fine.OPCDaClient9000/Excel/模板下载.xlsx


+ 29 - 0
Fine.OPCDaClient9000/Fine.OPCDaClient9000.csproj

@@ -51,9 +51,30 @@
     <StartupObject />
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="BouncyCastle.Crypto, Version=1.8.9.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
+      <HintPath>..\packages\Portable.BouncyCastle.1.8.9\lib\net40\BouncyCastle.Crypto.dll</HintPath>
+    </Reference>
+    <Reference Include="ICSharpCode.SharpZipLib, Version=1.3.3.11, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
+      <HintPath>..\packages\SharpZipLib.1.3.3\lib\net45\ICSharpCode.SharpZipLib.dll</HintPath>
+    </Reference>
     <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
       <HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
     </Reference>
+    <Reference Include="NPOI, Version=2.5.6.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
+      <HintPath>..\packages\NPOI.2.5.6\lib\net45\NPOI.dll</HintPath>
+    </Reference>
+    <Reference Include="Npoi.Mapper, Version=4.1.0.0, Culture=neutral, PublicKeyToken=ecb4c11f6eaa0b06, processorArchitecture=MSIL">
+      <HintPath>..\packages\Npoi.Mapper.4.1.0\lib\net45\Npoi.Mapper.dll</HintPath>
+    </Reference>
+    <Reference Include="NPOI.OOXML, Version=2.5.6.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
+      <HintPath>..\packages\NPOI.2.5.6\lib\net45\NPOI.OOXML.dll</HintPath>
+    </Reference>
+    <Reference Include="NPOI.OpenXml4Net, Version=2.5.6.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
+      <HintPath>..\packages\NPOI.2.5.6\lib\net45\NPOI.OpenXml4Net.dll</HintPath>
+    </Reference>
+    <Reference Include="NPOI.OpenXmlFormats, Version=2.5.6.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
+      <HintPath>..\packages\NPOI.2.5.6\lib\net45\NPOI.OpenXmlFormats.dll</HintPath>
+    </Reference>
     <Reference Include="OpcNetApi">
       <HintPath>..\packages\OpcNetApi.2.1.107\lib\net40\OpcNetApi.dll</HintPath>
     </Reference>
@@ -61,6 +82,7 @@
       <HintPath>..\packages\OpcNetApi.Com.2.1.107\lib\net40\OpcNetApi.Com.dll</HintPath>
     </Reference>
     <Reference Include="System" />
+    <Reference Include="System.ComponentModel.DataAnnotations" />
     <Reference Include="System.Configuration" />
     <Reference Include="System.Core" />
     <Reference Include="System.Drawing" />
@@ -95,6 +117,9 @@
     <Compile Include="DbContext\SqlServerDbContext.cs" />
     <Compile Include="Entitys\TechParam.cs" />
     <Compile Include="Entitys\WorkOrder.cs" />
+    <Compile Include="Excel\ExcelAPIModel.cs" />
+    <Compile Include="Excel\ExcelManager.cs" />
+    <Compile Include="Excel\ExcelProjectModel.cs" />
     <Compile Include="Form1.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -225,6 +250,9 @@
     <None Include="config\Template\00.json">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
+    <None Include="Excel\模板下载.xlsx">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
     <None Include="packages.config" />
   </ItemGroup>
   <ItemGroup>
@@ -273,5 +301,6 @@
       <Install>false</Install>
     </BootstrapperPackage>
   </ItemGroup>
+  <ItemGroup />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>

+ 1 - 0
Fine.OPCDaClient9000/Program.cs

@@ -13,6 +13,7 @@ namespace Fine.OPCDaClient9000
 {
     class Program
     {
+        [STAThread]
         static void Main(string[] args)
         {
             /////加载配置

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 26258 - 0
Fine.OPCDaClient9000/bin/Debug/BouncyCastle.Crypto.xml


BIN
Fine.OPCDaClient9000/bin/Debug/Excel/模板下载.xlsx


+ 22 - 18
Fine.OPCDaClient9000/bin/Debug/Fine.OPCDaClient9000.exe.config

@@ -1,19 +1,21 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <configuration>
-  <connectionStrings>
-    <add name="default" connectionString="Data Source=127.0.0.1;Initial Catalog=qddb; User Id=DBTEST;Password=test@123" providerName="" />
-  </connectionStrings>
-  <appSettings>
-    <add key="logenable" value="true" />
-    <add key="logisrealpath" value="true" />
-    <!--如果是flase,logpath直接写文件夹相对路径-->
-    <add key="logpath" value="E:\ys\serverlog" />
-    <add key="auth" value="E230539F13CDB91D2764603BC283D909" />
-    <add key="isauth" value="false" />
-  </appSettings>
-  <startup>
-    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
-  </startup>
+
+	<connectionStrings>
+		<add name="default" connectionString="Data Source=127.0.0.1;Initial Catalog=qddb; User Id=DBTEST;Password=test@123" providerName="" />
+	</connectionStrings>
+	<appSettings>
+		<add key="logenable" value="true" />
+		<add key="logisrealpath" value="true" />
+		<!--如果是flase,logpath直接写文件夹相对路径-->
+		<add key="logpath" value="E:\ys\serverlog" />
+		<add key="auth" value="E230539F13CDB91D2764603BC283D909" />
+		<add key="isauth" value="false" />
+	</appSettings>
+    <startup>
+	
+     
+    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /></startup>
   <runtime>
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <dependentAssembly>
@@ -132,12 +134,14 @@
         <assemblyIdentity name="Microsoft.Extensions.Configuration.Binder" publicKeyToken="adb9793829ddae60" culture="neutral" />
         <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
       </dependentAssembly>
-    </assemblyBinding>
-    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <dependentAssembly>
         <assemblyIdentity name="OpcComRcw" publicKeyToken="9a40e993cbface53" culture="neutral" />
         <bindingRedirect oldVersion="0.0.0.0-2.0.105.1" newVersion="2.0.105.1" />
       </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-1.8.9.0" newVersion="1.8.9.0" />
+      </dependentAssembly>
     </assemblyBinding>
   </runtime>
-</configuration>
+</configuration>

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 10977 - 0
Fine.OPCDaClient9000/bin/Debug/ICSharpCode.SharpZipLib.xml


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 11817 - 0
Fine.OPCDaClient9000/bin/Debug/NPOI.OOXML.xml


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 3189 - 0
Fine.OPCDaClient9000/bin/Debug/NPOI.OpenXml4Net.xml


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 45803 - 0
Fine.OPCDaClient9000/bin/Debug/NPOI.xml


+ 31 - 0
Fine.OPCDaClient9000/bin/Debug/config/Router/5000Test/5K回潮测试_Get.json

@@ -0,0 +1,31 @@
+[
+    {
+        "APIName": "LGetTest",
+        "Content": "测试Get备注",
+        "IsCheck": true,
+        "DelayTime": 3000,
+        "Params": [
+            {
+                "Param": "",
+                "keys": [
+                    {
+                        "WriteTagName": "LGetTest.F_CV",
+                        "CheckTagName": "LGetTest.F_CV",
+                        "StrValue": "1",
+                        "CheckValue": "1",
+                        "DelayTime": 0
+                    },
+                    {
+                        "WriteTagName": "LTest.F_CV",
+                        "CheckTagName": "LTest.F_CV",
+                        "StrValue": "0",
+                        "CheckValue": "0",
+                        "DelayTime": 0
+                    }
+                ]
+            }
+        ],
+        "Method": "get",
+        "PType": 0
+    }
+]

+ 210 - 0
Fine.OPCDaClient9000/bin/Debug/config/Router/5000Test/5K回潮测试_Post.json

@@ -0,0 +1,210 @@
+[
+    {
+        "APIName": "LPost1Test",
+        "Content": "测试Post写入单值备注;写温度值",
+        "IsCheck": false,
+        "DelayTime": 3000,
+        "Params": [
+            {
+                "Param": "",
+                "keys": [
+                    {
+                        "WriteTagName": "LPostTest.F_CV",
+                        "CheckTagName": "LPostTest.F_CV",
+                        "DelayTime": 0
+                    }
+                ]
+            }
+        ],
+        "Method": "post",
+        "PType": 1
+    },
+    {
+        "APIName": "LPost2Test",
+        "Content": "测试Post写入单值备注 质量/批号/牌号",
+        "IsCheck": false,
+        "DelayTime": 3000,
+        "Params": [
+            {
+                "Param": "",
+                "keys": [
+                    {
+                        "InputName": "Weight",
+                        "WriteTagName": "LPost1Test.F_CV",
+                        "CheckTagName": "LPost1Test.F_CV",
+                        "DelayTime": 0
+                    },
+                    {
+                        "InputName": "BranchNo",
+                        "WriteTagName": "Branch.F_CV",
+                        "CheckTagName": "Branch.F_CV",
+                        "DelayTime": 0
+                    },
+                    {
+                        "InputName": "BrandNo",
+                        "WriteTagName": "BrandNum.F_CV",
+                        "CheckTagName": "BrandNum.F_CV",
+                        "DelayTime": 0
+                    }
+                ]
+            }
+        ],
+        "Method": "post",
+        "PType": 2
+    },
+    {
+        "APIName": "LPost3Test",
+        "Content": "测试Post写入单值备注 工单/批号/牌号",
+        "IsCheck": true,
+        "DelayTime": 3000,
+        "Params": [
+            {
+                "Param": "",
+                "keys": [
+                    {
+                        "InputName": "GDNum",
+                        "WriteTagName": "LPost1Test.F_CV",
+                        "CheckTagName": "LPost1Test.F_CV",
+                        "DelayTime": 0
+                    },
+                    {
+                        "InputName": "BranchNum",
+                        "WriteTagName": "Branch.F_CV",
+                        "CheckTagName": "Branch.F_CV",
+                        "DelayTime": 0
+                    },
+                    {
+                        "InputName": "BrandNum",
+                        "WriteTagName": "BrandNum.F_CV",
+                        "CheckTagName": "BrandNum.F_CV",
+                        "DelayTime": 0
+                    }
+                ]
+            }
+        ],
+        "Method": "post",
+        "PType": 2
+    },
+    {
+        "APIName": "LPost4Test",
+        "Content": "测试Post写入单值备注",
+        "IsCheck": true,
+        "DelayTime": 3000,
+        "Params": [
+            {
+                "Param": "YP01",
+                "keys": [
+                    {
+                        "WriteTagName": "LPost1Test.F_CV",
+                        "CheckTagName": "LPost1Test.F_CV",
+                        "StrValue": "1",
+                        "CheckValue": "1",
+                        "DelayTime": 0
+                    },
+                    {
+                        "WriteTagName": "LPost2Test.F_CV",
+                        "CheckTagName": "LPost2Test.F_CV",
+                        "StrValue": "0",
+                        "CheckValue": "0",
+                        "DelayTime": 0
+                    }
+                ]
+            },
+            {
+                "Param": "YP02",
+                "keys": [
+                    {
+                        "WriteTagName": "LPost1Test.F_CV",
+                        "CheckTagName": "LPost1Test.F_CV",
+                        "StrValue": "1",
+                        "CheckValue": "1",
+                        "DelayTime": 0
+                    },
+                    {
+                        "WriteTagName": "LPost2Test.F_CV",
+                        "CheckTagName": "LPost2Test.F_CV",
+                        "StrValue": "0",
+                        "CheckValue": "0",
+                        "DelayTime": 0
+                    }
+                ]
+            },
+            {
+                "Param": "YP03",
+                "keys": [
+                    {
+                        "WriteTagName": "LPost1Test.F_CV",
+                        "CheckTagName": "LPost1Test.F_CV",
+                        "StrValue": "1",
+                        "CheckValue": "1",
+                        "DelayTime": 0
+                    },
+                    {
+                        "WriteTagName": "LPost2Test.F_CV",
+                        "CheckTagName": "LPost2Test.F_CV",
+                        "StrValue": "0",
+                        "CheckValue": "0",
+                        "DelayTime": 0
+                    }
+                ]
+            }
+        ],
+        "Method": "post",
+        "PType": 3
+    },
+    {
+        "APIName": "LPost5Test",
+        "Content": "测试Post写入单值备注",
+        "IsCheck": true,
+        "DelayTime": 3000,
+        "Params": [
+            {
+                "Param": "YP01",
+                "keys": [
+                    {
+                        "InputName": "BranchNum",
+                        "CheckTagName": "BrandNum.F_CV",
+                        "DelayTime": 0
+                    },
+                    {
+                        "InputName": "BrandNum",
+                        "CheckTagName": "Branch.F_CV",
+                        "DelayTime": 0
+                    }
+                ]
+            },
+            {
+                "Param": "YP02",
+                "keys": [
+                    {
+                        "InputName": "BranchNum",
+                        "CheckTagName": "BrandNum.F_CV",
+                        "DelayTime": 0
+                    },
+                    {
+                        "InputName": "BrandNum",
+                        "CheckTagName": "Branch.F_CV",
+                        "DelayTime": 0
+                    }
+                ]
+            },
+            {
+                "Param": "YP03",
+                "keys": [
+                    {
+                        "InputName": "BranchNum",
+                        "CheckTagName": "BrandNum.F_CV",
+                        "DelayTime": 0
+                    },
+                    {
+                        "InputName": "BrandNum",
+                        "CheckTagName": "Branch.F_CV",
+                        "DelayTime": 0
+                    }
+                ]
+            }
+        ],
+        "Method": "post",
+        "PType": 4
+    }
+]

+ 38 - 0
Fine.OPCDaClient9000/bin/Debug/config/Router/单点5K/5K单机_Get.json

@@ -0,0 +1,38 @@
+[
+    {
+        "APIName": "MGetTest",
+        "Content": "测试Get备注",
+        "IsCheck": true,
+        "DelayTime": 3000,
+        "Params": [
+            {
+                "Param": "",
+                "keys": [
+                    {
+                        "WriteTagName": "LGetTest.F_CV",
+                        "CheckTagName": "LGetTest.F_CV",
+                        "StrValue": "1",
+                        "CheckValue": "1",
+                        "DelayTime": 0
+                    },
+                    {
+                        "WriteTagName": "LTest.F_CV",
+                        "CheckTagName": "LTest.F_CV",
+                        "StrValue": "0",
+                        "CheckValue": "0",
+                        "DelayTime": 0
+                    },
+                    {
+                        "WriteTagName": "LTest.F_CV",
+                        "CheckTagName": "LTest.F_CV",
+                        "StrValue": "1",
+                        "CheckValue": "1",
+                        "DelayTime": 0
+                    }
+                ]
+            }
+        ],
+        "Method": "get",
+        "PType": 0
+    }
+]

+ 210 - 0
Fine.OPCDaClient9000/bin/Debug/config/Router/单点5K/5K单机_Post.json

@@ -0,0 +1,210 @@
+[
+    {
+        "APIName": "MPost1Test",
+        "Content": "测试Post写入单值备注;写温度值",
+        "IsCheck": false,
+        "DelayTime": 3000,
+        "Params": [
+            {
+                "Param": "",
+                "keys": [
+                    {
+                        "WriteTagName": "LPostTest.F_CV",
+                        "CheckTagName": "LPostTest.F_CV",
+                        "DelayTime": 0
+                    }
+                ]
+            }
+        ],
+        "Method": "post",
+        "PType": 1
+    },
+    {
+        "APIName": "MPost2Test",
+        "Content": "测试Post写入单值备注 质量/批号/牌号",
+        "IsCheck": false,
+        "DelayTime": 3000,
+        "Params": [
+            {
+                "Param": "",
+                "keys": [
+                    {
+                        "InputName": "Weight",
+                        "WriteTagName": "LPost1Test.F_CV",
+                        "CheckTagName": "LPost1Test.F_CV",
+                        "DelayTime": 0
+                    },
+                    {
+                        "InputName": "BranchNo",
+                        "WriteTagName": "Branch.F_CV",
+                        "CheckTagName": "Branch.F_CV",
+                        "DelayTime": 0
+                    },
+                    {
+                        "InputName": "BrandNo",
+                        "WriteTagName": "BrandNum.F_CV",
+                        "CheckTagName": "BrandNum.F_CV",
+                        "DelayTime": 0
+                    }
+                ]
+            }
+        ],
+        "Method": "post",
+        "PType": 2
+    },
+    {
+        "APIName": "MPost3Test",
+        "Content": "测试Post写入单值备注 工单/批号/牌号",
+        "IsCheck": true,
+        "DelayTime": 3000,
+        "Params": [
+            {
+                "Param": "",
+                "keys": [
+                    {
+                        "InputName": "GDNum",
+                        "WriteTagName": "LPost1Test.F_CV",
+                        "CheckTagName": "LPost1Test.F_CV",
+                        "DelayTime": 0
+                    },
+                    {
+                        "InputName": "BranchNum",
+                        "WriteTagName": "Branch.F_CV",
+                        "CheckTagName": "Branch.F_CV",
+                        "DelayTime": 0
+                    },
+                    {
+                        "InputName": "BrandNum",
+                        "WriteTagName": "BrandNum.F_CV",
+                        "CheckTagName": "BrandNum.F_CV",
+                        "DelayTime": 0
+                    }
+                ]
+            }
+        ],
+        "Method": "post",
+        "PType": 2
+    },
+    {
+        "APIName": "MPost4Test",
+        "Content": "测试Post写入单值备注",
+        "IsCheck": true,
+        "DelayTime": 3000,
+        "Params": [
+            {
+                "Param": "YP01",
+                "keys": [
+                    {
+                        "WriteTagName": "LPost1Test.F_CV",
+                        "CheckTagName": "LPost1Test.F_CV",
+                        "StrValue": "1",
+                        "CheckValue": "1",
+                        "DelayTime": 0
+                    },
+                    {
+                        "WriteTagName": "LPost2Test.F_CV",
+                        "CheckTagName": "LPost2Test.F_CV",
+                        "StrValue": "0",
+                        "CheckValue": "0",
+                        "DelayTime": 0
+                    }
+                ]
+            },
+            {
+                "Param": "YP02",
+                "keys": [
+                    {
+                        "WriteTagName": "LPost1Test.F_CV",
+                        "CheckTagName": "LPost1Test.F_CV",
+                        "StrValue": "1",
+                        "CheckValue": "1",
+                        "DelayTime": 0
+                    },
+                    {
+                        "WriteTagName": "LPost2Test.F_CV",
+                        "CheckTagName": "LPost2Test.F_CV",
+                        "StrValue": "0",
+                        "CheckValue": "0",
+                        "DelayTime": 0
+                    }
+                ]
+            },
+            {
+                "Param": "YP03",
+                "keys": [
+                    {
+                        "WriteTagName": "LPost1Test.F_CV",
+                        "CheckTagName": "LPost1Test.F_CV",
+                        "StrValue": "1",
+                        "CheckValue": "1",
+                        "DelayTime": 0
+                    },
+                    {
+                        "WriteTagName": "LPost2Test.F_CV",
+                        "CheckTagName": "LPost2Test.F_CV",
+                        "StrValue": "0",
+                        "CheckValue": "0",
+                        "DelayTime": 0
+                    }
+                ]
+            }
+        ],
+        "Method": "post",
+        "PType": 3
+    },
+    {
+        "APIName": "MPost5Test",
+        "Content": "测试Post写入单值备注",
+        "IsCheck": true,
+        "DelayTime": 3000,
+        "Params": [
+            {
+                "Param": "YP01",
+                "keys": [
+                    {
+                        "InputName": "BranchNum",
+                        "CheckTagName": "BrandNum.F_CV",
+                        "DelayTime": 0
+                    },
+                    {
+                        "InputName": "BrandNum",
+                        "CheckTagName": "Branch.F_CV",
+                        "DelayTime": 0
+                    }
+                ]
+            },
+            {
+                "Param": "YP02",
+                "keys": [
+                    {
+                        "InputName": "BranchNum",
+                        "CheckTagName": "BrandNum.F_CV",
+                        "DelayTime": 0
+                    },
+                    {
+                        "InputName": "BrandNum",
+                        "CheckTagName": "Branch.F_CV",
+                        "DelayTime": 0
+                    }
+                ]
+            },
+            {
+                "Param": "YP03",
+                "keys": [
+                    {
+                        "InputName": "BranchNum",
+                        "CheckTagName": "BrandNum.F_CV",
+                        "DelayTime": 0
+                    },
+                    {
+                        "InputName": "BrandNum",
+                        "CheckTagName": "Branch.F_CV",
+                        "DelayTime": 0
+                    }
+                ]
+            }
+        ],
+        "Method": "post",
+        "PType": 4
+    }
+]

+ 18 - 2
Fine.OPCDaClient9000/obj/Debug/Fine.OPCDaClient9000.csproj.FileListAbsolute.txt

@@ -237,7 +237,6 @@ E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient
 E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\System.Text.Encodings.Web.xml
 E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\Microsoft.Extensions.Options.ConfigurationExtensions.xml
 E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\obj\Debug\Fine.OPCDaClient9000.csproj.AssemblyReference.cache
-E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\obj\Debug\Fine.OPCDaClient9000.exe.config
 E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\obj\Debug\Fine.OPCDaClient9000.Form1.resources
 E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\obj\Debug\Fine.OPCDaClient9000.csproj.GenerateResource.cache
 E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\obj\Debug\Fine.OPCDaClient9000.csproj.CoreCompileInputs.cache
@@ -265,7 +264,6 @@ E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient
 E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\config\Router\JsonCfg\L3_JL2_POST.json
 E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\config\Router\JsonCfg\L3_JYG_GET.json
 E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\config\Router\JsonCfg\L3_JYG_POST.json
-E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\obj\Debug\Fine.OPCDaClient9000.csproj.SuggestedBindingRedirects.cache
 E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\obj\Debug\Fine.OPCDaClient9000.ConfigForm.resources
 E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\config\Template\5.json
 E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\config\Template\4.json
@@ -275,3 +273,21 @@ E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient
 E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\config\Template\1.json
 E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\config\Template\01.json
 E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\config\Template\00.json
+E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\Excel\模板下载.xlsx
+E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\BouncyCastle.Crypto.dll
+E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\ICSharpCode.SharpZipLib.dll
+E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\NPOI.dll
+E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\Npoi.Mapper.dll
+E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\NPOI.OOXML.dll
+E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\NPOI.OpenXml4Net.dll
+E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\NPOI.OpenXmlFormats.dll
+E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\BouncyCastle.Crypto.xml
+E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\ICSharpCode.SharpZipLib.pdb
+E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\ICSharpCode.SharpZipLib.xml
+E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\NPOI.pdb
+E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\NPOI.xml
+E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\NPOI.OOXML.pdb
+E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\NPOI.OOXML.xml
+E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\NPOI.OpenXml4Net.pdb
+E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\NPOI.OpenXml4Net.xml
+E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient9000\bin\Debug\NPOI.OpenXmlFormats.pdb

+ 0 - 143
Fine.OPCDaClient9000/obj/Debug/Fine.OPCDaClient9000.exe.config

@@ -1,143 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<configuration>
-  <connectionStrings>
-    <add name="default" connectionString="Data Source=127.0.0.1;Initial Catalog=qddb; User Id=DBTEST;Password=test@123" providerName="" />
-  </connectionStrings>
-  <appSettings>
-    <add key="logenable" value="true" />
-    <add key="logisrealpath" value="true" />
-    <!--如果是flase,logpath直接写文件夹相对路径-->
-    <add key="logpath" value="E:\ys\serverlog" />
-    <add key="auth" value="E230539F13CDB91D2764603BC283D909" />
-    <add key="isauth" value="false" />
-  </appSettings>
-  <startup>
-    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
-  </startup>
-  <runtime>
-    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
-      <dependentAssembly>
-        <assemblyIdentity name="Microsoft.IdentityModel.Abstractions" publicKeyToken="31bf3856ad364e35" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-6.21.0.0" newVersion="6.21.0.0" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="Microsoft.Identity.Client" publicKeyToken="0a613f4dd989e8ae" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-4.45.0.0" newVersion="4.45.0.0" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-6.0.0.3" newVersion="6.0.0.3" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="Microsoft.Extensions.Configuration.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="Microsoft.Extensions.Logging" publicKeyToken="adb9793829ddae60" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="Microsoft.Extensions.Hosting.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="Microsoft.Extensions.Primitives" publicKeyToken="adb9793829ddae60" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="Microsoft.Extensions.FileProviders.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="Microsoft.Extensions.Configuration" publicKeyToken="adb9793829ddae60" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="Microsoft.Extensions.Configuration.EnvironmentVariables" publicKeyToken="adb9793829ddae60" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="Microsoft.Extensions.Configuration.FileExtensions" publicKeyToken="adb9793829ddae60" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="Microsoft.AspNetCore.Http" publicKeyToken="adb9793829ddae60" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-2.1.22.0" newVersion="2.1.22.0" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="Microsoft.Extensions.Options" publicKeyToken="adb9793829ddae60" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="Microsoft.Extensions.FileProviders.Physical" publicKeyToken="adb9793829ddae60" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="Microsoft.AspNetCore.Server.Kestrel.Core" publicKeyToken="adb9793829ddae60" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-2.1.25.0" newVersion="2.1.25.0" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="System.Security.Cryptography.Cng" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-4.3.1.1" newVersion="4.3.1.1" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
-      </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="Microsoft.Extensions.Configuration.Binder" publicKeyToken="adb9793829ddae60" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
-      </dependentAssembly>
-    </assemblyBinding>
-    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
-      <dependentAssembly>
-        <assemblyIdentity name="OpcComRcw" publicKeyToken="9a40e993cbface53" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-2.0.105.1" newVersion="2.0.105.1" />
-      </dependentAssembly>
-    </assemblyBinding>
-  </runtime>
-</configuration>

+ 4 - 0
Fine.OPCDaClient9000/packages.config

@@ -1,4 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <packages>
   <package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
+  <package id="NPOI" version="2.5.6" targetFramework="net472" />
+  <package id="Npoi.Mapper" version="4.1.0" targetFramework="net472" />
+  <package id="Portable.BouncyCastle" version="1.8.9" targetFramework="net472" />
+  <package id="SharpZipLib" version="1.3.3" targetFramework="net472" />
 </packages>

+ 18 - 0
Fine.Util/Const.cs

@@ -51,7 +51,25 @@ namespace Fine.Util
 
             }
         }
+        public static string LogFullPath
+        {
+            get
+            {
+                if (LogIsReadPath == true)
+                {
+                    if (!Directory.Exists(path))
+                    {
+                        Directory.CreateDirectory(path);
+                    }
+                    return Path.Combine(path, DateTime.Now.ToString("yyyy-MM-dd-HH") + "LogFull.log");
+                }
+                else
+                {
+                    return Path.Combine(AppDomain.CurrentDomain.BaseDirectory, path, DateTime.Now.ToString("yyyy-MM-dd-HH") + "error.log");
+                }
 
+            }
+        }
         public static string EnvLog {
             get
             {

+ 34 - 4
Fine.Util/LogUtil.cs

@@ -23,9 +23,23 @@ namespace Fine.Util
                     writer.Close();
                 }
             }
-          
+
+        }
+        public static async Task WriteError(string tag, string content)
+        {
+
+            if (Const.LogEnable)
+            {
+                using (StreamWriter writer = new StreamWriter(Const.LogErrorPath, true))
+                {
+                    writer.WriteLine($"{DateTime.Now.ToString("yyyy-mm-dd HH:mm:ss fff")} {tag}");
+                    await writer.WriteLineAsync(content);
+                    writer.Flush();
+                    writer.Close();
+                }
+            }
+
         }
-  
 
         public static async Task Write(string content)
         {
@@ -43,7 +57,8 @@ namespace Fine.Util
         }
 
 
-        public static async Task WriteEnvDlog(string content) {
+        public static async Task WriteEnvDlog(string content)
+        {
             if (Const.LogEnable)
             {
                 //Console.WriteLine(tag + ":" + content);
@@ -70,8 +85,23 @@ namespace Fine.Util
                     writer.Close();
                 }
             }
-            
+
         }
 
+        public static async Task WriteStep(string content)
+        {
+
+            if (Const.LogEnable)
+            {
+                //Console.WriteLine(tag + ":" + content);
+                using (StreamWriter writer = new StreamWriter(Const.LogFullPath, true))
+                {
+                    writer.WriteLine($"{DateTime.Now.ToString("yyyy-mm-dd HH:mm:ss fff")}");
+                    await writer.WriteLineAsync(content);
+                    writer.Flush();
+                    writer.Close();
+                }
+            }
+        }
     }
 }

+ 1 - 0
Fine.Util/obj/Debug/Fine.Util.csproj.FileListAbsolute.txt

@@ -49,3 +49,4 @@ E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.Util\obj\De
 E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.Util\obj\Debug\Fine.Util.csproj.CopyComplete
 E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.Util\obj\Debug\Fine.Util.dll
 E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.Util\obj\Debug\Fine.Util.pdb
+E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\Fine.Util\obj\Debug\Fine.Util.csproj.AssemblyReference.cache

+ 0 - 1
OpcClientMqtt/obj/Debug/OpcClientMqtt.csproj.FileListAbsolute.txt

@@ -738,4 +738,3 @@ E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\OpcClientMqtt\ob
 E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\OpcClientMqtt\obj\Debug\OpcClientMqtt.exe
 E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\OpcClientMqtt\obj\Debug\OpcClientMqtt.pdb
 E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\OpcClientMqtt\obj\Debug\OpcClientMqtt.csproj.AssemblyReference.cache
-E:\yszn\Fine.OPCDaClient1027_vs2019\Fine.OPCDaClient1027_vs2019\OpcClientMqtt\obj\Debug\OpcClientMqtt.csproj.SuggestedBindingRedirects.cache

+ 1 - 1
YS.Smart.Ctl/obj/YS.Smart.Ctl.csproj.nuget.dgspec.json

@@ -71,7 +71,7 @@
               "privateAssets": "all"
             }
           },
-          "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.301\\RuntimeIdentifierGraph.json"
+          "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.412\\RuntimeIdentifierGraph.json"
         }
       }
     }

+ 4 - 1
YS.Smart.Ctl/obj/YS.Smart.Ctl.csproj.nuget.g.props

@@ -7,10 +7,13 @@
     <NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">D:\ProgramData\NugetPackage</NuGetPackageRoot>
     <NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">D:\ProgramData\NugetPackage;d:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
     <NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
-    <NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.2.1</NuGetToolVersion>
+    <NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.11.2</NuGetToolVersion>
   </PropertyGroup>
   <ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
     <SourceRoot Include="D:\ProgramData\NugetPackage\" />
     <SourceRoot Include="d:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
   </ItemGroup>
+  <PropertyGroup>
+    <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
+  </PropertyGroup>
 </Project>

+ 5 - 1
YS.Smart.Ctl/obj/YS.Smart.Ctl.csproj.nuget.g.targets

@@ -1,2 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="no"?>
-<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
+  </PropertyGroup>
+</Project>

+ 1 - 1
YS.Smart.Ctl/obj/project.assets.json

@@ -160,7 +160,7 @@
             "privateAssets": "all"
           }
         },
-        "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.301\\RuntimeIdentifierGraph.json"
+        "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.412\\RuntimeIdentifierGraph.json"
       }
     }
   }