Bladeren bron

添加页面权项可指定人员Id设定
完成申请文件差异度比对的前端页面及后端查询的接口

luocaiyang 10 maanden geleden
bovenliggende
commit
76a1b77936

+ 13 - 10
wispro.sp.api/Controllers/PerformanceItemController.cs

@@ -2224,19 +2224,22 @@ namespace wispro.sp.api.Controllers
             var lstARs = spDb.AllocationRatios.Where<AllocationRatio>(i => i.ItemId == item.Id).ToList();
             double? baseMony = item.BasePoint;
 
-            if(item.isDanger() && item.OverDueMemo == null)
+            if (DateTime.Parse($"{item.CalMonth.Year}-{item.CalMonth.Month}-01") > DateTime.Parse("2024-11-01"))
             {
-                #region 完成日期-委托日期>45天为延迟,每延迟一天绩效减去0.5个百分点
-                DateTime? dt1 = item.EntrustingDate;
-                DateTime? dt2 = item.FinishedDate;
-
-                if (dt2 == null)
+                if (item.isDanger() && item.OverDueMemo == null)
                 {
-                    dt2 = DateTime.Now;
-                }
+                    #region 完成日期-委托日期>45天为延迟,每延迟一天绩效减去0.5个百分点
+                    DateTime? dt1 = item.EntrustingDate;
+                    DateTime? dt2 = item.FinishedDate;
 
-                baseMony = baseMony * (100-((dt2.Value - dt1.Value).TotalDays - 45) * 0.5)/100.00;
-                #endregion
+                    if (dt2 == null)
+                    {
+                        dt2 = DateTime.Now;
+                    }
+
+                    baseMony = baseMony * (100 - ((dt2.Value - dt1.Value).TotalDays - 45) * 0.5) / 100.00;
+                    #endregion
+                }
             }
 
             

+ 2 - 1
wispro.sp.api/appsettings.json

@@ -54,7 +54,8 @@
     "/LevelStatistics": "[94]-[1],[128]-[7],[44]-[5],[2]-[7]",
     "/Report/SingleChart": "[94]-[1],[128]-[7],[44]-[5],[2]-[7]",
     "/Report/AppealTrend": "[94]-[1],[128]-[7],[44]-[5],[2]-[7]",
-    "/Report/StaticsTrend": "[94]-[1],[128]-[7],[44]-[5],[2]-[7]"
+    "/Report/StaticsTrend": "[94]-[1],[128]-[7],[44]-[5],[2]-[7]",
+    "/CompareFile/List": "5,45,132,133"
   },
 
   "Lastest_feedback_date": "28"

+ 10 - 1
wispro.sp.web/Pages/AppCase/CaseManager.razor.cs

@@ -26,7 +26,16 @@ namespace wispro.sp.web.Pages.AppCase
             new() { Text = "A", Value = "A" },
             new() { Text = "B", Value = "B" },
             new() { Text = "C", Value = "C" },
-            new() { Text = "D", Value = "D" }
+            new() { Text = "D", Value = "D" },
+            new() { Text = "S级", Value = "S级" },
+            new() { Text = "机电A级", Value = "机电A级" },
+            new() { Text = "机电B级", Value = "机电B级" },
+            new() { Text = "机电C级", Value = "机电C级" },
+            new() { Text = "机电D级", Value = "机电D级" },
+            new() { Text = "化学A级", Value = "化学A级" },
+            new() { Text = "化学B级", Value = "化学B级" },
+            new() { Text = "化学C级", Value = "化学C级" },
+            new() { Text = "化学D级", Value = "化学D级" }
         };
 
         [Inject]

+ 267 - 22
wispro.sp.web/Pages/CompareFile/List.razor

@@ -19,22 +19,41 @@
         @*<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">
+        <div style="width:100%;overflow:auto;background:#FFFFFF;height:100%;" 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>
+                    <Row>
+                        <Col Span="4">
+                            <Select TItem="Field"
+	                            TItemValue="string"
+	                            DataSource="@_fields"
+		                        LabelName="@nameof(Field.FieldName)"
+		                        ValueName="@nameof(Field.FieldValue)"
+		                        Placeholder="请选择检索栏位"
+		                        DefaultActiveFirstOption="false"
+		                        OnSelectedItemChanged="OnSelectedItemChangedHandler"
+		                        >
+                            </Select>
+                        </Col>
+                        <Col Span="6">
+                            <Input Placeholder="请输入检索条件" @bind-Value="@txtValue" /> 
+                        </Col>
+                        <Col Span="4">
+                            <Button Type="@ButtonType.Primary" Icon="@IconType.Outline.Search" OnClick="OnSearch">搜索</Button>
+                        </Col>
+                        <Col>
+                            @if (_filter !=null && _filter.ConditionTree !=null && _filter.ConditionTree?.Count > 0)
+                            {
+                                foreach(var c in _filter.ConditionTree)
+                                {
+                                    <Tag Closable OnClose="()=>RemoveCondition(c)">@ConvertFiledCondition2String(c)</Tag>
+                                }
+                            }
+                        </Col>
+                    </Row>
+                    
+                    
+                    
                 </Header>
                 <ChildContent Context="item">
                     <ListItem>
@@ -52,13 +71,13 @@
                                     <DescriptionsItem Span="1">
                                         <Space>
                                             <SpaceItem>
-                                            @if(item.DRRCalim != null)
+                                                @if(item.DRRCalim != null)
                                                 {
-                                                    <Statistic Title="初稿&返稿相似度" Value="@($"{(item.DRRCalim.TextSimilarity*100.00).ToString("0.00")}%")" PrefixTemplate="@prefix1" />
+                                                    <Statistic Title="初稿&返稿权要相似度" Value="@($"{(item.DRRCalim.TextSimilarity*100.00).ToString("0.00")}%")" PrefixTemplate="@prefix1" />
                                                 }
                                                 else
                                                 {
-                                                    <Statistic Title="返稿&定稿相似度" Value="0" PrefixTemplate="@prefix1" />
+                                                    <Statistic Title="返稿&定稿权要相似度" Value="0" PrefixTemplate="@prefix1" />
                                                 }
                                             </SpaceItem>
                                             <SpaceItem>
@@ -82,20 +101,246 @@
                     </ListItem>
                 </ChildContent>
                 <Footer>
-                    <Pagination @bind-Current="_pageIndex" Total="_total" OnChange="OnPageChange" />
+                    <div>
+                        @if (((_total % _pageSize == 0) ? _total / _pageSize : (_total / _pageSize + 1)) > 1)
+                        {
+                            <div style="float:right">
+                                @if (_pageIndex > 1)
+                                {
+                                    <Tooltip Title="@("上一页")">
+                                        <Button Type="@ButtonType.Default" Icon="@IconType.Outline.LeftCircle"  OnClick="()=>OnPageChange(_pageIndex-1)"/>
+                                    </Tooltip>
+                                }
+                                else
+                                {
+                                    <Tooltip Title="@("上一页")">
+                                        <Button Type="@ButtonType.Default"  Icon="@IconType.Outline.LeftCircle"  OnClick="()=>OnPageChange(_pageIndex-1)"   
+                                                Disabled
+                                         />
+                                     </Tooltip>
+                                }
+
+                                @{
+                                    int _totalPages = ((_total % _pageSize == 0) ? _total / _pageSize : (_total / _pageSize + 1));
+                                    int start = ((_pageIndex - 5) < 0 ? 1 : (_pageIndex - 5));
+                                    int end = ((_pageIndex + 5) > _totalPages ? _totalPages : (_pageIndex + 5));
+
+                                    Console.WriteLine($"开始:{start},结束:{end}");
+                                    for (int iPage = start; iPage <= end; iPage++)
+                                    {
+                                        int iTem = iPage;
+                                        if (iTem == _pageIndex)
+                                        {
+                                            <Button Type="@ButtonType.Primary" Shape="@ButtonShape.Circle">@((MarkupString)iTem.ToString())</Button>
+                                        }
+                                        else
+                                        {
+                                            <Button Type="@ButtonType.Default" Shape="@ButtonShape.Circle"  OnClick="()=>OnPageChange(iTem)">@((MarkupString)iTem.ToString())</Button>
+                                        }
+                                    }
+                                }
+
+                                @if (_pageIndex < ((_total % _pageSize == 0) ? _total / _pageSize : (_total / _pageSize + 1)))
+                                {
+                                    <Tooltip Title="@("下一页")">
+                                        <Button Type="@ButtonType.Default"  Icon="@IconType.Outline.RightCircle" OnClick="()=>OnPageChange(_pageIndex+1)"/>
+                                    </Tooltip>
+                                }
+                                else
+                                {
+                                    <Tooltip Title="@("下一页")">
+                                        <Button Type="@ButtonType.Default"  Icon="@IconType.Outline.RightCircle" OnClick="()=>OnPageChange(_pageIndex+1)"     
+                                                Disabled
+                                         />
+                                     </Tooltip>
+                                }
+                            总数:@_total
+                        </div>
+                    }
+                    </div>
                 </Footer>
             </AntList>
             
-            
-            
         </div>
         
     </ChildContent>
 </PageContainer>
 
+<Modal Title="@("对比详情")"
+       Visible="@_DetailShow"
+       OnOk="@btnOk"
+       OnCancel="@btnCancel"
+       Centered="@true"
+       Width="800" 
+       >
+            <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.DRRFulltext?.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.RFRFulltext?.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.DRRFulltext?.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.RFRFulltext?.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:300px;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>
+    
+</Modal>
 
 @code
 {
     RenderFragment prefix1 =@<Icon Type="like" />;
-}
-    
+}

+ 55 - 7
wispro.sp.web/Pages/CompareFile/List.razor.cs

@@ -8,6 +8,9 @@ using AntDesign.TableModels;
 using System.Threading.Tasks;
 using wispro.sp.web.Services;
 using wispro.sp.share;
+using Microsoft.AspNetCore.Components.Web;
+using Newtonsoft.Json.Linq;
+using System.Linq;
 
 namespace wispro.sp.web.Pages.CompareFile
 {
@@ -23,6 +26,10 @@ namespace wispro.sp.web.Pages.CompareFile
         QueryFilter _filter;
         Field _selectedItem;
         List<CaseInfo> _caseList;
+        bool _DetailShow = false;
+        int _value = 1;
+        int _ShowResultString = 1;
+
         List<Field> _fields = new List<Field>() { 
             new Field(){ FieldName="处理人",FieldValue="Handlers"},
             new Field(){ FieldName="审核人",FieldValue="Reviewer.Name"},
@@ -32,9 +39,9 @@ namespace wispro.sp.web.Pages.CompareFile
         };
         protected override async Task OnInitializedAsync()
         {
-            _filter = new QueryFilter();
-            _filter.PageIndex = 1;
-            _filter.PageSize = 1;
+            await _authService.CanVisitResource();
+
+            
 
             await GetData();
 
@@ -52,7 +59,7 @@ namespace wispro.sp.web.Pages.CompareFile
         {
             if (!string.IsNullOrEmpty(txtValue))
             {
-                _filter.ConditionTree.Clear();
+                _pageIndex = 1;
                 _filter.ConditionTree.Add(
                     new FieldCondition()
                     {
@@ -65,8 +72,32 @@ namespace wispro.sp.web.Pages.CompareFile
                 );
             }
 
+            await GetData();
+            StateHasChanged();
+        }
+
+        private string ConvertFiledCondition2String(FieldCondition c)
+        {
+            if(c != null)
+            {
+                var f = _fields.Where(s => s.FieldValue == c.FieldName).FirstOrDefault();
+                if(f != null)
+                {
+                    return $"{f.FieldName}={c.Value}";
+                }
+
+            }
+
+            return string.Empty;
+        }
 
+        private async void RemoveCondition(FieldCondition c)
+        {
+            Console.WriteLine($"{c.FieldName}={c.Value}");
 
+            _pageIndex = 1;
+            _filter.ConditionTree.Remove(c);
+            
             await GetData();
             StateHasChanged();
         }
@@ -90,13 +121,31 @@ namespace wispro.sp.web.Pages.CompareFile
         private void Showdetail(CaseInfo caseInfo)
         {
             _currentCase = caseInfo;
+            _DetailShow = true;
 
         }
 
+        private void btnOk(MouseEventArgs e)
+        {
+            _DetailShow = false;
+        }
+
+        private void btnCancel(MouseEventArgs e)
+        {
+            _DetailShow = false;
+        }
+
 
         private async Task GetData()
         {
             _loading = true;
+            if (_filter == null)
+            {
+                _filter = new QueryFilter();
+            }
+            _filter.PageIndex = _pageIndex;
+            _filter.PageSize = _pageSize;
+
             var data = await _CompareFileService.Query(_filter);
             _caseList = data.Results;
             _total = data.TotalCount;
@@ -105,10 +154,9 @@ namespace wispro.sp.web.Pages.CompareFile
             StateHasChanged();
         }
 
-        async void OnPageChange(PaginationEventArgs args)
+        async void OnPageChange(int PageIndex)
         {
-            _pageIndex = args.Page;
-            _pageSize = args.PageSize;
+            _pageIndex = PageIndex;
 
             await GetData();
 

+ 13 - 7
wispro.sp.web/Services/AuthService.cs

@@ -105,16 +105,22 @@ namespace wispro.sp.web.Services
             }
             else
             {
-                
-                foreach (var uRole in _user.Roles)
+                if (Roles.Contains(_user.Userid?.ToString()))
+                {
+                    canVisist = true;
+                }
+                else
                 {
-                    //Console.WriteLine(uRole);
-                    foreach(var role in Roles)
+                    foreach (var uRole in _user.Roles)
                     {
-                        if(uRole.Contains(role))
+                        foreach (var role in Roles)
                         {
-                            canVisist = true;
-                            break;
+                            Console.WriteLine($"user:{uRole},{role}");
+                            if (uRole == role)
+                            {
+                                canVisist = true;
+                                break;
+                            }
                         }
                     }
                 }

+ 4 - 1
wispro.sp.winClient/frmCaseFileCompare.cs

@@ -379,7 +379,10 @@ namespace wispro.sp.winClient
             {
                 CompareFiles(draftFile, returnFile, finalFile, caseInfo);
 
-                SaveCompareResult(caseInfo);
+                for (int k = 0; k < 10; k++)
+                {
+                    SaveCompareResult(caseInfo);
+                }
 
             }