章政 %!s(int64=8) %!d(string=hai) anos
pai
achega
37ea42509b

+ 1 - 1
UAS_XmlAnalysor/App.config

@@ -6,7 +6,7 @@
         </sectionGroup>
     </configSections>
     <startup> 
-        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
     </startup>
     <userSettings>
         <UAS_XmlAnalysor.Properties.Settings>

+ 45 - 46
UAS_XmlAnalysor/Form1.Designer.cs

@@ -57,10 +57,10 @@
             // StartWatch
             // 
             this.StartWatch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.StartWatch.Location = new System.Drawing.Point(145, 256);
-            this.StartWatch.Margin = new System.Windows.Forms.Padding(2);
+            this.StartWatch.Location = new System.Drawing.Point(193, 320);
+            this.StartWatch.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.StartWatch.Name = "StartWatch";
-            this.StartWatch.Size = new System.Drawing.Size(64, 28);
+            this.StartWatch.Size = new System.Drawing.Size(85, 35);
             this.StartWatch.TabIndex = 0;
             this.StartWatch.Text = "开始监控";
             this.StartWatch.UseVisualStyleBackColor = true;
@@ -70,10 +70,10 @@
             // 
             this.StopWatch.Enabled = false;
             this.StopWatch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.StopWatch.Location = new System.Drawing.Point(249, 256);
-            this.StopWatch.Margin = new System.Windows.Forms.Padding(2);
+            this.StopWatch.Location = new System.Drawing.Point(332, 320);
+            this.StopWatch.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.StopWatch.Name = "StopWatch";
-            this.StopWatch.Size = new System.Drawing.Size(64, 28);
+            this.StopWatch.Size = new System.Drawing.Size(85, 35);
             this.StopWatch.TabIndex = 1;
             this.StopWatch.Text = "停止监控";
             this.StopWatch.UseVisualStyleBackColor = true;
@@ -83,29 +83,28 @@
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(27, 139);
-            this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label1.Location = new System.Drawing.Point(36, 174);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(84, 20);
+            this.label1.Size = new System.Drawing.Size(107, 25);
             this.label1.TabIndex = 2;
             this.label1.Text = "监控文件夹";
             // 
             // FolderPath
             // 
             this.FolderPath.Enabled = false;
-            this.FolderPath.Location = new System.Drawing.Point(112, 139);
-            this.FolderPath.Margin = new System.Windows.Forms.Padding(2);
+            this.FolderPath.Location = new System.Drawing.Point(149, 174);
+            this.FolderPath.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.FolderPath.Name = "FolderPath";
-            this.FolderPath.Size = new System.Drawing.Size(220, 21);
+            this.FolderPath.Size = new System.Drawing.Size(292, 25);
             this.FolderPath.TabIndex = 3;
             // 
             // ChooseFolder
             // 
             this.ChooseFolder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ChooseFolder.Location = new System.Drawing.Point(346, 139);
-            this.ChooseFolder.Margin = new System.Windows.Forms.Padding(2);
+            this.ChooseFolder.Location = new System.Drawing.Point(461, 174);
+            this.ChooseFolder.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.ChooseFolder.Name = "ChooseFolder";
-            this.ChooseFolder.Size = new System.Drawing.Size(78, 24);
+            this.ChooseFolder.Size = new System.Drawing.Size(104, 30);
             this.ChooseFolder.TabIndex = 6;
             this.ChooseFolder.Text = "选择文件夹";
             this.ChooseFolder.UseVisualStyleBackColor = true;
@@ -113,20 +112,20 @@
             // 
             // OperateResult
             // 
-            this.OperateResult.Location = new System.Drawing.Point(446, 11);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(2);
+            this.OperateResult.Location = new System.Drawing.Point(595, 14);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(197, 270);
+            this.OperateResult.Size = new System.Drawing.Size(280, 336);
             this.OperateResult.TabIndex = 7;
             this.OperateResult.Text = "";
             // 
             // Clean
             // 
             this.Clean.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Clean.Location = new System.Drawing.Point(516, 287);
-            this.Clean.Margin = new System.Windows.Forms.Padding(2);
+            this.Clean.Location = new System.Drawing.Point(699, 359);
+            this.Clean.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Clean.Name = "Clean";
-            this.Clean.Size = new System.Drawing.Size(56, 24);
+            this.Clean.Size = new System.Drawing.Size(75, 30);
             this.Clean.TabIndex = 8;
             this.Clean.Text = "清除";
             this.Clean.UseVisualStyleBackColor = true;
@@ -135,10 +134,10 @@
             // ChooseBackUpFolder
             // 
             this.ChooseBackUpFolder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ChooseBackUpFolder.Location = new System.Drawing.Point(346, 201);
-            this.ChooseBackUpFolder.Margin = new System.Windows.Forms.Padding(2);
+            this.ChooseBackUpFolder.Location = new System.Drawing.Point(461, 251);
+            this.ChooseBackUpFolder.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.ChooseBackUpFolder.Name = "ChooseBackUpFolder";
-            this.ChooseBackUpFolder.Size = new System.Drawing.Size(78, 24);
+            this.ChooseBackUpFolder.Size = new System.Drawing.Size(104, 30);
             this.ChooseBackUpFolder.TabIndex = 11;
             this.ChooseBackUpFolder.Text = "选择文件夹";
             this.ChooseBackUpFolder.UseVisualStyleBackColor = true;
@@ -147,20 +146,19 @@
             // BackUpFolderPath
             // 
             this.BackUpFolderPath.Enabled = false;
-            this.BackUpFolderPath.Location = new System.Drawing.Point(112, 201);
-            this.BackUpFolderPath.Margin = new System.Windows.Forms.Padding(2);
+            this.BackUpFolderPath.Location = new System.Drawing.Point(149, 251);
+            this.BackUpFolderPath.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.BackUpFolderPath.Name = "BackUpFolderPath";
-            this.BackUpFolderPath.Size = new System.Drawing.Size(220, 21);
+            this.BackUpFolderPath.Size = new System.Drawing.Size(292, 25);
             this.BackUpFolderPath.TabIndex = 10;
             // 
             // label2
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(27, 201);
-            this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label2.Location = new System.Drawing.Point(36, 251);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(84, 20);
+            this.label2.Size = new System.Drawing.Size(107, 25);
             this.label2.TabIndex = 9;
             this.label2.Text = "备份文件夹";
             // 
@@ -168,29 +166,27 @@
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(27, 80);
-            this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label3.Location = new System.Drawing.Point(36, 100);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(69, 20);
+            this.label3.Size = new System.Drawing.Size(88, 25);
             this.label3.TabIndex = 12;
             this.label3.Text = "岗位资源";
             // 
             // Source
             // 
-            this.Source.Location = new System.Drawing.Point(112, 79);
-            this.Source.Margin = new System.Windows.Forms.Padding(2);
+            this.Source.Location = new System.Drawing.Point(149, 99);
+            this.Source.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Source.Name = "Source";
-            this.Source.Size = new System.Drawing.Size(220, 21);
+            this.Source.Size = new System.Drawing.Size(292, 25);
             this.Source.TabIndex = 13;
             // 
             // label4
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(27, 23);
-            this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label4.Location = new System.Drawing.Point(36, 29);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(69, 20);
+            this.label4.Size = new System.Drawing.Size(88, 25);
             this.label4.TabIndex = 14;
             this.label4.Text = "账套选择";
             // 
@@ -198,17 +194,19 @@
             // 
             this.Master.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.Master.FormattingEnabled = true;
-            this.Master.Location = new System.Drawing.Point(112, 23);
+            this.Master.Location = new System.Drawing.Point(149, 29);
+            this.Master.Margin = new System.Windows.Forms.Padding(4);
             this.Master.Name = "Master";
-            this.Master.Size = new System.Drawing.Size(220, 20);
+            this.Master.Size = new System.Drawing.Size(292, 23);
             this.Master.TabIndex = 15;
             // 
             // AutoStart
             // 
             this.AutoStart.AutoSize = true;
-            this.AutoStart.Location = new System.Drawing.Point(343, 26);
+            this.AutoStart.Location = new System.Drawing.Point(457, 32);
+            this.AutoStart.Margin = new System.Windows.Forms.Padding(4);
             this.AutoStart.Name = "AutoStart";
-            this.AutoStart.Size = new System.Drawing.Size(96, 16);
+            this.AutoStart.Size = new System.Drawing.Size(119, 19);
             this.AutoStart.TabIndex = 16;
             this.AutoStart.Text = "开机自动启动";
             this.AutoStart.UseVisualStyleBackColor = true;
@@ -216,9 +214,9 @@
             // 
             // Form1
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(665, 316);
+            this.ClientSize = new System.Drawing.Size(887, 395);
             this.Controls.Add(this.AutoStart);
             this.Controls.Add(this.Master);
             this.Controls.Add(this.label4);
@@ -234,7 +232,8 @@
             this.Controls.Add(this.label1);
             this.Controls.Add(this.StopWatch);
             this.Controls.Add(this.StartWatch);
-            this.Margin = new System.Windows.Forms.Padding(2);
+            this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.MaximizeBox = false;
             this.Name = "Form1";
             this.Text = "UAS_XML解析器";
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);

+ 19 - 3
UAS_XmlAnalysor/Form1.cs

@@ -29,6 +29,7 @@ namespace UAS_XmlAnalysor
         private void Form1_Load(object sender, EventArgs e)
         {
             CheckForIllegalCrossThreadCalls = false;
+            FormBorderStyle = FormBorderStyle.FixedSingle;
             InitDB = new Thread(ConnectDB);
             //添加监控事件
             XmlWatcher.Created += new FileSystemEventHandler(XmlWatcher_Created);
@@ -72,6 +73,19 @@ namespace UAS_XmlAnalysor
                 OperateResult.AppendText("请选择监控文件夹和备份文件夹\n");
                 return;
             }
+            else
+            {
+                if (!Directory.Exists(FolderPath.Text))
+                {
+                    OperateResult.AppendText("监控文件夹不存在\n");
+                    return;
+                }
+                if (!Directory.Exists(BackUpFolderPath.Text))
+                {
+                    OperateResult.AppendText("备份文件夹不存在\n");
+                    return;
+                }
+            }
             if (FolderPath.Text == BackUpFolderPath.Text)
             {
                 OperateResult.AppendText("监控文件夹和备份文件夹不能相同\n");
@@ -93,8 +107,6 @@ namespace UAS_XmlAnalysor
             XmlWatcher.Path = FolderPath.Text;
             XmlWatcher.Filter = "*.xml";
             XmlWatcher.EnableRaisingEvents = true;
-            string CacheString = FolderPath.Text + "|" + BackUpFolderPath.Text + "|" + Source.Text + "|" + Master.Text + "|" + AutoStart.Checked;
-            //写入前先删除文件
             try
             {
                 File.Delete(CachePath);
@@ -170,10 +182,14 @@ namespace UAS_XmlAnalysor
             string testDate = "";
             string testTime = "";
             XmlReader myReader = XmlReader.Create(FolderPath.Text + @"\" + e.Name);
+            //获取文件名的序列号,如SA123456.xml
             string sncode = e.Name.Split('.')[0];
-            string iMakeCode = dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_sncode='" + sncode + "'").ToString();
+            //获取序列号ID最大的工单号
+            string iMakeCode = dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_sncode='" + sncode + "' order by ms_id desc").ToString();
             OperateResult.AppendText("读取文件" + e.Name + "\n");
+            //获取采集的项目名称
             List<string> name = new List<string>();
+            //获取采集项目的结果
             List<string> result = new List<string>();
             int name_or_result = 0;
             while (myReader.Read())

+ 1 - 1
UAS_XmlAnalysor/Properties/AssemblyInfo.cs

@@ -8,7 +8,7 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyTitle("UAS_XmlAnalysor")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
+[assembly: AssemblyCompany("深圳市优软科技有限公司")]
 [assembly: AssemblyProduct("UAS_XmlAnalysor")]
 [assembly: AssemblyCopyright("Copyright ©  2017")]
 [assembly: AssemblyTrademark("")]

+ 1 - 1
UAS_XmlAnalysor/Properties/Resources.Designer.cs

@@ -61,7 +61,7 @@ namespace UAS_XmlAnalysor.Properties {
         }
         
         /// <summary>
-        ///   查找类似于 (图标) 的 System.Drawing.Icon 类型的本地化资源。
+        ///   查找类似于 (Icon) 的 System.Drawing.Icon 类型的本地化资源。
         /// </summary>
         internal static System.Drawing.Icon xml_48px_1124003_easyicon_net {
             get {

+ 2 - 1
UAS_XmlAnalysor/UAS_XmlAnalysor.csproj

@@ -12,7 +12,8 @@
     <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
-    <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+    <TargetFrameworkProfile>
+    </TargetFrameworkProfile>
     <IsWebBootstrapper>true</IsWebBootstrapper>
     <PublishUrl>ftp://192.168.253.9/MESSetting/Xml/</PublishUrl>
     <Install>true</Install>