Pārlūkot izejas kodu

将文档切分成权利要求、摘要、说明书,并在比较文档时计算权利要求、摘要、说明书和文档所有文字比对结果

luocaiyang 11 mēneši atpakaļ
vecāks
revīzija
bbe2a859f7

+ 248 - 215
wispro.sp.utility/CompareDocx.cs

@@ -16,95 +16,257 @@ namespace wispro.sp.utility
     /// </summary>
     public class CompareDocx
     {
-        /// <summary>
-        /// 原文档路径
-        /// </summary>
-        public string oldDocument { get; set; }
+        public class PatentDocument
+        {
+            public string FilePath {  get; set; }
 
-        /// <summary>
-        /// 修订后文档路径
-        /// </summary>
-        public string newDocument { get; set; }
+            public string Abstract { get; set; }
 
-        /// <summary>
-        /// 总的修改比率
-        /// </summary>
-        public double diffRate
-        {
-            get
+            public string Claim { get; set; }
+
+            public string FullText { get; set; }
+
+            public string DocumentString { get; set; }
+
+            public PatentDocument(string filePath) { 
+                this.FilePath = filePath;
+
+                if (!System.IO.File.Exists(this.FilePath) )
+                {
+                    throw new ApplicationException("指定的文件不存在!");
+                }
+                
+                if (this.FilePath.EndsWith(".doc"))
+                {
+                    DocumentString = GetDocTxt(this.FilePath);
+                }
+                else
+                {
+                    DocumentString = GetDocxTxt(this.FilePath);
+                }
+            }
+
+            private string GetDocTxt(string filePath)
             {
-                return ((double)_DeleteCount + (double)_InsertCount) / (double)_oldDocCount;
+                Application word = null;
+                Document doc = null;
+                string content = string.Empty;
+
+                try
+                {
+                    // 创建Word应用实例
+                    word = new Application();
+                    // 打开Word文档
+                    System.IO.FileInfo fileInfo = new System.IO.FileInfo(filePath);
+                    doc = word.Documents.Open(fileInfo.FullName);
+                    // 读取文档内容
+                    content = doc.Content.Text;
+
+                    List<string> lines = content.Split("\r").ToList();
+                    return List2String(lines);
+
+                }
+                catch (Exception ex)
+                {
+                    throw new Exception($"读取Word文档时发生错误: {ex.Message}");
+                }
+                finally
+                {
+                    // 关闭文档
+                    if (doc != null)
+                    {
+                        doc.Close();
+#pragma warning disable CA1416 // 验证平台兼容性
+                        System.Runtime.InteropServices.Marshal.ReleaseComObject(doc);
+#pragma warning restore CA1416 // 验证平台兼容性
+                    }
+                    // 退出Word应用
+                    if (word != null)
+                    {
+                        word.Quit();
+#pragma warning disable CA1416 // 验证平台兼容性
+                        System.Runtime.InteropServices.Marshal.ReleaseComObject(word);
+#pragma warning restore CA1416 // 验证平台兼容性
+                    }
+                }
+
+
             }
-        }
 
-        private int _oldDocCount;
-        /// <summary>
-        /// 原文档字数
-        /// </summary>
-        public int oldDocumentCount
-        {
-            get { return _oldDocCount; }
-        }
+            private string GetDocxTxt(string filepath)
+            {
+                var oldtext = getDocxMainXml(filepath);
+                var oldlines = ExtractWPTextFromXml(oldtext);
+                oldtext = List2String(oldlines);
 
-        private int _newDocCount;
-        /// <summary>
-        /// 修订后文档字数
-        /// </summary>
-        public int newDocumentCount
-        {
-            get { return _newDocCount; }
-        }
+                return oldtext;
+            }
 
-        private int _DeleteCount;
-        /// <summary>
-        /// 修订后文档相比原文档删除的字数
-        /// </summary>
-        public int DeleteCount
-        {
-            get
+            private string List2String(List<string> lines)
             {
-                return _DeleteCount;
+                string[] array = { "权   利   要   求   书", "说   明   书   摘   要", "说    明    书" , "摘   要   附   图", "说   明   书   附   图" };
+
+                StringBuilder sb = new StringBuilder();
+                string lastBlock = string.Empty;
+                foreach (var line in lines)
+                {
+                    if (!string.IsNullOrEmpty(line))
+                    {
+                        sb.Append(line.Trim() + "\r\n");
+
+                        if(Array.Exists(array, element => element == line.Trim()))
+                        {
+                            lastBlock = line.Trim();
+                        }
+                        else
+                        {
+                            switch(lastBlock) {
+                                case "权   利   要   求   书":
+                                    this.Claim = this.Claim + "\r\n" + line;
+                                    break;
+                                case "说   明   书   摘   要":
+                                    this.Abstract = this.Abstract + "\r\n" + line;
+                                    break;
+                                case "说    明    书":
+                                    this.FullText = this.FullText + "\r\n" + line;
+                                    break;
+
+                            }
+                        }
+                    }
+                }
+
+                this.Abstract = string.IsNullOrEmpty(this.Abstract)?string.Empty: this.Abstract.Trim();
+                this.Claim = string.IsNullOrEmpty(this.Claim) ? string.Empty : this.Claim.Trim();
+                this.FullText = string.IsNullOrEmpty(this.FullText) ? string.Empty : this.FullText.Trim();
+
+                return sb.ToString();
             }
-        }
 
-        private int _InsertCount;
+            private string getDocxMainXml(string filePath)
+            {
+                string text = string.Empty;
+                using (Package package = Package.Open(filePath, FileMode.Open))
+                {
+                    var Parts = package.GetParts();
+
+                    foreach (var part in Parts)
+                    {
+                        if (part.ContentType.StartsWith("application/vnd.openxmlformats-officedocument.wordprocessingml.document.main"))
+                        {
+                            using (Stream stream = part.GetStream())
+                            {
+                                StreamReader reader = new StreamReader(stream);
+                                text = reader.ReadToEnd();
+                                break;
+                            }
+                        }
+                    }
 
-        /// <summary>
-        /// 修改后文档相比原文档插入的字数
-        /// </summary>
-        public int InsertCount
-        {
-            get
+                    return text;
+                }
+            }
+
+            private List<string> ExtractWPTextFromXml(string xmlText)
             {
-                return _InsertCount;
+                List<string> lines = new List<string>();
+                // 使用正则表达式匹配 <w:t> 标签的内容
+                MatchCollection matches = Regex.Matches(xmlText, "(<w:p\\s.*?>|<w:p>)(.*?)</w:p>");
+
+                foreach (Match match in matches)
+                {
+                    lines.Add(ExtractWtTextFromXml(match.Groups[2].Value));
+                }
+                return lines;
+            }
+
+            private string ExtractWtTextFromXml(string xmlText)
+            {
+                // 使用正则表达式匹配 <w:t> 标签的内容
+                MatchCollection matches = Regex.Matches(xmlText, "(<w:t\\s.*?>|<w:t>)(.*?)</w:t>");
+                StringBuilder sb = new StringBuilder();
+                foreach (Match match in matches)
+                {
+                    sb.Append(match.Groups[2].Value);
+                }
+                return sb.ToString();
             }
         }
 
-        private double _EditCount;
-        /// <summary>
-        /// 修订处数量
-        /// </summary>
-        public double EditCount
+        public class StringCompareResult
         {
-            get
+            /// <summary>
+            /// 源字符串字数
+            /// </summary>
+            public int oldWordCount { get; set;}
+
+            /// <summary>
+            /// 新字符串字数
+            /// </summary>
+            public int newWordCount { get; set;}
+
+            
+            /// <summary>
+            /// 修订后文档相比原文档删除的字数
+            /// </summary>
+            public int DeleteCount { get; set; }
+
+            /// <summary>
+            /// 修改后文档相比原文档插入的字数
+            /// </summary>
+            public int InsertCount {  get; set; }
+           
+            /// <summary>
+            /// 修订处数量
+            /// </summary>
+            public double EditCount{ get;set; }
+
+            /// <summary>
+            /// 包括修订文字版本的文档
+            /// </summary>
+            public string CompareResultString { get; set; }
+
+            /// <summary>
+            /// 总的修改比率
+            /// </summary>
+            public double diffRate
             {
-                return _EditCount;
+                get
+                {
+                    return ((double)DeleteCount + (double)InsertCount) / (double)oldWordCount;
+                }
             }
+
         }
+        /// <summary>
+        /// 原文档路径
+        /// </summary>
+        public PatentDocument oldDocument { get; set; }
+
+        /// <summary>
+        /// 修订后文档路径
+        /// </summary>
+        public PatentDocument newDocument { get; set; }
 
+        /// <summary>
+        /// 权力要求比较结果
+        /// </summary>
+        public StringCompareResult ClaimResult { get; set; }
 
+        /// <summary>
+        /// 摘要比较结果
+        /// </summary>
+        public StringCompareResult AbstractResult { get; set; }
 
-        private string _CompareResultString;
         /// <summary>
-        /// 包括修订文字版本的文档
+        /// 说明书比较结果
         /// </summary>
-        public string CompareResultString
-        {
-            get
-            {
-                return _CompareResultString;
-            }
-        }
+        public StringCompareResult FulltextResult { get; set; }
+
+        /// <summary>
+        /// 所有文字比较结果
+        /// </summary>
+        public StringCompareResult AllStringResult { get; set; }
 
         /// <summary>
         /// 比较两个文档
@@ -113,60 +275,44 @@ namespace wispro.sp.utility
         /// <param name="newFile"></param>
         public void Compare(string oldFile, string newFile)
         {
-            this.oldDocument = oldFile;
-            this.newDocument = newFile;
+            this.oldDocument =new PatentDocument(oldFile);
+            this.newDocument =new PatentDocument(newFile);
+
+            this.ClaimResult = StringCompare(this.oldDocument.Claim,this.newDocument.Claim);
+            this.AbstractResult = StringCompare(this.oldDocument.Abstract, this.newDocument.Abstract);
+            this.FulltextResult = StringCompare(this.oldDocument.FullText, this.newDocument.FullText);
+            this.AllStringResult = StringCompare(this.oldDocument.DocumentString, this.newDocument.DocumentString);
 
-            Compare();
         }
 
         /// <summary>
         /// 比较两个文档
         /// </summary>
         /// <exception cref="ApplicationException"></exception>
-        public void Compare()
+        public StringCompareResult StringCompare(string oldtext,string newtext)
         {
-            if (!System.IO.File.Exists(this.oldDocument) || !System.IO.File.Exists(this.newDocument))
-            {
-                throw new ApplicationException("指定的文件不存在!");
-            }
-
+            StringCompareResult result = new StringCompareResult();
             var differ = new Differ();
-            string oldtext = "";
-            if (this.oldDocument.EndsWith(".doc"))
-            {
-                oldtext = GetDocTxt(this.oldDocument);
-            }
-            else
-            {
-                oldtext = GetDocxTxt(this.oldDocument);
-            }
 
-            _oldDocCount = oldtext.Length;
-
-            string newtext = "";
-            if (this.newDocument.EndsWith(".doc"))
-            {
-                newtext = GetDocTxt(this.newDocument);
-            }
-            else
-            {
-                newtext = GetDocxTxt(this.newDocument);
-            }
-            _newDocCount = newtext.Length;
+            if(oldtext == null) { oldtext = ""; }
+            if(newtext == null) { newtext = ""; }
 
+            result.oldWordCount = oldtext.Length;
+            result.newWordCount = newtext.Length;
+            
             var diff = differ.CreateCharacterDiffs(oldtext, newtext, true);
-            _EditCount = diff.DiffBlocks.Count;
+            result.EditCount = diff.DiffBlocks.Count;
 
             int iDeff = 0;
             int lastPos = 0;
 
-            _CompareResultString = "<p>";
+            string _CompareResultString = "";
             string lastResult = "";
             foreach (var change in diff.DiffBlocks)
             {
                 iDeff += change.DeleteCountA + change.InsertCountB;
-                _DeleteCount += change.DeleteCountA;
-                _InsertCount += change.InsertCountB;
+                result.DeleteCount += change.DeleteCountA;
+                result.InsertCount += change.InsertCountB;
 
                 lastResult += oldtext.Substring(lastPos, change.DeleteStartA - lastPos);
                 _CompareResultString += oldtext.Substring(lastPos, change.DeleteStartA - lastPos);
@@ -188,126 +334,13 @@ namespace wispro.sp.utility
             lastResult += oldtext.Substring(lastPos);
             _CompareResultString += oldtext.Substring(lastPos);
             _CompareResultString = _CompareResultString.Replace("\r\n", "<br/>");
-            
-        }
-
-        private string GetDocTxt(string filePath)
-        {
-            Application word = null;
-            Document doc = null;
-            string content = string.Empty;
-
-            try
-            {
-                // 创建Word应用实例
-                word = new Application();
-                // 打开Word文档
-                System.IO.FileInfo fileInfo = new System.IO.FileInfo(filePath);
-                doc = word.Documents.Open(fileInfo.FullName);
-                // 读取文档内容
-                content = doc.Content.Text;
-
-                List<string> lines = content.Split("\r").ToList();
-                return List2String(lines);
 
-            }
-            catch (Exception ex)
-            {
-                throw new Exception($"读取Word文档时发生错误: {ex.Message}");
-            }
-            finally
-            {
-                // 关闭文档
-                if (doc != null)
-                {
-                    doc.Close();
-                    #pragma warning disable CA1416 // 验证平台兼容性
-                    System.Runtime.InteropServices.Marshal.ReleaseComObject(doc);
-                    #pragma warning restore CA1416 // 验证平台兼容性
-                }
-                // 退出Word应用
-                if (word != null)
-                {
-                    word.Quit();
-                    #pragma warning disable CA1416 // 验证平台兼容性
-                    System.Runtime.InteropServices.Marshal.ReleaseComObject(word);
-                    #pragma warning restore CA1416 // 验证平台兼容性
-                }
-            }
-
-
-        }
-
-        private string GetDocxTxt(string filepath)
-        {
-            var oldtext = getDocxMainXml(filepath);
-            var oldlines = ExtractWPTextFromXml(oldtext);
-            oldtext = List2String(oldlines);
-
-            return oldtext;
-        }
-
-        private string List2String(List<string> lines)
-        {
-            StringBuilder sb = new StringBuilder();
-            foreach (var line in lines)
-            {
-                if (!string.IsNullOrEmpty(line))
-                {
-                    sb.Append(line.Trim() + "\r\n");
-                }
-            }
+            result.CompareResultString = _CompareResultString;
 
-            return sb.ToString();
-        }
-
-        private string getDocxMainXml(string filePath)
-        {
-            string text = string.Empty;
-            using (Package package = Package.Open(filePath, FileMode.Open))
-            {
-                var Parts = package.GetParts();
-
-                foreach (var part in Parts)
-                {
-                    if (part.ContentType.StartsWith("application/vnd.openxmlformats-officedocument.wordprocessingml.document.main"))
-                    {
-                        using (Stream stream = part.GetStream())
-                        {
-                            StreamReader reader = new StreamReader(stream);
-                            text = reader.ReadToEnd();
-                            break;
-                        }
-                    }
-                }
+            return result;
 
-                return text;
-            }
         }
 
-        private List<string> ExtractWPTextFromXml(string xmlText)
-        {
-            List<string> lines = new List<string>();
-            // 使用正则表达式匹配 <w:t> 标签的内容
-            MatchCollection matches = Regex.Matches(xmlText, "(<w:p\\s.*?>|<w:p>)(.*?)</w:p>");
-
-            foreach (Match match in matches)
-            {
-                lines.Add(ExtractWtTextFromXml(match.Groups[2].Value));
-            }
-            return lines;
-        }
-
-        private string ExtractWtTextFromXml(string xmlText)
-        {
-            // 使用正则表达式匹配 <w:t> 标签的内容
-            MatchCollection matches = Regex.Matches(xmlText, "(<w:t\\s.*?>|<w:t>)(.*?)</w:t>");
-            StringBuilder sb = new StringBuilder();
-            foreach (Match match in matches)
-            {
-                sb.Append(match.Groups[2].Value);
-            }
-            return sb.ToString();
-        }
+        
     }
 }

+ 22 - 15
wispro.sp.utility/IPEasyUtility.cs

@@ -7,6 +7,7 @@ using System.Dynamic;
 using System.IO;
 using System.Linq;
 using System.Threading;
+using System.Xml.Linq;
 using NPOI.HPSF;
 using OpenQA.Selenium;
 using OpenQA.Selenium.Chrome;
@@ -192,7 +193,7 @@ namespace wispro.sp.utility
             {
                 try
                 {
-                    WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(50));
+                    WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(5));
                     
                     Login(driver, wait);
 
@@ -309,6 +310,7 @@ namespace wispro.sp.utility
                     //定稿日
                     retObject.FinalizationDate = waitGetElementById(wait, "p_proc_info__finish_doc_date").GetAttribute("value");
 
+                    //点击附件信息Tab
                     var lifile = driver.FindElement(By.Id("lifile"));
                     driver.ExecuteJavaScript("arguments[0].click();", lifile);
 
@@ -354,10 +356,12 @@ namespace wispro.sp.utility
 
         private static void Download(dynamic retObject, IWebDriver driver, WebDriverWait wait, IWebElement table_filelist, string fileType)
         {
+            var tBody = waitGetElementByTagName(wait, "tbody", table_filelist);
+
             var finallyFile = wait.Until((d) =>
             {
                 try { 
-                    return table_filelist.FindElement(By.XPath($"//td[@colname='file_desc'][normalize-space()='{fileType}']"));
+                    return tBody.FindElement(By.XPath($".//td[@colname='file_desc'][normalize-space()='{fileType}']"));
                 }
                 catch 
                 {
@@ -365,6 +369,8 @@ namespace wispro.sp.utility
                 }
             });
 
+            
+
             if(finallyFile == null)
             {
                 switch (fileType)
@@ -393,15 +399,16 @@ namespace wispro.sp.utility
                 {
                     return null;
                 }
-            }); 
+            });
 
             string fileName = tdfileName.Text;
+
             while (string.IsNullOrEmpty(fileName))
             {
                 System.Threading.Thread.Sleep(100);
-                fileName = tdfileName.Text;
+                fileName = tdfileName.Text; 
             }
-            
+
             string filePath = System.IO.Path.Combine(strFileSavePath, fileName);
             if (System.IO.File.Exists(filePath))
             {
@@ -450,7 +457,7 @@ namespace wispro.sp.utility
             {
                 try
                 {
-                    WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(50));
+                    WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
                     
                     Login(driver, wait);
 
@@ -541,7 +548,7 @@ namespace wispro.sp.utility
                 try
                 {
 
-                    WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(20));
+                    WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
 
                     
                     Login(driver, wait);
@@ -681,7 +688,7 @@ namespace wispro.sp.utility
                     var frameDownload = waitGetElementByName(wait,"DownloadList");
                     driver.SwitchTo().Frame(frameDownload);
                     var firstTr = waitGetElementByTagName(wait,"tr");
-                    var tdStatus = firstTr.FindElement(By.XPath("//td")).FindElement(By.XPath("following-sibling::td[4]"));
+                    var tdStatus = firstTr.FindElement(By.XPath(".//td")).FindElement(By.XPath("following-sibling::td[4]"));
                     string strStatus = tdStatus.Text;
                     while (strStatus.Trim() != "导出成功!")
                     {
@@ -692,13 +699,13 @@ namespace wispro.sp.utility
 
                         System.Threading.Thread.Sleep(5000);
                         firstTr = waitGetElementByTagName(wait, "tr");
-                        tdStatus = firstTr.FindElement(By.XPath("//td")).FindElement(By.XPath("following-sibling::td[4]"));
+                        tdStatus = firstTr.FindElement(By.XPath(".//td")).FindElement(By.XPath("following-sibling::td[4]"));
                         strStatus = tdStatus.Text;
                     }
 
                     Log($"{DateTime.Now}\t点击下载按钮下载文档");
                     firstTr = waitGetElementByTagName(wait, "tr");
-                    firstTr.FindElement(By.XPath("//td/a[@title='下载']")).Click();
+                    firstTr.FindElement(By.XPath(".//td/a[@title='下载']")).Click();
                     //System.Threading.Thread.Sleep(5000);
                     //btnDownload.Click();
                     
@@ -709,7 +716,7 @@ namespace wispro.sp.utility
                     Log($"{DateTime.Now}\t删除下载记录");
                     firstTr = waitGetElementByTagName(wait, "tr");// driver.FindElement(By.TagName("tr"));
 
-                    firstTr.FindElement(By.XPath("//td/a[@title='删除']")).Click();
+                    firstTr.FindElement(By.XPath(".//td/a[@title='删除']")).Click();
 
                     //System.IO.FileInfo file = new System.IO.FileInfo(strFilePath.Replace("~", "_"));
                     retDatatable = NPOIExcel.ExcelToDataTable(strFilePath.Replace("~", "_"), true);
@@ -751,7 +758,7 @@ namespace wispro.sp.utility
             {
                 try
                 {
-                    WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(20));
+                    WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
                     
                     Login(driver, wait);
 
@@ -836,7 +843,7 @@ namespace wispro.sp.utility
                 {
                     try
                     {
-                        WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(20));
+                        WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
                         
                         Login(driver,wait);
 
@@ -1036,7 +1043,7 @@ namespace wispro.sp.utility
                 {
                     try
                     {
-                        WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(20));
+                        WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
 
                         Login(driver, wait);
 
@@ -1207,7 +1214,7 @@ namespace wispro.sp.utility
                 {
                     try
                     {
-                        WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(20));
+                        WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
 
                         Login(driver, wait);
 

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 3 - 3
wispro.sp.winClient/frmCaseFileCompare.Designer.cs


+ 90 - 6
wispro.sp.winClient/frmCaseFileCompare.cs

@@ -205,19 +205,18 @@ namespace wispro.sp.winClient
             {
                 richTextBox1.Clear();
 
+                string strHtml = string.Empty;
                 switch (comboBox1.SelectedIndex)
                 {
                     case 0:
-                        string strHtml = string.Empty;
                         if(draft_fristReturn != null)
                         {
-                            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>";
+                            strHtml =  $"<b>所有文字比较:</b><br/><p>初稿与第一次返稿比较结果:</p><p>初稿文件字数:{draft_fristReturn.AllStringResult.oldWordCount}</p><p>删除文字数量:{draft_fristReturn.AllStringResult.DeleteCount}</p><p>插入文字数量:{draft_fristReturn.AllStringResult.InsertCount}</p><p>修改比率:{(draft_fristReturn.AllStringResult.diffRate * 100).ToString("0.0000")}%</p>";
                         }
-
                         
                         if(fristReturn_Finally != null)
                         {
-                            strHtml = strHtml + $"<p></p><p>第一次返稿与定稿比较结果:</p><p>第一次返稿文件字数:{fristReturn_Finally.oldDocumentCount}</p><p>删除文字数量:{fristReturn_Finally.DeleteCount}</p><p>插入文字数量:{fristReturn_Finally.InsertCount}</p><p>修改比率:{(fristReturn_Finally.diffRate * 100).ToString("0.0000")}%</p>";
+                            strHtml = strHtml + $"<p></p><p>第一次返稿与定稿比较结果:</p><p>第一次返稿文件字数:{fristReturn_Finally.AllStringResult.oldWordCount}</p><p>删除文字数量:{fristReturn_Finally.AllStringResult.DeleteCount}</p><p>插入文字数量:{fristReturn_Finally.AllStringResult.InsertCount}</p><p>修改比率:{(fristReturn_Finally.AllStringResult.diffRate * 100).ToString("0.0000")}%</p>";
                         }
 
 
@@ -227,16 +226,101 @@ namespace wispro.sp.winClient
                     case 1:
                         if (draft_fristReturn != null)
                         {
-                            richTextBox1.Rtf = new HtmlToRtfConverter().ConvertHtmlToRtf(draft_fristReturn.CompareResultString);
+                            richTextBox1.Rtf = new HtmlToRtfConverter().ConvertHtmlToRtf(draft_fristReturn.AllStringResult.CompareResultString);
                         }
                         
                         break;
                     case 2:
                         if(fristReturn_Finally!= null)
                         {
-                            richTextBox1.Rtf = new HtmlToRtfConverter().ConvertHtmlToRtf(fristReturn_Finally.CompareResultString);
+                            richTextBox1.Rtf = new HtmlToRtfConverter().ConvertHtmlToRtf(fristReturn_Finally.AllStringResult.CompareResultString);
+                        }
+                        break;
+                    case 3:
+                        
+                        if (draft_fristReturn != null)
+                        {
+                            strHtml = $"<b>摘要比较:</b><br/><p>初稿与第一次返稿比较结果:</p><p>初稿文件字数:{draft_fristReturn.AbstractResult.oldWordCount}</p><p>删除文字数量:{draft_fristReturn.AbstractResult.DeleteCount}</p><p>插入文字数量:{draft_fristReturn.AbstractResult.InsertCount}</p><p>修改比率:{(draft_fristReturn.AbstractResult.diffRate * 100).ToString("0.0000")}%</p>";
+                        }
+
+                        if (fristReturn_Finally != null)
+                        {
+                            strHtml = strHtml + $"<p></p><p>第一次返稿与定稿比较结果:</p><p>第一次返稿文件字数:{fristReturn_Finally.AbstractResult.oldWordCount}</p><p>删除文字数量:{fristReturn_Finally.AbstractResult.DeleteCount}</p><p>插入文字数量:{fristReturn_Finally.AbstractResult.InsertCount}</p><p>修改比率:{(fristReturn_Finally.AbstractResult.diffRate * 100).ToString("0.0000")}%</p>";
+                        }
+
+                        richTextBox1.Rtf = new HtmlToRtfConverter().ConvertHtmlToRtf(strHtml);
+
+                        break;
+                    case 4:
+                        if (draft_fristReturn != null)
+                        {
+                            richTextBox1.Rtf = new HtmlToRtfConverter().ConvertHtmlToRtf(draft_fristReturn.AbstractResult.CompareResultString);
+                        }
+
+                        break;
+                    case 5:
+                        if (fristReturn_Finally != null)
+                        {
+                            richTextBox1.Rtf = new HtmlToRtfConverter().ConvertHtmlToRtf(fristReturn_Finally.AbstractResult.CompareResultString);
                         }
                         break;
+                    case 6:
+
+                        if (draft_fristReturn != null)
+                        {
+                            strHtml = $"<b>权力要求比较:</b><br/><p>初稿与第一次返稿比较结果:</p><p>初稿文件字数:{draft_fristReturn.ClaimResult.oldWordCount}</p><p>删除文字数量:{draft_fristReturn.ClaimResult.DeleteCount}</p><p>插入文字数量:{draft_fristReturn.ClaimResult.InsertCount}</p><p>修改比率:{(draft_fristReturn.ClaimResult.diffRate * 100).ToString("0.0000")}%</p>";
+                        }
+
+                        if (fristReturn_Finally != null)
+                        {
+                            strHtml = strHtml + $"<p></p><p>第一次返稿与定稿比较结果:</p><p>第一次返稿文件字数:{fristReturn_Finally.ClaimResult.oldWordCount}</p><p>删除文字数量:{fristReturn_Finally.ClaimResult.DeleteCount}</p><p>插入文字数量:{fristReturn_Finally.ClaimResult.InsertCount}</p><p>修改比率:{(fristReturn_Finally.ClaimResult.diffRate * 100).ToString("0.0000")}%</p>";
+                        }
+
+                        richTextBox1.Rtf = new HtmlToRtfConverter().ConvertHtmlToRtf(strHtml);
+
+                        break;
+                    case 7:
+                        if (draft_fristReturn != null)
+                        {
+                            richTextBox1.Rtf = new HtmlToRtfConverter().ConvertHtmlToRtf(draft_fristReturn.ClaimResult.CompareResultString);
+                        }
+
+                        break;
+                    case 8:
+                        if (fristReturn_Finally != null)
+                        {
+                            richTextBox1.Rtf = new HtmlToRtfConverter().ConvertHtmlToRtf(fristReturn_Finally.ClaimResult.CompareResultString);
+                        }
+                        break;
+                    case 9:
+
+                        if (draft_fristReturn != null)
+                        {
+                            strHtml = $"<b>说明书比较:</b><br/><p>初稿与第一次返稿比较结果:</p><p>初稿文件字数:{draft_fristReturn.FulltextResult.oldWordCount}</p><p>删除文字数量:{draft_fristReturn.FulltextResult.DeleteCount}</p><p>插入文字数量:{draft_fristReturn.FulltextResult.InsertCount}</p><p>修改比率:{(draft_fristReturn.FulltextResult.diffRate * 100).ToString("0.0000")}%</p>";
+                        }
+
+                        if (fristReturn_Finally != null)
+                        {
+                            strHtml = strHtml + $"<p></p><p>第一次返稿与定稿比较结果:</p><p>第一次返稿文件字数:{fristReturn_Finally.FulltextResult.oldWordCount}</p><p>删除文字数量:{fristReturn_Finally.FulltextResult.DeleteCount}</p><p>插入文字数量:{fristReturn_Finally.FulltextResult.InsertCount}</p><p>修改比率:{(fristReturn_Finally.FulltextResult.diffRate * 100).ToString("0.0000")}%</p>";
+                        }
+
+                        richTextBox1.Rtf = new HtmlToRtfConverter().ConvertHtmlToRtf(strHtml);
+
+                        break;
+                    case 10:
+                        if (draft_fristReturn != null)
+                        {
+                            richTextBox1.Rtf = new HtmlToRtfConverter().ConvertHtmlToRtf(draft_fristReturn.FulltextResult.CompareResultString);
+                        }
+
+                        break;
+                    case 11:
+                        if (fristReturn_Finally != null)
+                        {
+                            richTextBox1.Rtf = new HtmlToRtfConverter().ConvertHtmlToRtf(fristReturn_Finally.FulltextResult.CompareResultString);
+                        }
+                        break;
+
                 }
             }
         }