Browse Source

添加”返稿超60算绩效“的报表
修改发明一次OA超时错误
修改专案列表中不能检索的问题

luocaiyang 1 year ago
parent
commit
51487a3589

+ 7 - 0
wispro.sp.api/Controllers/PerformanceItemController.cs

@@ -9,6 +9,7 @@ using Microsoft.Extensions.Caching.Memory;
 using Microsoft.Extensions.Hosting;
 using Microsoft.Extensions.Hosting;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
 using System.Data;
 using System.Data;
 using System.IO;
 using System.IO;
 using System.Linq;
 using System.Linq;
@@ -4105,6 +4106,12 @@ namespace wispro.sp.api.Controllers
         {
         {
             new ImportReportJob().ImportData(dataType);
             new ImportReportJob().ImportData(dataType);
         }
         }
+
+        [HttpGet,HttpPost]
+        public void InportJXDataByName(string ReportName)
+        {
+            new ImportReportJob().ImportData(ReportName);
+        }
         #endregion
         #endregion
     }
     }
 }
 }

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

@@ -68,7 +68,54 @@ namespace wispro.sp.api.Job
 
 
         
         
         spDbContext spDb = new spDbContext();
         spDbContext spDb = new spDbContext();
-        
+
+        public Task ImportData(string ReportName)
+        {
+            CalMonth calMonth = new CalMonth()
+            {
+                Year = DateTime.Now.AddMonths(-1).Year,
+                Month = DateTime.Now.AddMonths(-1).Month,
+                Status = 0
+            };
+
+
+            var temCalMonth = spDb.CalMonths.Where<CalMonth>(x => x.Year == calMonth.Year && x.Month == calMonth.Month).FirstOrDefault();
+
+            if (temCalMonth != null)
+            {
+
+                var iCount = spDb.PerformanceItems.Where<PerformanceItem>(p => p.CalMonthId == temCalMonth.Id).Count<PerformanceItem>();
+
+                calMonth = temCalMonth;
+            }
+            else
+            {
+
+                spDb.CalMonths.Add(calMonth);
+                spDb.SaveChanges();
+
+            }
+
+            switch (ReportName)
+            {
+                case "每月绩效统计--发客户超过一个月未完成案件":
+                    DownloadReport_SQL(ReportName, calMonth, false);
+                    break;
+                case "每月绩效统计--上个月递交完成案件":
+                    DownloadReport_SQL(ReportName, calMonth, true);
+                    break;
+                case "每月绩效统计--中国一次OA授权表":
+                    DownloadReport_SQL(ReportName, calMonth, true, true);
+                    break;
+                default:
+                    DownloadReport_SQL(ReportName, calMonth, false);
+                    break;
+            }
+
+            return Task.CompletedTask;
+        }
+
+
         public Task ImportData(int i)
         public Task ImportData(int i)
         {
         {
             CalMonth calMonth = new CalMonth()
             CalMonth calMonth = new CalMonth()
@@ -155,6 +202,9 @@ namespace wispro.sp.api.Job
             DownloadReport_SQL("每月绩效统计--中国一次OA授权表", calMonth, true, true);
             DownloadReport_SQL("每月绩效统计--中国一次OA授权表", calMonth, true, true);
             //DownloadReport("每月绩效统计--中国一次OA授权表", calMonth, true,true);
             //DownloadReport("每月绩效统计--中国一次OA授权表", calMonth, true,true);
 
 
+            //新申请返稿超2个月未定稿
+            ImportData("新申请返稿超2个月未定稿");
+
             return Task.CompletedTask;
             return Task.CompletedTask;
         }
         }
 
 

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

@@ -30,7 +30,7 @@
     "isHeadless": "false",
     "isHeadless": "false",
     "Account": "caiyangl",
     "Account": "caiyangl",
     "Password": "j)wx*lier*@3",
     "Password": "j)wx*lier*@3",
-    "ChormeDriverPath": "D:\\source\\repos\\StaffPerformance\\packages\\ChormeDriver\\125.0.6422.141",
+    "ChormeDriverPath": "e:\\source\\repos\\StaffPerformance\\packages\\ChormeDriver\\128.0.6613.86",
     "ScheduleSetting": "00 55 15 16 * ? *",
     "ScheduleSetting": "00 55 15 16 * ? *",
     "IPEasyWeb": "http://47.106.94.35/Login.aspx"
     "IPEasyWeb": "http://47.106.94.35/Login.aspx"
   },
   },

+ 1 - 1
wispro.sp.web/Pages/Project/AssignPoint.razor

@@ -28,7 +28,7 @@
                         {
                         {
                             
                             
                             <FormItem Label="我方文号">
                             <FormItem Label="我方文号">
-                                <Select DataSource="@ProjectInfos"
+                                <Select DataSource="@ShowProjectInfos"
                                         @bind-Value="@task.ProjectContentRecord.ProjectNo"
                                         @bind-Value="@task.ProjectContentRecord.ProjectNo"
                                         LabelName="@nameof(wispro.sp.entity.ProjectInfo.CaseNo)"
                                         LabelName="@nameof(wispro.sp.entity.ProjectInfo.CaseNo)"
                                         ValueName="@nameof(wispro.sp.entity.ProjectInfo.CaseNo)"
                                         ValueName="@nameof(wispro.sp.entity.ProjectInfo.CaseNo)"

+ 1 - 1
wispro.sp.web/Pages/Project/AssignPoint.razor.cs

@@ -82,7 +82,7 @@ namespace wispro.sp.web.Pages.Project
         {
         {
             if (ProjectInfos != null)
             if (ProjectInfos != null)
             {
             {
-                ShowProjectInfos = ProjectInfos.Where<ProjectInfo>(p => p.CaseNo.Contains(value)).ToList();
+                ShowProjectInfos = ProjectInfos.Where<ProjectInfo>(p => p.CaseNo.Contains(value.ToUpper())).ToList();
             }
             }
             StateHasChanged();
             StateHasChanged();
         }
         }

+ 1 - 0
wispro.sp.web/Pages/Welcome.razor.cs

@@ -243,6 +243,7 @@ namespace wispro.sp.web.Pages
                 }
                 }
                 catch (Exception ex)
                 catch (Exception ex)
                 {
                 {
+                    Console.WriteLine($"Error: {ex}");
                     _ModalService.Error(new ConfirmOptions()
                     _ModalService.Error(new ConfirmOptions()
                     {
                     {
                         Title = "审核错误",
                         Title = "审核错误",

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

@@ -198,6 +198,7 @@ namespace wispro.sp.web.Services
             }
             }
             catch(Exception ex)
             catch(Exception ex)
             {
             {
+                Console.WriteLine(ex.Message);
                 return new ApiSaveResponse()
                 return new ApiSaveResponse()
                 {
                 {
                     Success = false,
                     Success = false,

+ 2 - 0
wispro.sp.web/Services/HttpService.cs

@@ -44,10 +44,12 @@ namespace wispro.sp.web.Services
         )
         )
         {
         {
             _httpClient = httpClient;
             _httpClient = httpClient;
+            _httpClient.Timeout = TimeSpan.FromSeconds(1000);
             _navigationManager = navigationManager;
             _navigationManager = navigationManager;
             _localStorageService = localStorageService;
             _localStorageService = localStorageService;
             _configuration = configuration;
             _configuration = configuration;
             authenticationStateProvider = authService;
             authenticationStateProvider = authService;
+            
         }
         }
 
 
         public async Task<T> Get<T>(string uri)
         public async Task<T> Get<T>(string uri)

+ 2 - 2
wispro.sp.winClient/Form1.cs

@@ -902,7 +902,7 @@ namespace wispro.sp.winClient
             return retStr;
             return retStr;
         }
         }
 
 
-        string strAPIBaseUri = "http://localhost:39476"; // "http://1.116.113.26:81";//   "http://47.106.221.167:8081"; //  
+        string strAPIBaseUri = "http://localhost:39476"; //"http://1.116.113.26:81";//    "http://47.106.221.167:8081"; //  
 
 
         userToken Token;
         userToken Token;
 
 
@@ -1439,7 +1439,7 @@ namespace wispro.sp.winClient
             http.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("bearer", Token.Token);
             http.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("bearer", Token.Token);
             //var data = await http.GetFromJsonAsync<ApiSaveResponse>($"{strAPIBaseUri}/api/PerformanceItem/UpdateOAStaff");
             //var data = await http.GetFromJsonAsync<ApiSaveResponse>($"{strAPIBaseUri}/api/PerformanceItem/UpdateOAStaff");
 
 
-            await http.GetAsync($"{strAPIBaseUri}/api/PerformanceItem/ImportJXData?dataType=1");
+            http.GetAsync($"{strAPIBaseUri}/api/PerformanceItem/InportJXDataByName?ReportName=新申请返稿超2个月未定稿");
         }
         }
 
 
         private async void getAPCN_Click(object sender,EventArgs e)
         private async void getAPCN_Click(object sender,EventArgs e)