luocaiyang 11 месяцев назад
Родитель
Сommit
fd9adb015a

+ 18 - 7
wispro.sp.utility/IPEasyUtility.cs

@@ -316,14 +316,26 @@ namespace wispro.sp.utility
                     //添加从文件清单中获取“新申请第一次内审	(初稿)、	新申请第一次返稿(第一次发客户文档)、新申请文档(定稿文档)”
                     var table_filelist = waitGetElementById(wait, "table_filelist");
                     //定稿文件
-                    Download(retObject, driver, wait, table_filelist, "新申请文档");
+                    try
+                    {
+                        Download(retObject, driver, wait, table_filelist, "新申请文档");
+                    }
+                    catch { }
                     //新申请第一次返稿文件
-                    Download(retObject, driver, wait, table_filelist, "新申请第一次返稿");
+                    try
+                    {
+                        Download(retObject, driver, wait, table_filelist, "新申请第一次返稿");
+                    }
+                    catch { }
 
                     //初稿文件
-                    waitGetElementById(wait, "draftfiletoggle").Click();
-                    var table_draffilelist = waitGetElementById(wait, "table_draftfilelist");// driver.FindElement(By.Id("table_draftfilelist"));
-                    Download(retObject, driver, wait, table_draffilelist, "新申请第一次内审");
+                    try
+                    {
+                        waitGetElementById(wait, "draftfiletoggle").Click();
+                        var table_draffilelist = waitGetElementById(wait, "table_draftfilelist");// driver.FindElement(By.Id("table_draftfilelist"));
+                        Download(retObject, driver, wait, table_draffilelist, "新申请第一次内审");
+                    }
+                    catch { }
 
                 }
                 catch (Exception ex)
@@ -347,9 +359,8 @@ namespace wispro.sp.utility
                 try { 
                     return table_filelist.FindElement(By.XPath($"//td[@colname='file_desc'][normalize-space()='{fileType}']"));
                 }
-                catch (Exception ex) 
+                catch 
                 {
-                    
                     return null;
                 }
             });

+ 15 - 3
wispro.sp.winClient/frmCaseFileCompare.Designer.cs

@@ -33,6 +33,7 @@
             txtCaseNo = new System.Windows.Forms.TextBox();
             comboBox1 = new System.Windows.Forms.ComboBox();
             richTextBox1 = new System.Windows.Forms.RichTextBox();
+            lblMsg = new System.Windows.Forms.Label();
             SuspendLayout();
             // 
             // button1
@@ -67,7 +68,7 @@
             comboBox1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
             comboBox1.FormattingEnabled = true;
             comboBox1.Items.AddRange(new object[] { "比较结果", "初稿与第一次返稿文档修订文字", "第一次返稿与定稿文档修订文字" });
-            comboBox1.Location = new System.Drawing.Point(1028, 30);
+            comboBox1.Location = new System.Drawing.Point(1457, 30);
             comboBox1.Name = "comboBox1";
             comboBox1.Size = new System.Drawing.Size(348, 36);
             comboBox1.TabIndex = 4;
@@ -78,15 +79,25 @@
             richTextBox1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
             richTextBox1.Location = new System.Drawing.Point(26, 93);
             richTextBox1.Name = "richTextBox1";
-            richTextBox1.Size = new System.Drawing.Size(1350, 626);
+            richTextBox1.Size = new System.Drawing.Size(1779, 736);
             richTextBox1.TabIndex = 5;
             richTextBox1.Text = "";
             // 
+            // lblMsg
+            // 
+            lblMsg.AutoSize = true;
+            lblMsg.ForeColor = System.Drawing.Color.FromArgb(255, 128, 128);
+            lblMsg.Location = new System.Drawing.Point(775, 33);
+            lblMsg.Name = "lblMsg";
+            lblMsg.Size = new System.Drawing.Size(0, 28);
+            lblMsg.TabIndex = 6;
+            // 
             // frmCaseFileCompare
             // 
             AutoScaleDimensions = new System.Drawing.SizeF(13F, 28F);
             AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            ClientSize = new System.Drawing.Size(1408, 747);
+            ClientSize = new System.Drawing.Size(1837, 857);
+            Controls.Add(lblMsg);
             Controls.Add(richTextBox1);
             Controls.Add(comboBox1);
             Controls.Add(txtCaseNo);
@@ -106,5 +117,6 @@
         private System.Windows.Forms.TextBox txtCaseNo;
         private System.Windows.Forms.ComboBox comboBox1;
         private System.Windows.Forms.RichTextBox richTextBox1;
+        private System.Windows.Forms.Label lblMsg;
     }
 }

+ 36 - 7
wispro.sp.winClient/frmCaseFileCompare.cs

@@ -29,6 +29,7 @@ namespace wispro.sp.winClient
 
         private void button1_Click(object sender, EventArgs e)
         {
+
             if (string.IsNullOrEmpty(this.txtCaseNo.Text))
             {
                 MessageBox.Show("请输入案号!","提示框",MessageBoxButtons.OK);
@@ -123,21 +124,48 @@ namespace wispro.sp.winClient
                 fristReturn_Finally = new CompareDocx();
                 fristReturn_Finally.Compare(firstReFile, finallyFile);
             }
-            
-            if (!string.IsNullOrEmpty(retObj1.finallyFile))
-                File.Delete(retObj1.finallyFile);
+            try
+            {
+                if (!string.IsNullOrEmpty(retObj1.finallyFile))
+                    File.Delete(retObj1.finallyFile);
+            }
+            catch { }
 
-            if (!string.IsNullOrEmpty(retObj1.draftFile))
-                File.Delete(retObj1.draftFile);
+            try
+            {
+                if (!string.IsNullOrEmpty(retObj1.draftFile))
+                    File.Delete(retObj1.draftFile);
+            }
+            catch { }
 
-            if (!string.IsNullOrEmpty(retObj1.draftFile))
-                File.Delete(retObj1.firstReturnFile);
+            try
+            {
+                if (!string.IsNullOrEmpty(retObj1.draftFile))
+                    File.Delete(retObj1.firstReturnFile);
+            }
+            catch { }
 
             if (Directory.Exists($"c:\\temp\\{retObj1.CaseNo}"))
             {
                 Directory.Delete($"c:\\temp\\{retObj1.CaseNo}", true);
             }
 
+            lblMsg.Text = string.Empty;
+            if (string.IsNullOrEmpty(draftFile))
+            {
+                lblMsg.Text = "初稿文件没有找到";
+            }
+
+            if (string.IsNullOrEmpty(firstReFile))
+            {
+                lblMsg.Text = $"{lblMsg.Text},第一次返稿文件没有找到!";
+            }
+
+            if (string.IsNullOrEmpty(finallyFile))
+            {
+                lblMsg.Text = $"{lblMsg.Text},定稿文件没有找到!";
+            }
+
             comboBox1.SelectedIndex = 0;
 
         }
@@ -185,6 +213,7 @@ namespace wispro.sp.winClient
                         {
                             strHtml =  $"<p>初稿与第一次返稿比较结果:</p><p>初稿文件字数:{draft_fristReturn.oldDocumentCount}</p><p>删除文字数量:{draft_fristReturn.DeleteCount}</p><p>插入文字数量:{draft_fristReturn.InsertCount}</p><p>修改比率:{(draft_fristReturn.diffRate * 100).ToString("0.0000")}%</p>";
                         }
+
                         
                         if(fristReturn_Finally != null)
                         {