Prechádzať zdrojové kódy

添加申请文件比较模块,包括查看清单、从维德系统下载并比较和保存等功能

luocaiyang 10 mesiacov pred
rodič
commit
ec998b4015

+ 1 - 1
StaffPerformance.sln

@@ -17,7 +17,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "wispro.sp.ipeasyApi", "wisp
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UpdateUserDepartment", "UpdateUserDepartment\UpdateUserDepartment.csproj", "{B175539F-0311-430D-A4C5-8E751A76C898}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wispro.sp.winClient", "wispro.sp.winClient\wispro.sp.winClient.csproj", "{136BF7B5-3433-49CB-960E-48CCF182A177}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "wispro.sp.winClient", "wispro.sp.winClient\wispro.sp.winClient.csproj", "{136BF7B5-3433-49CB-960E-48CCF182A177}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution

+ 292 - 0
wispro.sp.api/Controllers/CaseFileCompareController.cs

@@ -0,0 +1,292 @@
+using DocumentFormat.OpenXml.InkML;
+using DynamicExpresso;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Linq.Expressions;
+using wispro.sp.api.Services;
+using wispro.sp.entity;
+using wispro.sp.entity.CompareCase;
+using wispro.sp.share;
+
+namespace wispro.sp.api.Controllers
+{
+    [Route("api/[controller]/[action]")]
+    [ApiController]
+    public class CaseFileCompareController : ControllerBase
+    {
+        spDbContext Context;
+        IFileTaskService fileTaskService;
+
+
+        public CaseFileCompareController(spDbContext context, IFileTaskService _fileTaskService)
+        {
+            Context = context;
+            fileTaskService = _fileTaskService;
+
+        }
+        [Authorize]
+        public ApiSaveResponse Save(CaseInfo caseInfo)
+        {
+            ApiSaveResponse ret = new ApiSaveResponse();
+            ret.Success = true;
+
+            using (Context.Database.BeginTransaction())
+            {
+                try
+                {
+                    #region 客户处理
+                    if (caseInfo.Customer != null && !string.IsNullOrEmpty(caseInfo.Customer.Name))
+                    {
+                        var temCustomer = Context.Customers.Where<Customer>(c => c.Name == caseInfo.Customer.Name).FirstOrDefault();
+
+                        if (temCustomer == null)
+                        {
+                            temCustomer = new Customer() { Name = caseInfo.Customer.Name };
+                            //item.Customer.Id = 0;
+
+                            Context.Customers.Add(temCustomer);
+                            Context.SaveChanges();
+                            caseInfo.Customer = temCustomer;
+                            //item.CustomerId = item.Customer.Id;
+                        }
+                        else
+                        {
+                            caseInfo.Customer = temCustomer;
+                        }
+
+                        caseInfo.CustomerId = caseInfo.Customer.Id;
+                        caseInfo.Customer = null;
+                    }
+                    else
+                    {
+                        caseInfo.Customer = null;
+                    }
+                    #endregion
+
+                    #region 审核人
+                    if (caseInfo.Reviewer != null && !string.IsNullOrEmpty(caseInfo.Reviewer.Name))
+                    {
+                        var temReviewer = Context.Staffs.Where<Staff>(c => c.Name == caseInfo.Reviewer.Name).FirstOrDefault();
+
+                        if (temReviewer == null)
+                        {
+                            temReviewer = new Staff() { Name = caseInfo.Reviewer.Name };
+                            //item.Customer.Id = 0;
+
+                            Context.Staffs.Add(temReviewer);
+                            Context.SaveChanges();
+                            caseInfo.Reviewer = temReviewer;
+                            //item.CustomerId = item.Customer.Id;
+                        }
+                        else
+                        {
+                            caseInfo.Reviewer = temReviewer;
+                        }
+
+                        caseInfo.ReviewerId = caseInfo.Reviewer.Id;
+                        caseInfo.Reviewer = null;
+                    }
+                    else
+                    {
+                        caseInfo.Reviewer = null;
+                    }
+                    #endregion
+
+                    if (caseInfo.DRRAbstract != null) {
+                        Context.CaseCompareResults.Add(caseInfo.DRRAbstract);
+                        Context.SaveChanges();
+                        caseInfo.DRRAbstractId = caseInfo.DRRAbstract.Id;
+                        caseInfo.DRRAbstract = null;
+                    }
+                    if (caseInfo.DRRCalim != null)
+                    {
+                        Context.CaseCompareResults.Add(caseInfo.DRRCalim);
+                        Context.SaveChanges();
+                        caseInfo.DRRCalimId = caseInfo.DRRCalim.Id;
+                        caseInfo.DRRCalim = null;
+                    }
+                    if (caseInfo.DRRFulltext != null)
+                    {
+                        Context.CaseCompareResults.Add(caseInfo.DRRFulltext);
+                        Context.SaveChanges();
+                        caseInfo.DRRFulltextId = caseInfo.DRRFulltext.Id;
+                        caseInfo.DRRFulltext = null;
+                    }
+                    if (caseInfo.DRRAll != null)
+                    {
+                        Context.CaseCompareResults.Add(caseInfo.DRRAll);
+                        Context.SaveChanges();
+                        caseInfo.DRRAllId = caseInfo.DRRAll.Id;
+                        caseInfo.DRRAll = null;
+
+                    }
+                    if (caseInfo.RFRAbstract != null)
+                    {
+                        Context.CaseCompareResults.Add(caseInfo.RFRAbstract);
+                        Context.SaveChanges();
+                        caseInfo.RFRAbstractId = caseInfo.RFRAbstract.Id;
+                        caseInfo.RFRAbstract = null;
+                    }
+                    if (caseInfo.RFRCalim != null)
+                    {
+                        Context.CaseCompareResults.Add(caseInfo.RFRCalim);
+                        Context.SaveChanges();
+                        caseInfo.RFRCalimId = caseInfo.RFRCalim.Id;
+                        caseInfo.RFRCalim = null;
+                    }
+                    if (caseInfo.RFRFulltext != null)
+                    {
+                        Context.CaseCompareResults.Add(caseInfo.RFRFulltext);
+                        Context.SaveChanges();
+                        caseInfo.RFRFulltextId = caseInfo.RFRFulltext.Id;
+                        caseInfo.RFRFulltext = null;
+                    }
+                    if (caseInfo.RFRAll != null)
+                    {
+                        Context.CaseCompareResults.Add(caseInfo.RFRAll);
+                        Context.SaveChanges();
+                        caseInfo.RFRAllId = caseInfo.RFRAll.Id;
+                        caseInfo.RFRAll = null;
+                    }
+
+                    Context.CaseInfos.Add(caseInfo);
+                    Context.SaveChanges();
+                    Context.Database.CommitTransaction();
+
+                }
+                catch (Exception ex)
+                {
+                    ret.Success = false;
+                    ret.ErrorMessage = ex.Message;
+                    Context.Database.RollbackTransaction();
+                }
+               
+            }
+
+            return ret;
+        }
+
+        public ListApiResponse<CaseInfo> QueryFilter(QueryFilter queryFilter)
+        {
+            ListApiResponse<CaseInfo> ret = new ListApiResponse<CaseInfo>();
+
+            IQueryable<CaseInfo> response = NewMethod(queryFilter);
+
+            int totals = response.Count();
+
+            if (totals > 0 && totals < (queryFilter.PageIndex) * queryFilter.PageSize)
+            {
+                response = response
+                     .Include(pi => pi.DRRCalim)
+                    .Include(pi => pi.DRRAbstract)
+                    .Include(pi => pi.DRRFulltext)
+                    .Include(pi => pi.DRRAll)
+                    .Include(pi => pi.RFRCalim)
+                    .Include(pi => pi.RFRAbstract)
+                    .Include(pi => pi.RFRFulltext)
+                    .Include(pi => pi.RFRAll)
+                    .Include(pi => pi.Customer)
+                    .Include(pi => pi.Reviewer)
+                    .OrderConditions<CaseInfo>(queryFilter.Sorts)
+                    .Skip((queryFilter.PageIndex - 1) * queryFilter.PageSize)
+                    .Take(totals - (queryFilter.PageIndex - 1) * queryFilter.PageSize);
+                //.Pager<PerformanceItem>(1, queryFilter.PageSize, out totals);
+            }
+            else
+            {
+                response = response
+                    .Include(pi => pi.DRRCalim)
+                    .Include(pi => pi.DRRAbstract)
+                    .Include(pi => pi.DRRFulltext)
+                    .Include(pi=>pi.DRRAll)
+                    .Include(pi => pi.RFRCalim)
+                    .Include(pi => pi.RFRAbstract)
+                    .Include(pi => pi.RFRFulltext)
+                    .Include(pi => pi.RFRAll)
+                    .Include(pi => pi.Customer)
+                    .Include(pi => pi.Reviewer)
+                    .OrderConditions<CaseInfo>(queryFilter.Sorts)
+                    .Skip((queryFilter.PageIndex - 1) * queryFilter.PageSize)
+                    .Take(queryFilter.PageSize);
+            }
+            ret.TotalCount = totals;
+
+            var retList = response.ToList<CaseInfo>();
+
+
+            #region 将某些属性设为null,避免循环取值造成返回json过大
+            foreach (CaseInfo item in retList)
+            {
+                item.Customer.PerformanceItems = null;
+                item.Customer.ResponseMan = null;
+                item.Reviewer.Customers = null;
+                item.Reviewer.ExternalHandlerItems = null;
+                item.Reviewer.ItemStaffs = null;
+                item.Reviewer.AllocationRatios = null;
+                item.Reviewer.ReviewerItems = null;
+            }
+            #endregion
+
+            ret.Results = retList.ToList();
+
+            return ret;
+        }
+
+        private string GetExpress(IList<FieldCondition> conditions)
+        {
+            string str = "";
+
+            foreach (var c in conditions)
+            {
+                if (string.IsNullOrEmpty(str))
+                {
+                    str = c.ToExpressString("s");
+                }
+                else
+                {
+                    if (c.LogicOperate == LogicEnum.And)
+                    {
+                        str = $"({str}) && {c.ToExpressString("s")}";
+                    }
+                    else
+                    {
+                        str = $"({str}) || {c.ToExpressString("s")}";
+                    }
+                }
+            }
+
+            return str;
+        }
+
+
+        private IQueryable<CaseInfo> NewMethod(QueryFilter queryFilter)
+        {
+            string strExpress = "";
+            
+            if (queryFilter.ConditionTree != null)
+            {
+                strExpress = GetExpress(queryFilter.ConditionTree);
+            }
+
+            var interpreter = new Interpreter();
+            if (string.IsNullOrEmpty(strExpress))
+            {
+                return new spDbContext().CaseInfos.Where<CaseInfo>(p=>(p.Id>0));
+            }
+            else
+            {
+                Expression<Func<CaseInfo, bool>> dynamicWhere = interpreter.ParseAsExpression<Func<CaseInfo, bool>>(strExpress, "s");
+
+                IQueryable<CaseInfo> response = new spDbContext().CaseInfos.Where<CaseInfo>(dynamicWhere);
+                return response;
+            }
+
+        }
+
+    }
+}

+ 67 - 0
wispro.sp.api/spDbContext.cs

@@ -7,6 +7,7 @@ using System.Collections.Generic;
 using System.Configuration;
 using System.Data;
 using wispro.sp.entity;
+using wispro.sp.entity.CompareCase;
 using wispro.sp.entity.workflowDefine;
 using wispro.sp.entity.workflowInstance;
 
@@ -66,6 +67,10 @@ namespace wispro.sp.api
 
         public virtual DbSet<AllocationRatio> AllocationRatios { get; set; }
 
+        public virtual DbSet<CaseInfo> CaseInfos { get; set; }
+
+        public virtual DbSet<CompareResult> CaseCompareResults { get; set; }
+
         #region 流程定义
         public virtual DbSet<Workflow> Workflows { get; set; }
 
@@ -713,6 +718,68 @@ namespace wispro.sp.api
                 }
                 );
 
+            #region 案件文档对比
+            modelBuilder.Entity<CaseInfo>(entity =>
+            {
+                entity.ToTable("CaseInfo");
+                //entity.HasKey( x => x.Id );
+                //entity.Property(e => e.CaseNo).HasMaxLength(50);
+                //entity.Property(e => e.CaseName).HasMaxLength(500);
+                //entity.Property(e => e.DraftDate).HasColumnType("date");
+                //entity.Property(e => e.ReturnDate).HasColumnType("date");
+                //entity.Property(e => e.FinalVersionDate).HasColumnType("date");
+
+                entity.HasOne(d => d.Customer)
+                    .WithMany()
+                    .HasForeignKey(d => d.CustomerId);
+
+                entity.HasOne(d => d.Reviewer)
+                    .WithMany()
+                    .HasForeignKey(d => d.ReviewerId);
+            
+
+                entity.HasOne(d => d.DRRAbstract)
+                    .WithMany()
+                    .HasForeignKey(d => d.DRRAbstractId);
+
+                entity.HasOne(d => d.DRRCalim)
+                    .WithMany()
+                    .HasForeignKey(d => d.DRRCalimId);
+
+                entity.HasOne(d => d.DRRFulltext)
+                    .WithMany()
+                    .HasForeignKey(d => d.DRRFulltextId);
+
+                entity.HasOne(d => d.DRRAll)
+                    .WithMany()
+                    .HasForeignKey(d => d.DRRAllId);
+
+                entity.HasOne(d => d.RFRAbstract)
+                    .WithMany()
+                    .HasForeignKey(d => d.RFRAbstractId);
+
+                entity.HasOne(d => d.RFRCalim)
+                    .WithMany()
+                    .HasForeignKey(d => d.RFRCalimId);
+
+                entity.HasOne(d => d.RFRFulltext)
+                    .WithMany()
+                    .HasForeignKey(d => d.RFRFulltextId);
+
+                entity.HasOne(d => d.RFRAll)
+                    .WithMany()
+                    .HasForeignKey(d => d.RFRAllId);
+
+            });
+
+            modelBuilder.Entity<CompareResult>(entity =>
+            {
+                entity.ToTable("CompareResult");
+
+            });
+
+            #endregion
+
             #region 初始化绩效点数规则
             //List<BasePointRule> rules = new List<BasePointRule>();
             //DataTable dt = wispro.sp.utility.NPOIExcel.ExcelToDataTable("c:\\temp\\20211130-点数规则-lcy-v1.xlsx", true);

+ 1 - 1
wispro.sp.share/EFCoreExt.cs

@@ -143,7 +143,7 @@ namespace wispro.sp.share
                 case OperatorEnum.Contains:
                     if (isString)
                     {
-                        return $"{prefix}.{FieldName}.Contains(\"{Value}\")";
+                        return $"{prefix}.{FieldName}.Contains(\"{Value.Trim()}\")";
                     }
                     else
                     {

+ 7 - 53
wispro.sp.utility/CompareDocx.cs

@@ -7,6 +7,7 @@ using System.IO.Packaging;
 using System.Text.RegularExpressions;
 using System.Linq;
 using Microsoft.Office.Interop.Word;
+using wispro.sp.entity.CompareCase;
 
 
 namespace wispro.sp.utility
@@ -193,53 +194,6 @@ namespace wispro.sp.utility
             }
         }
 
-        public class StringCompareResult
-        {
-            /// <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
-            {
-                get
-                {
-                    return ((double)DeleteCount + (double)InsertCount) / (double)oldWordCount;
-                }
-            }
-
-            public double TextSimilarity { get; set; }
-
-        }
         /// <summary>
         /// 原文档路径
         /// </summary>
@@ -253,22 +207,22 @@ namespace wispro.sp.utility
         /// <summary>
         /// 权力要求比较结果
         /// </summary>
-        public StringCompareResult ClaimResult { get; set; }
+        public CompareResult ClaimResult { get; set; }
 
         /// <summary>
         /// 摘要比较结果
         /// </summary>
-        public StringCompareResult AbstractResult { get; set; }
+        public CompareResult AbstractResult { get; set; }
 
         /// <summary>
         /// 说明书比较结果
         /// </summary>
-        public StringCompareResult FulltextResult { get; set; }
+        public CompareResult FulltextResult { get; set; }
 
         /// <summary>
         /// 所有文字比较结果
         /// </summary>
-        public StringCompareResult AllStringResult { get; set; }
+        public CompareResult AllStringResult { get; set; }
 
         /// <summary>
         /// 比较两个文档
@@ -291,9 +245,9 @@ namespace wispro.sp.utility
         /// 比较两个文档
         /// </summary>
         /// <exception cref="ApplicationException"></exception>
-        public StringCompareResult StringCompare(string oldtext,string newtext)
+        public CompareResult StringCompare(string oldtext,string newtext)
         {
-            StringCompareResult result = new StringCompareResult();
+            CompareResult result = new CompareResult();
             var differ = new Differ();
 
             if(oldtext == null) { oldtext = ""; }

+ 11 - 9
wispro.sp.utility/IPEasyUtility.cs

@@ -30,9 +30,10 @@ namespace wispro.sp.utility
             while (DateTime.Now - startTime < timeout)
             {
                 string filePath = Path.Combine(downloadDir, fileName);
+                
                 if (File.Exists(filePath))
                 {
-                    // 检查文件是否完成写入(文件大小是否稳定)
+                    // 检查文件是否完成写入(文件大小是否稳定)C:\temp\案件清单(2024年12月4日).xlsx
                     long previousSize = 0;
                     long currentSize = new FileInfo(filePath).Length;
                     while (previousSize != currentSize)
@@ -300,7 +301,7 @@ namespace wispro.sp.utility
                     }
 
                     retObject.DoPersons = waitGetElementById(wait, "pic_list").GetAttribute("value");           //处理人
-                    retObject.Reviewer = waitGetElementById(wait, "rev_list").GetAttribute("value");          //核稿人
+                    retObject.Reviewer = waitGetElementById(wait, "rev_list").GetAttribute("value").Replace(";","");          //核稿人
 
                     //第一次初稿日
                     retObject.FirstDraftDate = waitGetElementById(wait, "p_proc_info__first_doc_date").GetAttribute("value");
@@ -466,7 +467,7 @@ namespace wispro.sp.utility
                         }
                     }
 
-                    waitGetElementById(wait,"procstatusa_ok").Click();
+                    //waitGetElementById(wait,"procstatusa_ok").Click();
                     #endregion
 
 
@@ -521,7 +522,7 @@ namespace wispro.sp.utility
                         return firstTr.FindElement(By.XPath(".//td/a[@title='下载']"));
                     }).Click();
 
-                    var ReportName = $"案件清单({DateTime.Now.ToString("yyyy年MM月dd日")})";
+                    var ReportName = $"案件清单({DateTime.Now.ToString("yyyy年MM月d日")})";
                     string strFilePath = System.IO.Path.Combine(strFileSavePath, $"{ReportName.Trim()}.xlsx");
                     WaitForFileDownload(strFileSavePath, $"{ReportName.Trim()}.xlsx", TimeSpan.FromMinutes(5));
 
@@ -1105,6 +1106,7 @@ namespace wispro.sp.utility
                         });
                         caseLink = driver.FindElement(By.XPath($"//a[normalize-space()='{caseNo.Trim()}']"));
                         caseLink.Click();
+                        System.Threading.Thread.Sleep(200);
 
                         driver.SwitchTo().ParentFrame().SwitchTo().Frame(2);
                         IWebElement temDoItemLink = null;
@@ -1120,7 +1122,7 @@ namespace wispro.sp.utility
                         //{
                             var DoItemLinks = wait.Until((d) =>
                             {
-                                d.SwitchTo().ParentFrame().SwitchTo().Frame(2);
+                                d.SwitchTo().DefaultContent().SwitchTo().Frame(2);
                                 return d.FindElements(By.XPath($"//td[@colname='ctrl_proc' and ({xpathQuery})]"));
                             });
                                 
@@ -1156,7 +1158,7 @@ namespace wispro.sp.utility
                             retObject.FinishedDate = temDoItemLink.FindElement(By.XPath("following-sibling::td[7]")).Text;   //处理事项完成日
                             retObject.DoPersons = temDoItemLink.FindElement(By.XPath("following-sibling::td[8]")).Text;   //处理人
                             retObject.ExternalHandler = temDoItemLink.FindElement(By.XPath("following-sibling::td[9]")).Text;   //对外处理人
-                            retObject.Reviewer = temDoItemLink.FindElement(By.XPath("following-sibling::td[10]")).Text;   //核稿人
+                            retObject.Reviewer = temDoItemLink.FindElement(By.XPath("following-sibling::td[10]")).Text.Replace(";","");   //核稿人
                             retObject.DoItemMemo = temDoItemLink.FindElement(By.XPath("following-sibling::td[12]")).Text;   //处理事项备注
 
                             retObject.DoItem = temDoItemLink.Text;
@@ -1313,9 +1315,9 @@ namespace wispro.sp.utility
 
                         });
                         caseLink.Click();
-
-                        driver.SwitchTo().ParentFrame().SwitchTo().Frame(2);
-                        var DoItemLinks = wait.Until((d) => { 
+                        System.Threading.Thread.Sleep(200);
+                        var DoItemLinks = wait.Until((d) => {
+                            d.SwitchTo().DefaultContent().SwitchTo().Frame(2);
                             return d.FindElements(By.XPath($"//td[@colname='ctrl_proc'][normalize-space()='{doItemName}']"));
                         }); 
                         if (DoItemLinks.Count > 0)

+ 4 - 0
wispro.sp.utility/wispro.sp.utility.csproj

@@ -34,4 +34,8 @@
     <PackageReference Include="Selenium.WebDriver" Version="4.0.1" />
   </ItemGroup>
 
+  <ItemGroup>
+    <ProjectReference Include="..\wospro.sp.entity\wispro.sp.entity.csproj" />
+  </ItemGroup>
+
 </Project>

+ 7 - 7
wispro.sp.web/Layouts/BasicLayout.razor

@@ -192,13 +192,13 @@
 
             }
         },
-        //new MenuDataItem
-        //{
-        //    Path ="/Workflow/Manage",
-        //    Name ="流程管理",
-        //    Key= "wfManage",
-        //    Icon = "apartment"
-        //}
+        new MenuDataItem
+        {
+           Path ="/CompareFile/List",
+           Name ="申请文件比较",
+           Key= "wfManage",
+           Icon = "apartment"
+        }
 
     };
 

+ 101 - 0
wispro.sp.web/Pages/CompareFile/List.razor

@@ -0,0 +1,101 @@
+@page "/CompareFile/List"
+
+@inject IAgentFeedBackMemoItemsService _afService;
+@inject IAuthService _authService;
+
+@attribute [Authorize]
+<PageContainer>
+    <Breadcrumb>
+        <Breadcrumb>
+            <BreadcrumbItem>
+                <a href="/Home"><Icon Type="home"></Icon></a>
+            </BreadcrumbItem>
+            <BreadcrumbItem>
+                <Icon Type="setting"></Icon><span>申请文件比较清单</span>
+            </BreadcrumbItem>
+        </Breadcrumb>
+    </Breadcrumb>
+    <Content>
+        @*<Button Type="primary" Icon="plus" OnClick="AddNew" Style="float:right">添加</Button>*@
+    </Content>
+    <ChildContent>
+
+        <div style="width:100%;overflow:auto;background:#FFFFFF;height:600px;" id="div-Container">
+            <AntList Bordered DataSource="@_caseList">
+                <Header>
+                    <Select TItem="Field"
+	                    TItemValue="string"
+	                    DataSource="@_fields"
+		                    LabelName="@nameof(Field.FieldName)"
+		                    ValueName="@nameof(Field.FieldValue)"
+		                    Placeholder="请选择检索栏位"
+		                    DefaultActiveFirstOption="false"
+		                    OnSelectedItemChanged="OnSelectedItemChangedHandler"
+		                    >
+                    </Select>
+                    <Input Placeholder="请输入检索条件" @bind-Value="@txtValue"  /> 
+                    <Button Type="@ButtonType.Primary" Icon="@IconType.Outline.Search" OnClick="OnSearch">搜索</Button>
+                </Header>
+                <ChildContent Context="item">
+                    <ListItem>
+                        <PageHeader Ghost="false">
+                            <PageHeaderTitle>@item.CaseNo</PageHeaderTitle>
+                            <PageHeaderSubtitle>@item.CaseName</PageHeaderSubtitle>
+                            <PageHeaderExtra>
+                                <Button Type="@ButtonType.Link" @onclick="()=>Showdetail(item)">详情</Button>
+                            </PageHeaderExtra>
+                            <PageHeaderContent>
+                                <Descriptions Size="small" Column="3">
+                                    
+                                    <DescriptionsItem Title="处理人" Span="1">@item.Handlers</DescriptionsItem>
+                                    <DescriptionsItem Title="核稿人" Span="1">@item.Reviewer?.Name</DescriptionsItem>
+                                    <DescriptionsItem Span="1">
+                                        <Space>
+                                            <SpaceItem>
+                                            @if(item.DRRCalim != null)
+                                                {
+                                                    <Statistic Title="初稿&返稿相似度" Value="@($"{(item.DRRCalim.TextSimilarity*100.00).ToString("0.00")}%")" PrefixTemplate="@prefix1" />
+                                                }
+                                                else
+                                                {
+                                                    <Statistic Title="返稿&定稿相似度" Value="0" PrefixTemplate="@prefix1" />
+                                                }
+                                            </SpaceItem>
+                                            <SpaceItem>
+                                                @if(item.RFRAll != null)
+                                                {
+                                                    <Statistic Title="返稿&定稿相似度" Value="@($"{(item.RFRAll.TextSimilarity*100.00).ToString("0.00")}%")" PrefixTemplate="@prefix1" />
+                                                }
+                                                else
+                                                {
+                                                    <Statistic Title="返稿&定稿相似度" Value="0" PrefixTemplate="@prefix1" />
+                                                }
+                                            </SpaceItem>
+                                        </Space>
+                                    </DescriptionsItem>
+                                    <DescriptionsItem Title="客户" Span="3">@item.Customer?.Name</DescriptionsItem>
+                                
+                                </Descriptions>
+                            </PageHeaderContent>
+                        </PageHeader>
+                        
+                    </ListItem>
+                </ChildContent>
+                <Footer>
+                    <Pagination @bind-Current="_pageIndex" Total="_total" OnChange="OnPageChange" />
+                </Footer>
+            </AntList>
+            
+            
+            
+        </div>
+        
+    </ChildContent>
+</PageContainer>
+
+
+@code
+{
+    RenderFragment prefix1 =@<Icon Type="like" />;
+}
+    

+ 124 - 0
wispro.sp.web/Pages/CompareFile/List.razor.cs

@@ -0,0 +1,124 @@
+using AntDesign;
+using Microsoft.AspNetCore.Components;
+using System.Collections.Generic;
+using System;
+using wispro.sp.entity.CompareCase;
+using wispro.sp.entity;
+using AntDesign.TableModels;
+using System.Threading.Tasks;
+using wispro.sp.web.Services;
+using wispro.sp.share;
+
+namespace wispro.sp.web.Pages.CompareFile
+{
+     public partial class List
+     {
+        [Inject] public CompareFileService _CompareFileService { get; set; }
+
+        int _pageIndex = 1;
+        int _pageSize = 10;
+        Pagination _pagination;
+        int _total;
+        bool _loading = false;
+        QueryFilter _filter;
+        Field _selectedItem;
+        List<CaseInfo> _caseList;
+        List<Field> _fields = new List<Field>() { 
+            new Field(){ FieldName="处理人",FieldValue="Handlers"},
+            new Field(){ FieldName="审核人",FieldValue="Reviewer.Name"},
+            new Field(){ FieldName="客户",FieldValue="Customer.Name"},
+            new Field(){ FieldName="案号",FieldValue="CaseNo"},
+            new Field(){ FieldName="案件名称",FieldValue="CaseName"}
+        };
+        protected override async Task OnInitializedAsync()
+        {
+            _filter = new QueryFilter();
+            _filter.PageIndex = 1;
+            _filter.PageSize = 1;
+
+            await GetData();
+
+            StateHasChanged();
+            
+        }
+
+        private void OnSelectedItemChangedHandler(Field value)
+        {
+            _selectedItem = value;
+        }
+
+        private string txtValue = string.Empty;
+        private async void OnSearch()
+        {
+            if (!string.IsNullOrEmpty(txtValue))
+            {
+                _filter.ConditionTree.Clear();
+                _filter.ConditionTree.Add(
+                    new FieldCondition()
+                    {
+                        FieldName = _selectedItem.FieldValue,
+                        LogicOperate = LogicEnum.And,
+                        Operator = OperatorEnum.Contains,
+                        Value = txtValue,
+                        ValueType = "System.String"
+                    }
+                );
+            }
+
+
+
+            await GetData();
+            StateHasChanged();
+        }
+
+        private int serialNumber(int pageIndex, int pageSize, int id)
+        {
+            int iIndex = 0;
+            foreach (CaseInfo sf in _caseList)
+            {
+                iIndex++;
+
+                if (sf.Id == id)
+                {
+                    break;
+                }
+            }
+            return (pageIndex - 1) * pageSize + iIndex;
+        }
+
+        CaseInfo _currentCase = null;
+        private void Showdetail(CaseInfo caseInfo)
+        {
+            _currentCase = caseInfo;
+
+        }
+
+
+        private async Task GetData()
+        {
+            _loading = true;
+            var data = await _CompareFileService.Query(_filter);
+            _caseList = data.Results;
+            _total = data.TotalCount;
+            _loading = false;
+
+            StateHasChanged();
+        }
+
+        async void OnPageChange(PaginationEventArgs args)
+        {
+            _pageIndex = args.Page;
+            _pageSize = args.PageSize;
+
+            await GetData();
+
+            StateHasChanged();
+        }
+
+        class Field
+        {
+            public string FieldName { get; set; }
+            public string FieldValue { get; set; }
+        }
+    }
+}

+ 0 - 2
wispro.sp.web/Pages/ItemHandler/PerformanceItemList.razor

@@ -1,5 +1,3 @@
 @page "/PerformanceItemList"
 
 <h3>PerformanceItemList</h3>
-
-

+ 1 - 0
wispro.sp.web/Program.cs

@@ -43,6 +43,7 @@ namespace wispro.sp.web
             builder.Services.AddScoped<OrganizationService, OrganizationService>();
             builder.Services.AddScoped<WorkflowService, WorkflowService>();
             builder.Services.AddScoped<ReportService, ReportService>();
+            builder.Services.AddScoped<CompareFileService, CompareFileService>();
 
             builder.Services.AddBlazorContextMenu();
             builder.Services.AddECharts();

+ 29 - 0
wispro.sp.web/Services/CompareFileService.cs

@@ -0,0 +1,29 @@
+using Microsoft.AspNetCore.Components.Authorization;
+using System.Threading.Tasks;
+using wispro.sp.entity;
+using wispro.sp.entity.CompareCase;
+using wispro.sp.share;
+using wispro.sp.web.Auth;
+using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
+
+namespace wispro.sp.web.Services
+{
+    public class CompareFileService
+    {
+        private readonly IHttpService _httpClient;
+        private readonly JwtAuthenticationStateProvider _jwt;
+
+        public CompareFileService(IHttpService httpClient, AuthenticationStateProvider jwt)
+        {
+            _httpClient = httpClient;
+            _jwt = (JwtAuthenticationStateProvider)jwt;
+        }
+
+        public async Task<ListApiResponse<CaseInfo>> Query(QueryFilter queryFilter)
+        {
+            var data = await _httpClient.Post<ListApiResponse<CaseInfo>>($"CaseFileCompare/QueryFilter", queryFilter);
+            return data;
+        }
+
+    }
+}

+ 0 - 1
wispro.sp.web/Services/PerformanceItemServices.cs

@@ -151,7 +151,6 @@ namespace wispro.sp.web.Services
 
             if (queryModel != null)
             {
-
                 query.PageIndex = queryModel.PageIndex;
                 query.PageSize = queryModel.PageSize;
 

+ 1 - 0
wispro.sp.winClient/frmCaseFileCompare.Designer.cs

@@ -63,6 +63,7 @@
             txtCaseNo.Name = "txtCaseNo";
             txtCaseNo.Size = new System.Drawing.Size(421, 34);
             txtCaseNo.TabIndex = 2;
+            txtCaseNo.Text = "S2418519-测试卷";
             // 
             // comboBox1
             // 

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 325 - 116
wispro.sp.winClient/frmCaseFileCompare.cs


+ 111 - 0
wospro.sp.entity/CompareCase/CaseInfo.cs

@@ -0,0 +1,111 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace wispro.sp.entity.CompareCase
+{
+    public class CaseInfo
+    {
+        public int Id { get; set; }
+
+        /// <summary>
+        /// 案号
+        /// </summary>
+        public String CaseNo { get; set; }
+
+        /// <summary>
+        /// 案件名称
+        /// </summary>
+        public String CaseName { get; set; } = string.Empty;
+
+        /// <summary>
+        /// 客户
+        /// </summary>
+        public Customer Customer { get; set; }
+
+        /// <summary>
+        /// 客户Id
+        /// </summary>
+        public int? CustomerId { get; set; }
+
+        /// <summary>
+        /// 处理人
+        /// </summary>
+        public string Handlers {  get; set; }
+
+        public int? ReviewerId { get; set; }
+        /// <summary>
+        /// 核稿人
+        /// </summary>
+        public Staff Reviewer { get; set; }
+
+
+        /// <summary>
+        /// 初稿日
+        /// </summary>
+        public DateTime? DraftDate { get; set; }
+
+        /// <summary>
+        /// 返稿日
+        /// </summary>
+        public  DateTime? ReturnDate {  get; set; }
+
+        /// <summary>
+        /// 定稿日
+        /// </summary>
+        public DateTime? FinalVersionDate {  get; set; }
+
+        /// <summary>
+        /// 初稿与返稿摘要比较结果Id
+        /// </summary>
+        public int? DRRAbstractId { get; set; }
+
+        public CompareResult DRRAbstract { get; set; }
+
+        /// <summary>
+        /// 初稿与返稿权利要求比较结果Id
+        /// </summary>
+        public int? DRRCalimId { get; set; }
+
+        public CompareResult DRRCalim { get; set; }
+
+        /// <summary>
+        /// 初稿与返稿说明书比较结果Id
+        /// </summary>
+        public int? DRRFulltextId { get; set; }
+
+        public CompareResult DRRFulltext { get; set; }
+
+        /// <summary>
+        /// 初稿与返稿全文比较结果Id
+        /// </summary>
+        public int? DRRAllId { get; set; }
+        public CompareResult DRRAll { get; set; }
+
+        /// <summary>
+        /// 定稿与返稿摘要比较结果Id
+        /// </summary>
+        public int? RFRAbstractId { get; set; }
+        public CompareResult RFRAbstract { get; set; }
+
+        /// <summary>
+        /// 定稿与返稿权利要求比较结果Id
+        /// </summary>
+        public int? RFRCalimId { get; set; }
+        public CompareResult RFRCalim { get; set; }
+
+        /// <summary>
+        /// 定稿与返稿说明书比较结果Id
+        /// </summary>
+        public int? RFRFulltextId { get; set; }
+        public CompareResult RFRFulltext { get; set; }
+
+        /// <summary>
+        /// 定稿与返稿全文比较结果Id
+        /// </summary>
+        public int? RFRAllId { get; set; }
+        public CompareResult RFRAll { get; set; }
+    }
+}

+ 61 - 0
wospro.sp.entity/CompareCase/StringCompareResult.cs

@@ -0,0 +1,61 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Text.Json.Serialization;
+using System.Threading.Tasks;
+
+namespace wispro.sp.entity.CompareCase
+{
+    public class CompareResult
+    {
+        public int Id {  get; set; }
+
+        /// <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 int EditCount { get; set; }
+
+        /// <summary>
+        /// 包括修订文字版本的文档
+        /// </summary>
+        public string CompareResultString { get; set; }
+
+        [JsonIgnore]
+        /// <summary>
+        /// 总的修改比率
+        /// </summary>
+        public double diffRate
+        {
+            get
+            {
+                return ((double)DeleteCount + (double)InsertCount) / (double)oldWordCount;
+            }
+        }
+
+        public double TextSimilarity { get; set; } = 0.0;
+
+    }
+}