소스 검색

添加查看案件比较详情页面
添加案件比较邮件通知功能

luocaiyang 8 달 전
부모
커밋
6217835cbd

+ 53 - 1
wispro.sp.api/Controllers/CaseFileCompareController.cs

@@ -1,4 +1,5 @@
-using DocumentFormat.OpenXml.InkML;
+using AntDesign;
+using DocumentFormat.OpenXml.InkML;
 using DynamicExpresso;
 using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Http;
@@ -16,6 +17,7 @@ using System.Linq;
 using System.Linq.Expressions;
 using System.Text.RegularExpressions;
 using wispro.sp.api.AppealHandler;
+using wispro.sp.api.Job;
 using wispro.sp.api.Services;
 using wispro.sp.entity;
 using wispro.sp.entity.CompareCase;
@@ -564,6 +566,56 @@ namespace wispro.sp.api.Controllers
                 }
 
             }
+
+            if (staffMailInfo.Count > 0) { 
+                foreach (var key in staffMailInfo.Keys)
+                {
+                    Staff staff = key as Staff;
+                    List<mailCaseInfo> mailCases = (List<mailCaseInfo>)staffMailInfo[key];
+
+                    
+                    string strMessage = string.Empty ;
+                    foreach(var m in mailCases)
+                    {
+                        if ((m.Top10Cases != null && m.Top10Cases.Count > 0) || (m.AbnormalCases != null && m.AbnormalCases.Count > 0))
+                        {
+                            strMessage += $"<div><b>{m.CustomerCompareStatistics.CustomerName}:</b>";
+                            strMessage += $"<br/>一年内案件数量:{m.CustomerCompareStatistics.CaseCount}";
+                            strMessage += $"<br/>内部核稿平均修改率:{m.CustomerCompareStatistics.Diff_Drafted_Claims_Avg}&nbsp;&nbsp;内部核稿修改率标准方差:{m.CustomerCompareStatistics.Diff_Drafted_Claims_Std}";
+                            strMessage += $"<br/>外部部核稿平均修改率:{m.CustomerCompareStatistics.Diff_FinalDrafted_Claims_Avg}&nbsp;&nbsp;外部核稿修改率标准方差:{m.CustomerCompareStatistics.Diff_FinalDrafted_Claims_Std}</div>";
+                            if (m.Top10Cases != null && m.Top10Cases.Count > 0)
+                            {
+                                strMessage += $"<div>外部核稿修改率前10名案件清单:</div>";
+                                strMessage += "<table><thead><td>案号</td><td>案件名称</td><td>处理人</td><td>核稿人</td><td>内部核稿修改率</td><td>外部核稿修改率</td></thead><body>";
+                                foreach (var c in m.Top10Cases)
+                                {
+                                    strMessage += $"<tr><td><a href=\"{($"http://1.116.113.26/CompareFile/detail/{c.CaseNo}")}\">{c.CaseNo}</a></td><td>{c.CaseName}</td><td>{c.Handlers}</td><td>{(c.Reviewer == null ? "" : c.Reviewer.Name)}</td><td>{(c.DRRCalim == null ? "" : c.DRRCalim.diffRate.ToString("0.0000"))}</td><td>{(c.RFRCalim == null ? "" : c.RFRCalim.diffRate.ToString("0.0000"))}</td></tr>";
+                                }
+                                strMessage += "</body></table>";
+                            }
+
+                            if (m.AbnormalCases != null && m.AbnormalCases.Count > 0)
+                            {
+                                strMessage += $"<div>疑似异常案件清单:</div>";
+                                strMessage += "<table><thead><td>案号</td><td>案件名称</td><td>处理人</td><td>核稿人</td><td>内部核稿修改率</td><td>外部核稿修改率</td></thead><body>";
+                                foreach (var c in m.Top10Cases)
+                                {
+                                    strMessage += $"<tr><td><a href=\"{($"http://1.116.113.26/CompareFile/detail/{c.CaseNo}")}\">{c.CaseNo}</a></td><td>{c.CaseName}</td><td>{c.Handlers}</td><td>{(c.Reviewer == null ? "" : c.Reviewer.Name)}</td><td>{(c.DRRCalim == null ? "" : c.DRRCalim.diffRate.ToString("0.0000"))}</td><td>{(c.RFRCalim == null ? "" : c.RFRCalim.diffRate.ToString("0.0000"))}</td></tr>";
+                                }
+                                strMessage += "</body></table>";
+                            }
+
+                            strMessage += "</div>";
+                        }
+                        
+                    }
+
+
+                    string strBody = $"<div style=\"position:absolute;margin-top:20px;margin-left:20px;margin-right:20px;box-shadow:0px 0px 3px 3px #ccc \"><div style= \"margin-top: 20px; margin-left:20px;;font-size:14px; \">{staff.Name},你好!</div><div style= \"margin-top: 25px; margin-left:20px;font-size:14px; \">{strMessage}<div style= \"margin-top: 100px;margin-right:15px; padding-bottom: 20px; font-size:14px;color:#888888;float:right; \">小美集团绩效管理系统</div></div>";
+                    staff.Mail = "luocaiyang@china-wispro.com";
+                    _ = QuartzUtil.AddMailJob($"{start.ToString("yyyyMMdd")}-{end.ToString("yyyyMMdd")}申请文件比较邮件", strBody, staff.Name, staff.Mail);
+                }
+            }
         }
 
         private void AddtoHashTable(CaseInfo caseInfo, int v, Staff staff, Hashtable staffMailInfo,CustomerCompareStatistics cStatics)

+ 4 - 2
wispro.sp.utility/IPEasyUtility.cs

@@ -494,6 +494,8 @@ namespace wispro.sp.utility
                     //定稿日
                     retObject.FinalizationDate = waitGetElementById(wait, "p_proc_info__finish_doc_date").GetAttribute("value");
 
+                    retObject.FinishedDate = waitGetElementById(wait, "p_proc_info__finish_date").GetAttribute("value"); 
+
                     //点击附件信息Tab
                     var lifile = driver.FindElement(By.Id("lifile"));
                     driver.ExecuteJavaScript("arguments[0].click();", lifile);
@@ -801,8 +803,8 @@ namespace wispro.sp.utility
                     break;
                 }
 
-                
-                if (cols[3].Text == "未递交" || cols[2].Text.Contains("申请"))
+
+                if (cols[3].Text == "未递交" || (cols[2].Text.Contains("申请") && !cols[2].Text.Contains("受理通知")))
                 {
                     DateTime temDate = DateTime.Parse(cols[9].Text);
                     if (temDate < dateTime)

+ 19 - 0
wispro.sp.web/Layouts/EmptyLayout.razor

@@ -0,0 +1,19 @@
+@inherits LayoutComponentBase
+
+<AntDesign.Layout Class="site-layout-background-img">
+    <Content Style="padding: 24px;min-height: 280px;">
+        @Body
+    </Content>
+    <Footer Style="text-align: center;height:50px;"> ©2021 Created by 小美知识产权</Footer>
+</AntDesign.Layout>
+
+<style>
+    .site-layout-background-img {
+        
+        background-attachment: fixed;
+        background-repeat: no-repeat;
+        background-size: cover;
+        background-position: center;
+    }
+
+</style>

+ 181 - 0
wispro.sp.web/Pages/CompareFile/Detail.razor

@@ -0,0 +1,181 @@
+@page "/CompareFile/Detail/{caseNo}"
+
+@layout Layouts.EmptyLayout
+
+
+ @if(_currentCase != null)
+ {
+    <label for="result">对比结果:</label>
+    <div>
+        <RadioGroup @bind-Value="@_value">
+            <Radio Value="1">初稿&第一次返稿对比</Radio>
+            <Radio Value="2">第一次返稿&定稿对比</Radio>
+        </RadioGroup>
+    </div>
+    <div id="result">
+        <table width="100%" border="1">
+            <thead>
+                <tr>
+                    <td></td>
+                    <td>权利要求</td>
+                    <td>摘要</td>
+                    <td>说明书</td>
+                    <td>全部对比</td>
+                </tr>
+            </thead>
+            <tbody>
+                <tr>
+
+                    <td>语义相似度[%]</td>
+                    @if (_value == 1)
+                    {
+                        <td> @($"{(_currentCase.DRRCalim?.TextSimilarity * 100)?.ToString("0.00")}")</td>
+                        <td>@($"{(_currentCase.DRRAbstract?.TextSimilarity * 100)?.ToString("0.00")}")</td>
+                        <td>@($"{(_currentCase.DRRFulltext?.TextSimilarity * 100)?.ToString("0.00")}")</td>
+                        <td>@($"{(_currentCase.DRRAll?.TextSimilarity * 100)?.ToString("0.00")}")</td>
+                    }
+                    else
+                    {
+                        <td>@($"{(_currentCase.RFRCalim?.TextSimilarity * 100)?.ToString("0.00")}")</td>
+                        <td>@($"{(_currentCase.RFRAbstract?.TextSimilarity * 100)?.ToString("0.00")}")</td>
+                        <td>@($"{(_currentCase.RFRFulltext?.TextSimilarity * 100)?.ToString("0.00")}")</td>
+                        <td>@($"{(_currentCase.RFRAll?.TextSimilarity * 100)?.ToString("0.00")}")</td>
+                    }
+                </tr>
+                <tr>
+                    <td>原文字数</td>
+                    @if (_value == 1)
+                    {
+                        <td>@_currentCase.DRRCalim?.oldWordCount</td>
+                        <td>@_currentCase.DRRAbstract?.oldWordCount</td>
+                        <td>@_currentCase.DRRFulltext?.oldWordCount</td>
+                        <td>@_currentCase.DRRAll?.oldWordCount</td>
+                    }
+                    else
+                    {
+                        <td>@_currentCase.RFRCalim?.oldWordCount</td>
+                        <td>@_currentCase.RFRAbstract?.oldWordCount</td>
+                        <td>@_currentCase.RFRFulltext?.oldWordCount</td>
+                        <td>@_currentCase.RFRAll?.oldWordCount</td>
+                    }
+
+                </tr>
+                <tr>
+                    <td>删除字数</td>
+                    @if (_value == 1)
+                    {
+                        <td>@_currentCase.DRRCalim?.DeleteCount</td>
+                        <td>@_currentCase.DRRAbstract?.DeleteCount</td>
+                        <td>@_currentCase.DRRFulltext?.DeleteCount</td>
+                        <td>@_currentCase.DRRAll?.DeleteCount</td>
+                    }
+                    else
+                    {
+                        <td>@_currentCase.RFRCalim?.DeleteCount</td>
+                        <td>@_currentCase.RFRAbstract?.DeleteCount</td>
+                        <td>@_currentCase.RFRFulltext?.DeleteCount</td>
+                        <td>@_currentCase.RFRAll?.DeleteCount</td>
+                    }
+
+                </tr>
+                <tr>
+                    <td>插入字数</td>
+                    @if (_value == 1)
+                    {
+                        <td>@_currentCase.DRRCalim?.InsertCount</td>
+                        <td>@_currentCase.DRRAbstract?.InsertCount</td>
+                        <td>@_currentCase.DRRFulltext?.InsertCount</td>
+                        <td>@_currentCase.DRRAll?.InsertCount</td>
+                    }
+                    else
+                    {
+                        <td>@_currentCase.RFRCalim?.InsertCount</td>
+                        <td>@_currentCase.RFRAbstract?.InsertCount</td>
+                        <td>@_currentCase.RFRFulltext?.InsertCount</td>
+                        <td>@_currentCase.RFRAll?.InsertCount</td>
+                    }
+
+                </tr>
+                <tr>
+                    <td>修改比例[%]</td>
+                    @if (_value == 1)
+                    {
+                        <td> @($"{(_currentCase.DRRCalim?.diffRate * 100)?.ToString("0.00")}")</td>
+                        <td>@($"{(_currentCase.DRRAbstract?.diffRate * 100)?.ToString("0.00")}")</td>
+                        <td>@($"{(_currentCase.DRRFulltext?.diffRate * 100)?.ToString("0.00")}")</td>
+                        <td>@($"{(_currentCase.DRRAll?.diffRate * 100)?.ToString("0.00")}")</td>
+                    }
+                    else
+                    {
+                        <td> @($"{(_currentCase.RFRCalim?.diffRate * 100)?.ToString("0.00")}")</td>
+                        <td>@($"{(_currentCase.RFRAbstract?.diffRate * 100)?.ToString("0.00")}")</td>
+                        <td>@($"{(_currentCase.RFRFulltext?.diffRate * 100)?.ToString("0.00")}")</td>
+                        <td>@($"{(_currentCase.RFRAll?.diffRate * 100)?.ToString("0.00")}")</td>
+                    }
+
+                </tr>
+            </tbody>
+        </table>
+    </div>
+    <div>
+        <label>修订文字:</label>
+        <RadioGroup @bind-Value="@_ShowResultString">
+            <Radio Value="1">权要</Radio>
+            <Radio Value="2">摘要</Radio>
+            <Radio Value="3">说明书</Radio>
+            <Radio Value="4">全文</Radio>
+        </RadioGroup>
+    </div>
+
+    <div style="user-select:text !important;width:100%;height:600px;overflow: auto;border: 2px solid black;padding: 10px;">
+            @if (_ShowResultString == 1 && _value == 1)
+            {
+                @((MarkupString)_currentCase.DRRCalim?.CompareResultString)
+            }
+
+            @if (_ShowResultString == 2 && _value == 1)
+            {
+                @((MarkupString)_currentCase.DRRAbstract?.CompareResultString)
+            }
+
+            @if (_ShowResultString == 3 && _value == 1)
+            {
+                @((MarkupString)_currentCase.DRRFulltext?.CompareResultString)
+            }
+
+            @if (_ShowResultString == 4 && _value == 1)
+            {
+                @((MarkupString)_currentCase.DRRAll?.CompareResultString)
+            }
+
+            @if (_ShowResultString == 1 && _value == 2)
+            {
+                @((MarkupString)_currentCase.RFRCalim?.CompareResultString)
+            }
+
+            @if (_ShowResultString == 2 && _value == 2)
+            {
+                @((MarkupString)_currentCase.RFRAbstract?.CompareResultString)
+            }
+
+            @if (_ShowResultString == 3 && _value == 2)
+            {
+                @((MarkupString)_currentCase.RFRFulltext?.CompareResultString)
+            }
+
+            @if (_ShowResultString == 4 && _value == 2)
+            {
+                @((MarkupString)_currentCase.RFRAll?.CompareResultString)
+            }
+
+    </div>
+}
+else
+{
+    <h1>数据加载中.......</h1>
+}
+
+
+@code {
+
+}

+ 60 - 0
wispro.sp.web/Pages/CompareFile/Detail.razor.cs

@@ -0,0 +1,60 @@
+using Microsoft.AspNetCore.Components;
+using System;
+using System.Threading.Tasks;
+using wispro.sp.entity.CompareCase;
+using wispro.sp.share;
+using wispro.sp.web.Pages.AppCase;
+using wispro.sp.web.Services;
+
+namespace wispro.sp.web.Pages.CompareFile
+{
+    public partial class Detail
+    {
+        [Inject] public CompareFileService _CompareFileService { get; set; }
+
+        int _value = 1;
+        int _ShowResultString = 1;
+        CaseInfo _currentCase = null;
+
+        [Parameter]
+        public string caseNo { get; set; }
+
+        protected override async Task OnInitializedAsync()
+        {
+            
+            QueryFilter _filter = new QueryFilter();
+            _filter.ConditionTree.Add(
+                    new FieldCondition()
+                    {
+                        FieldName = "CaseNo",
+                        LogicOperate = LogicEnum.And,
+                        Operator = OperatorEnum.Contains,
+                        Value = caseNo,
+                        ValueType = "System.String"
+                    }
+                );
+
+            _filter.PageIndex = 1;
+            _filter.PageSize = 10;
+            
+            
+            var data = await _CompareFileService.Query(_filter);
+            var _caseList = data.Results;
+            var _total = data.TotalCount;
+
+            if (_total > 0)
+            {
+                _currentCase = _caseList[0];
+            }
+            else
+            {
+                Console.WriteLine("没找到案件!");
+            }
+
+            StateHasChanged();
+
+        }
+
+
+    }
+}

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

@@ -41,8 +41,6 @@ namespace wispro.sp.web.Pages.CompareFile
         {
             await _authService.CanVisitResource();
 
-            
-
             await GetData();
 
             StateHasChanged();

+ 1 - 1
wispro.sp.winClient/appsettings.json

@@ -1,7 +1,7 @@
 {
   "IPEasySetting": {
     "DownloadFileSavePath": "c:\\temp",
-    "isHeadless": "true",
+    "isHeadless": "false",
     "Account": "caiyangl",
     "Password": "j)wx*lier*@3",
     "ChormeDriverPath": "e:\\source\\repos\\StaffPerformance\\packages\\ChormeDriver\\131.0.6778.108",

+ 50 - 43
wispro.sp.winClient/frmCaseFileCompare.cs

@@ -82,6 +82,11 @@ namespace wispro.sp.winClient
                     caseInfo.FinalVersionDate = string.IsNullOrEmpty(retFiles.FinalizationDate) ? null : DateTime.Parse(retFiles.FinalizationDate);
                 }
 
+                if (keyValuePairs.ContainsKey("FinishedDate"))
+                {
+                    caseInfo.CreateTime = string.IsNullOrEmpty(retFiles.FinishedDate) ? null : DateTime.Parse(retFiles.FinishedDate);
+                }
+
                 if (keyValuePairs.ContainsKey("DoPersons"))
                 {
                     caseInfo.Handlers = retFiles.DoPersons;
@@ -116,6 +121,8 @@ namespace wispro.sp.winClient
                     finalFile = retFiles.finallyFile;
                 }
 
+                
+
                 return caseInfo;
             }
 
@@ -184,33 +191,33 @@ namespace wispro.sp.winClient
                         if (i > 1 && returnFile != null)
                         {
                             #region 将文件复制到保存文件夹中
-                            string strSavePath = "d:\\CaseFiles";
+                            //string strSavePath = "d:\\CaseFiles";
 
-                            string strCaseFilePath = Path.Combine(strSavePath, caseInfo.CaseNo);
-                            if (!Directory.Exists(strCaseFilePath))
-                            {
-                                Directory.CreateDirectory(strCaseFilePath);
-                            }
-                            if (!string.IsNullOrEmpty(draftFile))
-                            {
-                                FileInfo file = new FileInfo(draftFile);
+                            //string strCaseFilePath = Path.Combine(strSavePath, caseInfo.CaseNo);
+                            //if (!Directory.Exists(strCaseFilePath))
+                            //{
+                            //    Directory.CreateDirectory(strCaseFilePath);
+                            //}
+                            //if (!string.IsNullOrEmpty(draftFile))
+                            //{
+                            //    FileInfo file = new FileInfo(draftFile);
 
-                                File.Copy(draftFile, Path.Combine(strCaseFilePath, $"草稿-{file.Name}"), true);
-                            }
+                            //    File.Copy(draftFile, Path.Combine(strCaseFilePath, $"草稿-{file.Name}"), true);
+                            //}
 
-                            if (!string.IsNullOrEmpty(returnFile))
-                            {
-                                FileInfo file = new FileInfo(returnFile);
+                            //if (!string.IsNullOrEmpty(returnFile))
+                            //{
+                            //    FileInfo file = new FileInfo(returnFile);
 
-                                File.Copy(returnFile, Path.Combine(strCaseFilePath, $"返稿-{file.Name}"), true);
-                            }
+                            //    File.Copy(returnFile, Path.Combine(strCaseFilePath, $"返稿-{file.Name}"), true);
+                            //}
 
-                            if (!string.IsNullOrEmpty(finalFile))
-                            {
-                                FileInfo file = new FileInfo(finalFile);
+                            //if (!string.IsNullOrEmpty(finalFile))
+                            //{
+                            //    FileInfo file = new FileInfo(finalFile);
 
-                                File.Copy(finalFile, Path.Combine(strCaseFilePath, $"定稿-{file.Name}"), true);
-                            }
+                            //    File.Copy(finalFile, Path.Combine(strCaseFilePath, $"定稿-{file.Name}"), true);
+                            //}
                             #endregion
                             CompareFiles(draftFile, returnFile, finalFile, caseInfo);
 
@@ -380,7 +387,7 @@ namespace wispro.sp.winClient
             {
                 if (MessageBox.Show("获取前一天所有的完成案件,并比较文档?", "提示框", MessageBoxButtons.YesNo) == DialogResult.Yes)
                 {
-                    compareCaseFile(DateTime.Parse("2024-12-01"),DateTime.Parse("2024-12-31"));
+                    compareCaseFile(DateTime.Parse("2024-02-01"),DateTime.Parse("2024-12-31"));
                     return;
                 }
                 else
@@ -403,33 +410,33 @@ namespace wispro.sp.winClient
                             (string.IsNullOrEmpty(finalFile) ? 0 : 1);
 
                 #region 将文件复制到保存文件夹中
-                string strSavePath = "d:\\CaseFiles";
+                //string strSavePath = "d:\\CaseFiles";
 
-                string strCaseFilePath = Path.Combine(strSavePath, caseInfo.CaseNo);
-                if (!Directory.Exists(strCaseFilePath))
-                {
-                    Directory.CreateDirectory(strCaseFilePath);
-                }
-                if (!string.IsNullOrEmpty(draftFile))
-                {
-                    FileInfo file = new FileInfo(draftFile);
+                //string strCaseFilePath = Path.Combine(strSavePath, caseInfo.CaseNo);
+                //if (!Directory.Exists(strCaseFilePath))
+                //{
+                //    Directory.CreateDirectory(strCaseFilePath);
+                //}
+                //if (!string.IsNullOrEmpty(draftFile))
+                //{
+                //    FileInfo file = new FileInfo(draftFile);
 
-                    File.Copy(draftFile, Path.Combine(strCaseFilePath, $"草稿-{file.Name}"), true);
-                }
+                //    File.Copy(draftFile, Path.Combine(strCaseFilePath, $"草稿-{file.Name}"), true);
+                //}
 
-                if (!string.IsNullOrEmpty(returnFile))
-                {
-                    FileInfo file = new FileInfo(returnFile);
+                //if (!string.IsNullOrEmpty(returnFile))
+                //{
+                //    FileInfo file = new FileInfo(returnFile);
 
-                    File.Copy(returnFile, Path.Combine(strCaseFilePath, $"返稿-{file.Name}"), true);
-                }
+                //    File.Copy(returnFile, Path.Combine(strCaseFilePath, $"返稿-{file.Name}"), true);
+                //}
 
-                if (!string.IsNullOrEmpty(finalFile))
-                {
-                    FileInfo file = new FileInfo(finalFile);
+                //if (!string.IsNullOrEmpty(finalFile))
+                //{
+                //    FileInfo file = new FileInfo(finalFile);
 
-                    File.Copy(finalFile, Path.Combine(strCaseFilePath, $"定稿-{file.Name}"), true);
-                }
+                //    File.Copy(finalFile, Path.Combine(strCaseFilePath, $"定稿-{file.Name}"), true);
+                //}
                 #endregion
 
                 if (i > 1)