Przeglądaj źródła

添加我的核稿清单功能

luocaiyang 3 lat temu
rodzic
commit
9988875a18

+ 19 - 3
wispro.sp.api/Controllers/PerformanceItemController.cs

@@ -1135,7 +1135,17 @@ namespace wispro.sp.api.Controllers
             }
             else
             {
-                strCalMonth = $"s.CalMonth.Status == {Convert.ToInt32(queryFilter.jxType)}";
+                if(queryFilter.jxType == jxType.finished)
+                {
+                    strCalMonth = $"s.CalMonth.Status == 4";
+                }
+                else
+                {
+                    strCalMonth = $"s.CalMonth.Status != 4";
+                }
+
+                
+                //strCalMonth = $"s.CalMonth.Status == {Convert.ToInt32(queryFilter.jxType)}";
             }
 
             if (!string.IsNullOrEmpty(strExpress))
@@ -1163,8 +1173,14 @@ namespace wispro.sp.api.Controllers
             IQueryable<PerformanceItem> response;
             if (queryFilter.userId > 0)
             {
-                response = new spDbContext().PerformanceItems.Where<PerformanceItem>(dynamicWhere).Where(s => (s.ItemStaffs.Where<ItemStaff>(iStaff => iStaff.DoPerson.Id == queryFilter.userId).Count() > 0));// || s.ReviewerId == queryFilter.userId));
-
+                if (queryFilter.DoingOrReview == 0)
+                {
+                    response = new spDbContext().PerformanceItems.Where<PerformanceItem>(dynamicWhere).Where(s => (s.ItemStaffs.Where<ItemStaff>(iStaff => iStaff.DoPerson.Id == queryFilter.userId).Count() > 0));
+                }
+                else
+                {
+                    response = new spDbContext().PerformanceItems.Where<PerformanceItem>(dynamicWhere).Where(s => s.ReviewerId == queryFilter.userId);
+                }
             }
             else
             {

+ 14 - 1
wispro.sp.api/Job/ImportReportJob.cs

@@ -213,10 +213,23 @@ namespace wispro.sp.api.Job
                 ProjectInfo project = new ProjectInfo();
                 project.CaseNo = item.CaseNo;
                 project.CaseName = item.CaseName;
+                project.BusinessType = item.BusinessType;
+                
+                
+                if(item.Customer != null)
+                {
+                    var temCustomer = spDb.Customers.FirstOrDefault(c => c.Name == item.Customer.Name);
+                    if(temCustomer != null)
+                    {
+                        project.CustomerId = temCustomer.Id;
+                    }
+                }
+
                 project.CaseState = 0;
                 project.CaseType = item.CaseType;
-                project.CustomerId = item.CustomerId;
+                
                 project.ReviewerId = item.ReviewerId;
+                project.WorkflowUserId = item.WorkflowUserId;
 
                 spDb.ProjectInfos.Add(project);
             }

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

@@ -11,7 +11,7 @@
     "DefaultConnect": "Data Source=(local);Initial Catalog=spDB;User ID=sa;Password=Lqftiu807005"
   },
 
-  "UpdateScheduleSetting": "00 02 16 1,2,3,4,5,6,7,8, * ? *",
+  "UpdateScheduleSetting": "00 15 12 1,2,3,4,5,6,7,8, * ? *",
 
   "ValidAudience": "StaffPerformance",
   "ValidIssuer": "http://localhost:39476",

+ 6 - 0
wispro.sp.share/QueryFilter.cs

@@ -13,6 +13,12 @@ namespace wispro.sp.share
 
         public jxType jxType { get; set; }
 
+        /// <summary>
+        /// 0:我处理的
+        /// 1:我审核的
+        /// </summary>
+        public int DoingOrReview { get; set; }
+
         public IList<OrderField> Sorts { get; set; } = new List<OrderField>();
 
         public int PageSize { get; set; } = 1;

+ 42 - 18
wispro.sp.web/Pages/AppCase/MyCaselist.razor

@@ -31,12 +31,21 @@
             }
             else
             {
-                if (_CurrentKey == "myList")
+                if (_CurrentKey == tabList[0].Key)
                 {
                     <PageHeader>
                         <PageHeaderTitle>基础点数统计</PageHeaderTitle>
                         <PageHeaderExtra>
-                            
+
+                            <Select DataSource="@_Items"
+                                    @bind-Value="@DoingOrReview"
+                                    ValueName="@nameof(SelectItem.Value)"
+                                    LabelName="@nameof(SelectItem.Name)"
+                                    DefaultActiveFirstItem
+                                    Style="width: 200px;"
+                                    OnSelectedItemChanged="OnSelectedItemChangedHandler">
+                            </Select>
+
                             @if (ShowMenu())
                             {
                                 foreach (AppealType at in apTypeService.GetItems(1))
@@ -44,7 +53,7 @@
                                     <Button Type="@ButtonType.Primary" OnClick="() => ShowModel(null, at)">@at.Name</Button>
                                 }
                             }
-                            
+
 
                             @if (isDownloading)
                             {
@@ -135,7 +144,7 @@
                                               @bind-Field="@context.CaseCoefficient" Width="100"
                                               Filters="CaseCoeFilters"
                                               FilterMultiple="false"
-                                              OnFilter="((value,name)=>name.StartsWith(value))"
+                                              OnFilter="((value, name) => name.StartsWith(value))"
                                               Sortable />
                             <AntDesign.Column Title="处理事项" @bind-Field="@context.DoItem" Width="150" Sortable Filterable />
                             <AntDesign.Column Title="处理事项系数" @bind-Field="@context.DoItemCoefficient" Width="150" Sortable Filterable />
@@ -194,19 +203,6 @@
                                         <Descriptions Bordered Size="@DescriptionsSize.Small">
                                             <DescriptionsItem Title="绩效特殊字段" Span="3">
                                                 @context.Data.AgentFeedbackMemo
-                                                @*<Select DataSource="@_afService.GetItems(context.Data)"
-                                                            @bind-Value="@context.Data.AgentFeedbackMemo"
-                                                            LabelName="@nameof(Reason.Name)"
-                                                            ValueName="@nameof(Reason.Value)"
-                                                            Placeholder="请选项一项"
-                                                            DefaultActiveFirstItem="false"
-                                                            EnableSearch="true"
-                                                            AllowClear="true"
-                                                            Style="width:220px;"
-                                                            OnSelectedItemChanged="SelectChanged"
-                                                            OnClearSelected="() => ClearSelect(context.Data.Id)"
-                                                            OnFocus="() => OnFocus(context.Data)">
-                                                    </Select>*@
                                             </DescriptionsItem>
                                             <DescriptionsItem Title="完成时间">@(context.Data.FinishedDate.HasValue ? context.Data.FinishedDate.Value.ToString("yyyy-MM-dd") : "")</DescriptionsItem>
                                             <DescriptionsItem Title="返稿日">@(context.Data.ReturnDate.HasValue ? context.Data.ReturnDate.Value.ToString("yyyy-MM-dd") : "")</DescriptionsItem>
@@ -228,6 +224,33 @@
                 }
                 else
                 {
+
+                    <PageHeader>
+                        <PageHeaderTitle></PageHeaderTitle>
+                        <PageHeaderExtra>
+
+                            <Select DataSource="@_Items"
+                                    @bind-Value="@DoingOrReview"
+                                    ValueName="@nameof(SelectItem.Value)"
+                                    LabelName="@nameof(SelectItem.Name)"
+                                    DefaultActiveFirstItem
+                                    Style="width: 200px;"
+                                    OnSelectedItemChanged="OnSelectedItemChangedHandler">
+                            </Select>
+
+                            @if (isDownloading)
+                            {
+                                <Button Icon="download" Type="@ButtonType.Text" Loading>导出</Button>
+                            }
+                            else
+                            {
+                                <Button Icon="download" Type="@ButtonType.Text" OnClick="() => ExportDataAsync(jxType.finished)">导出</Button>
+                            }
+                        </PageHeaderExtra>
+                        <PageHeaderContent>
+                           
+                        </PageHeaderContent>
+                    </PageHeader>
                     <AntDesign.Table DataSource="_Datas" TItem="PerformanceItem" @ref="@table"
                                      @bind-PageIndex="_pageIndex"
                                      @bind-PageSize="_pageSize"
@@ -250,7 +273,7 @@
                                               @bind-Field="@context.CaseCoefficient" Width="120"
                                               Filters="CaseCoeFilters"
                                               FilterMultiple="false"
-                                              OnFilter="((value,name)=>name.StartsWith(value))"
+                                              OnFilter="((value, name) => name.StartsWith(value))"
                                               Sortable />
                             <AntDesign.Column Title="处理事项" @bind-Field="@context.DoItem" Width="150" Sortable Filterable />
                             <AntDesign.Column Title="处理事项系数" @bind-Field="@context.DoItemCoefficient" Width="150" Sortable Filterable />
@@ -290,6 +313,7 @@
                     </AntDesign.Table>
                 }
             }
+
         </Card>
 
     </ChildContent>

+ 33 - 10
wispro.sp.web/Pages/AppCase/MyCaselist.razor.cs

@@ -43,18 +43,17 @@ namespace wispro.sp.web.Pages.AppCase
         private List<StaffStatistics> MyStatistics;
         IEnumerable<PerformanceItem> selectedItems = new List<PerformanceItem>();
         private CalMonth HandlingCalMonth;
-
+        
 
         int _pageIndex = 1;
         int _pageSize = 10;
         int _total;
         bool _loading = false;
         PerformanceItem EditingItem = null;
-        bool _visible = false;
-        bool _isAdd = false;
+        int DoingOrReview = 0;
 
         List<TabPaneItem> tabList = new List<TabPaneItem>() {
-            new TabPaneItem(){ Key ="myList", Tab ="本月待确认绩效" },
+            new TabPaneItem(){ Key ="myListDoing", Tab ="本月待确认绩效" },
             new TabPaneItem(){  Key ="myAll", Tab ="往期已计算绩效"},
         };
 
@@ -73,7 +72,27 @@ namespace wispro.sp.web.Pages.AppCase
         private Table<PerformanceItem> table;
         private CurrentUser _user;
         private string strAddProjectJX = "";
-        
+
+        class SelectItem
+        {
+            public int Value { get; set; }
+            public string Name { get; set; }
+        }
+
+        List<SelectItem> _Items = new List<SelectItem>()
+        {
+            new SelectItem(){Value =0,Name ="我处理的案件"},
+            new SelectItem(){Value =1,Name ="我审核的案件"}
+        };
+
+        private void OnSelectedItemChangedHandler(SelectItem value)
+        {
+            //_selectedItem = value;
+            //Console.WriteLine($"selected: ${value?.Name}");
+            table.ReloadData();
+            StateHasChanged();
+        }
+
         protected async override Task OnInitializedAsync()
         {
             if (isFirstInit)
@@ -91,6 +110,7 @@ namespace wispro.sp.web.Pages.AppCase
             StateHasChanged();
         }
 
+
         private bool ShowMenu()
         {
             var strlfd = configuration.GetValue<string>("Latest_feedback_date");
@@ -204,7 +224,7 @@ namespace wispro.sp.web.Pages.AppCase
             {
                 _loading = true;
 
-                var data = await _ItemService.Query(_user.Userid.Value, jxType.doing, queryModel);
+                var data = await _ItemService.Query(_user.Userid.Value, jxType.doing, queryModel, DoingOrReview);
 
                 _Datas = data.Results;
                 _total = data.TotalCount;
@@ -213,13 +233,15 @@ namespace wispro.sp.web.Pages.AppCase
             }
             else
             {
+                
                 _loading = true;
-                var data = await _ItemService.Query(_user.Userid.Value, jxType.finished, queryModel);
+                var data = await _ItemService.Query(_user.Userid.Value, jxType.finished, queryModel,DoingOrReview);
 
                 _Datas = data.Results;
                 _total = data.TotalCount;
                 _loading = false;
                 StateHasChanged();
+                
             }
 
 
@@ -231,7 +253,7 @@ namespace wispro.sp.web.Pages.AppCase
         private async Task ExportDataAsync(jxType jxType)
         {
             isDownloading = true;
-            var fileData =await  _ItemService.ExportData(_user.Userid.Value, jxType);
+            var fileData =await  _ItemService.ExportData(_user.Userid.Value, jxType,DoingOrReview);
 
             while(!fileData.Finished)
             {
@@ -243,8 +265,9 @@ namespace wispro.sp.web.Pages.AppCase
 
             isDownloading = false;
 
-        } 
+        }
 
+        bool _visible = false;
         private void OnsubShensu(PerformanceItem Item)
         {
             EditingItem = Item;
@@ -319,7 +342,7 @@ namespace wispro.sp.web.Pages.AppCase
             EditingItem = item;
         }
 
-        string _CurrentKey = "myList";
+        string _CurrentKey = "myListDoing";
         void OnTabChange(string key)
         {
             _CurrentKey = key;

+ 5 - 2
wispro.sp.web/Services/PerformanceItemServices.cs

@@ -66,11 +66,12 @@ namespace wispro.sp.web.Services
             return fileData;
         }
 
-        public async Task<FileProcessTask> ExportData(int userid, jxType jxType)
+        public async Task<FileProcessTask> ExportData(int userid, jxType jxType,int DoingOrReview=0)
         {
             QueryFilter query = new QueryFilter();
             query.userId = userid;
             query.jxType = jxType;
+            query.DoingOrReview = DoingOrReview;
 
             query.PageIndex = 1;
             query.PageSize = 1;
@@ -216,11 +217,13 @@ namespace wispro.sp.web.Services
             return data;
 
         }
-        public async Task<ListApiResponse<PerformanceItem>> Query(int userid, jxType type, QueryModel<PerformanceItem> queryModel)
+
+        public async Task<ListApiResponse<PerformanceItem>> Query(int userid, jxType type, QueryModel<PerformanceItem> queryModel,int DoingOrReview=0)
         {
             QueryFilter query = new QueryFilter();
             query.userId = userid;
             query.jxType = type;
+            query.DoingOrReview = DoingOrReview;
 
             if (queryModel != null)
             {