Bläddra i källkod

1、修正按字数计算时,类型设为新申请BUG;
2、优化已提交验证延迟申诉并审核通过后还显示红色的问题;
3、修正多人处理案件,处理人中有未转正人员绩效计算修正;
4、修正专案工作内容重复提交审核导致分配绩效错误的BUG;
5、修正处理人变更带全角逗号,导致不能审核成功的问题;
6、修正遗漏案件申诉不能审核通过的问题;
7、修正人名带君龙的问题;

luocaiyang 3 år sedan
förälder
incheckning
9d11c9f7a9
36 ändrade filer med 1177 tillägg och 197 borttagningar
  1. 35 17
      wispro.sp.api/AppealHandler/ChangeDoPersonReviewer.cs
  2. 1 1
      wispro.sp.api/AppealHandler/MissingCaseReviewHandler.cs
  3. 60 2
      wispro.sp.api/Controllers/AccountController.cs
  4. 1 1
      wispro.sp.api/Controllers/AppealController.cs
  5. 365 47
      wispro.sp.api/Controllers/PerformanceItemController.cs
  6. 104 32
      wispro.sp.api/Controllers/ProjectController.cs
  7. 117 0
      wispro.sp.api/Controllers/ReportController.cs
  8. 22 15
      wispro.sp.api/Job/ImportReportJob.cs
  9. 1 1
      wispro.sp.api/Job/InvalidDataMessageJob.cs
  10. 1 1
      wispro.sp.api/Job/UpdateJXDataFromIPEasyJob.cs
  11. 21 10
      wispro.sp.api/Utility/Utility.cs
  12. 2 2
      wispro.sp.api/appsettings.json
  13. 1 1
      wispro.sp.api/spDbContext.cs
  14. 34 0
      wispro.sp.share/ChartData.cs
  15. 1 1
      wispro.sp.web/Components/SubmitWorkContent.razor
  16. 16 1
      wispro.sp.web/Layouts/BasicLayout.razor
  17. 1 1
      wispro.sp.web/Pages/AppCase/MyCaselist.razor
  18. 35 19
      wispro.sp.web/Pages/LoginPages.razor
  19. 37 0
      wispro.sp.web/Pages/LoginPages.razor.cs
  20. 5 3
      wispro.sp.web/Pages/Project/AssignPoint.razor
  21. 11 6
      wispro.sp.web/Pages/Project/AssignPoint.razor.cs
  22. 1 1
      wispro.sp.web/Pages/Project/MyProject.razor
  23. 37 0
      wispro.sp.web/Pages/Project/MyProject.razor.cs
  24. 20 13
      wispro.sp.web/Pages/Project/ProjectReviewer.razor
  25. 31 0
      wispro.sp.web/Pages/Report/PieChart.razor
  26. 71 0
      wispro.sp.web/Pages/Report/PieChart.razor.cs
  27. 18 11
      wispro.sp.web/Pages/Welcome.razor.cs
  28. 1 0
      wispro.sp.web/Program.cs
  29. 9 6
      wispro.sp.web/Services/AppealTypeService.cs
  30. 7 0
      wispro.sp.web/Services/AuthService.cs
  31. 2 0
      wispro.sp.web/Services/IAuthService.cs
  32. 1 0
      wispro.sp.web/Services/PerformanceItemServices.cs
  33. 40 0
      wispro.sp.web/Services/ReportService.cs
  34. 2 1
      wispro.sp.web/wwwroot/index.html
  35. 57 4
      wispro.sp.winClient/Form1.cs
  36. 9 0
      wospro.sp.entity/ProjectContentRecord.cs

+ 35 - 17
wispro.sp.api/AppealHandler/ChangeDoPersonReviewer.cs

@@ -62,27 +62,40 @@ namespace wispro.sp.api.AppealHandler
                 {
                     var itemStaffs = ((spDbContext)spContext).ItemStaffs.Include(p=>p.DoPerson).Where(s => s.ItemId == appRecord.ItemId.Value);
 
-                    var oldPersons = strOldPerson.Split(new char[] { ' ', ',' },StringSplitOptions.RemoveEmptyEntries);
-                    var newPersons = strNewPerson.Split(new char[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries);
+                    var oldPersons = strOldPerson.Split(new char[] { ' ', ',', ',' },StringSplitOptions.RemoveEmptyEntries);
+                    var newPersons = strNewPerson.Split(new char[] { ' ', ',', ',' }, StringSplitOptions.RemoveEmptyEntries);
                     
-                    bool oldPersonExist = false;
+                    bool oldPersonExist = true;
                     List<ItemStaff> waitingRemoveObj = new List<ItemStaff>();
 
-                    foreach (ItemStaff staff in itemStaffs)
+                    foreach(var temName in oldPersons)
                     {
-                        if (oldPersons.Contains(staff.DoPerson.Name))
+                        var temItemStaff = itemStaffs.Where(s => s.DoPerson.Name == temName).FirstOrDefault();
+                        if(temItemStaff == null)
                         {
-                            waitingRemoveObj.Add(staff);
-                            
-                            oldPersonExist = true;
-                            
+                            oldPersonExist = false;
+                            break;
                         }
                         else
                         {
-                            oldPersonExist = false;
-                            break;
+                            waitingRemoveObj.Add(temItemStaff);
                         }
                     }
+                    //foreach (ItemStaff staff in itemStaffs)
+                    //{
+                    //    if (oldPersons.Contains(staff.DoPerson.Name))
+                    //    {
+                    //        waitingRemoveObj.Add(staff);
+                            
+                    //        oldPersonExist = true;
+                            
+                    //    }
+                    //    else
+                    //    {
+                    //        oldPersonExist = false;
+                    //        break;
+                    //    }
+                    //}
 
                     
 
@@ -93,14 +106,19 @@ namespace wispro.sp.api.AppealHandler
                         foreach (var temName in newPersons)
                         {
                             var newStaff = ((spDbContext)spContext).Staffs.FirstOrDefault(s => s.Name == temName.Trim());
-
-                            if (newStaff != null)
+                            
+                            if (newStaff != null )
                             {
-                                ((spDbContext)spContext).ItemStaffs.Add(new ItemStaff()
+                                var temItemStaff = ((spDbContext)spContext).ItemStaffs.Where(s => s.ItemId == appRecord.ItemId.Value && s.DoPersonId == newStaff.Id).FirstOrDefault();
+
+                                if (temItemStaff == null)
                                 {
-                                    ItemId = appRecord.ItemId.Value,
-                                    DoPersonId = newStaff.Id
-                                });
+                                    ((spDbContext)spContext).ItemStaffs.Add(new ItemStaff()
+                                    {
+                                        ItemId = appRecord.ItemId.Value,
+                                        DoPersonId = newStaff.Id
+                                    });
+                                }
                             }
                             else
                             {

+ 1 - 1
wispro.sp.api/AppealHandler/MissingCaseReviewHandler.cs

@@ -67,7 +67,7 @@ namespace wispro.sp.api.AppealHandler
                 
                 PerformanceItem Item = itemControler.GetItemInfoByCaseStage(strCaseNo,strDoItem, strCaseStage);
 
-
+                
                 var Rules = ((spDbContext)spContext).BasePointRules.ToList();
                 
                 Utility.Utility.CalBasePoint(Item, Rules);

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 60 - 2
wispro.sp.api/Controllers/AccountController.cs


+ 1 - 1
wispro.sp.api/Controllers/AppealController.cs

@@ -224,7 +224,7 @@ namespace wispro.sp.api.Controllers
                 {
                     t.Rollback();
 
-                    response.Success = true;
+                    response.Success = false;
                     response.ErrorMessage = ex.Message;
                     return response;
                 }

+ 365 - 47
wispro.sp.api/Controllers/PerformanceItemController.cs

@@ -213,7 +213,7 @@ namespace wispro.sp.api.Controllers
             string[] values = new string[] { null };
             if (!string.IsNullOrEmpty(value))
             {
-                values = value.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
+                values = value.Split(new char[] { '|' });
             }
 
             if (fields.Length != values.Length) {
@@ -250,9 +250,10 @@ namespace wispro.sp.api.Controllers
                             }
                             else
                             {
-                                ret.Success = false;
-                                ret.ErrorMessage = "所给的栏位值不能转换成数字!";
-                                return ret;
+                                item.WordCount = null;
+                                //ret.Success = false;
+                                //ret.ErrorMessage = "所给的栏位值不能转换成数字!";
+                                //return ret;
                             }
                             break;
                         case "ReturnCasseNo":
@@ -433,6 +434,11 @@ namespace wispro.sp.api.Controllers
                 {
                     string strCaseCeoffcient = item.CaseCoefficient;
 
+                    if (string.IsNullOrEmpty(strCaseCeoffcient))
+                    {
+                        strCaseCeoffcient = "B";
+                    }
+
                     #region 严重延期降系数
                     if (item.isDanger() && string.IsNullOrEmpty(item.OverDueMemo))
                     {
@@ -471,6 +477,10 @@ namespace wispro.sp.api.Controllers
                         case "D":
                             retObj.D += 1;
                             break;
+                        default:
+                            retObj.B += 1;
+                            break;
+
                     }
 
                     if (CaseXiShu.ContainsKey(strCaseCeoffcient))
@@ -657,6 +667,9 @@ namespace wispro.sp.api.Controllers
                 new Job.UpdateJXDataFromIPEasyJob().UpdateFromIPEasy(Item, Context);
             }
 
+            Utility.Utility.CalBasePoint(Item, Context.BasePointRules.ToList());
+            Context.SaveChanges();
+
             return new ApiSaveResponse()
             {
                 Success = true
@@ -699,8 +712,40 @@ namespace wispro.sp.api.Controllers
             };
         }
 
-        private void Export2ExcelThread()
+        public FileProcessTask CurrentData2Excel()
+        {
+            
+            CalMonth calMonth = Context.CalMonths.FirstOrDefault(c => c.Status == 0);
+            if (calMonth != null)
+            {
+                var filename = $"{DateTime.Now.ToString("yyyyMMddhhmmss")}-{calMonth.Year}{calMonth.Month}线下绩效核算数据.xlsx";
+                var attachfileSavePath = utility.ConfigHelper.GetSectionValue("AttachFileSavePath");
+                var filePath = Path.Combine(attachfileSavePath, filename);
+
+                var fileTask = new FileProcessTask()
+                {
+                    Id = Guid.NewGuid().ToString(),
+                    FileName = filename,
+                    FilePath = filePath,
+                    Processed = 0
+                };
+
+                fileTaskService.Add(fileTask);
+
+                System.Threading.Thread t = new System.Threading.Thread(new ParameterizedThreadStart(Export2ExcelThread));
+                t.Start(fileTask);
+
+                return fileTask;
+            }
+
+            return null;
+            
+        }
+        
+        private void Export2ExcelThread(object attfile)
         {
+            FileProcessTask file = (FileProcessTask)attfile;
+
             spDbContext spDb = new spDbContext();
             List<PerformanceItem> items = spDb.PerformanceItems
                 .Include(p => p.Reviewer).ThenInclude(p => p.StaffGrade)
@@ -754,8 +799,43 @@ namespace wispro.sp.api.Controllers
             var verifyCeoffients = spDb.VerifyCoefficients.ToList();
             var Rules = spDb.BasePointRules.ToList();
 
+            file.Size = items.Count;
             foreach(var p in items)
             {
+                
+                System.Diagnostics.Debug.WriteLine(p.CaseNo);
+                
+
+                List<ItemStaff> temItemStaffs = p.ItemStaffs.ToList();
+
+                string strCaseMemo = "";
+                if (p.ItemStaffs.Count > 1)
+                {
+                    temItemStaffs = new List<ItemStaff>();
+                    foreach (var iStaff in p.ItemStaffs)
+                    {
+                        if (iStaff.DoPerson.Status != "试用期")
+                        {
+                            temItemStaffs.Add(iStaff);
+                        }
+                        else
+                        {
+                            strCaseMemo = string.IsNullOrEmpty(strCaseMemo) ? $"{iStaff.DoPerson.Name}" : $"{strCaseMemo},{iStaff.DoPerson.Name}";
+                        }
+                    }
+                }
+
+                if (!string.IsNullOrEmpty(strCaseMemo))
+                {
+                    strCaseMemo = $"{strCaseMemo}在试用期";
+                }
+
+                string temDoPerson = "";
+                foreach(var iStaff in temItemStaffs)
+                {
+                    temDoPerson =string.IsNullOrEmpty(temDoPerson)?iStaff.DoPerson.Name:$"{temDoPerson},{iStaff.DoPerson.Name}";
+                }
+
                 Utility.Utility.CalBasePoint(p, Rules);
                 var jxList = _calItemJX(p.CalMonth, verifyCeoffients, p, spDb);
 
@@ -765,33 +845,45 @@ namespace wispro.sp.api.Controllers
                 {
                     isReviewerInDopersons = (p.ItemStaffs.Where(i => i.DoPersonId == p.ReviewerId).Count() > 0);
                 }
-                
-                double total = p.ItemStaffs.Count();
-                if (p.ItemStaffs.Where<ItemStaff>(p => p.PerformancePoint != null || p.PerformancePoint == 0).Count() > 0)
+
+                double total = temItemStaffs.Count();
+                if (temItemStaffs.Where<ItemStaff>(p => p.PerformancePoint != null || p.PerformancePoint == 0).Count() > 0)
                 {
-                    total = p.ItemStaffs.Select(i => i.PerformancePoint.Value).Sum();
+                    total = temItemStaffs.Select(i => i.PerformancePoint.Value).Sum();
                     isPJFP = false;
                 }
 
-                foreach (var iStaff in p.ItemStaffs)
+                foreach (var iStaff in temItemStaffs)
                 {
                     DataRow row = dt.NewRow();
                     row["我方文号"] = p.CaseNo;
                     row["申请类型"] = p.ApplicationType;
 
-                    if(p.Customer.Name.Contains("OPPO") && p.ApplicationType == "实用新型")
+                    if(p.ApplicationName != null && p.ApplicationName.Contains("OPPO") && p.ApplicationType == "实用新型")
                     {
                         row["申请类型"] = "发明";
                         row["案件备注"] = $"{row["案件备注"]}\r\nOPPO案件实用新型修改为发明】";
                     }
-
+                    row["处理事项"] = p.DoItem;
                     row["业务类型"] = p.BusinessType;
                     row["备注(填表注意事项)"] = p.AgentFeedbackMemo;
-                    row["处理事项"] = p.DoItem;
+
+                    if(p.Type == "专案")
+                    {
+                        row["备注(填表注意事项)"] = $"{row["备注(填表注意事项)"]}【主管给定点数】专案";
+                        row["处理事项"] = "提出报告";
+
+                    }
+
+                    if(temItemStaffs.Count > 1)
+                    {
+                        row["备注(填表注意事项)"] = $"{row["备注(填表注意事项)"]},{temDoPerson}合写";
+                    }
+                    
                     row["案件阶段"] = p.CaseStage;
                     
                     row["案件系数"] = p.CaseCoefficient;
-                    if(p.isDanger() && string.IsNullOrEmpty(p.OverDueMemo))
+                    if(p.isDanger() && string.IsNullOrEmpty(p.OverDueMemo) && p.Type =="新申请")
                     {
                         switch (p.CaseCoefficient)
                         {
@@ -814,53 +906,88 @@ namespace wispro.sp.api.Controllers
 
                     row["处理事项系数"] = p.DoItemCoefficient;
                     row["前一次OA处理事项系数"] = "";
-                    row["前一次OA处理人"] = p.PreOastaff.Name;
+                    row["前一次OA处理人"] = p.PreOastaff?.Name;
 
                     if(iStaff.DoPerson.Status == "试用期")
                     {
                         row["实际处理人"] = iStaff.DoPerson.Name;
                         row["案件备注"] = $"{row["案件备注"]}\r\n处理人{iStaff.DoPerson.Name}未转正";
-                        row["处理人"] = p.Reviewer.Name;
-                        row["处理人等级"] = p.Reviewer.StaffGrade.Grade;
+                        row["处理人"] = p.Reviewer?.Name;
+                        row["处理人等级"] = p.Reviewer?.StaffGrade?.Grade;
                         row["基本点数"] = (p.BasePoint / total).ToString();
-                       
+                        row["处理人绩效系数"] = p.Reviewer?.StaffGrade?.Coefficient;
+
+                        var clrJX = jxList.Where(j => j.StaffId == p.ReviewerId && j.jxType.Contains("处理")).FirstOrDefault();
+                        if (clrJX != null)
+                        {
+                            row["系统核算绩效"] = clrJX.totalBasePoint;
+                        }
+
                         row["核稿人"] = "";
                         row["核稿系数"] = "";
                         row["核稿绩效"] = "";
-                        row["处理人绩效系数"] = p.Reviewer.StaffGrade.Coefficient;
-                        row["系统核算绩效"] = "";
+                        
+                        
                     }
                     else
                     {
                         row["处理人"] = iStaff.DoPerson.Name;
-                        row["处理人等级"] = iStaff.DoPerson.StaffGrade.Grade;
+                        row["处理人等级"] = iStaff.DoPerson.StaffGrade?.Grade;
                         row["基本点数"] = (p.BasePoint / total).ToString();
-                        row["处理人绩效系数"] = iStaff.DoPerson.StaffGrade.Coefficient;
-                        row["系统核算绩效"] = "";
+                        row["处理人绩效系数"] = iStaff.DoPerson.StaffGrade?.Coefficient;
+                        
 
                         if (isReviewerInDopersons)
                         {
                             row["核稿人"] = "";
                             row["核稿系数"] = "";
                             row["核稿绩效"] = "";
-                            row["处理人绩效系数"] = "";
-                            row["系统核算绩效"] = "";
+                            
+                            
                             row["案件备注"] = $"{row["案件备注"]}\r\n核稿人与处理人一致,置空核稿人栏位";
+
+                            var clrJX = jxList.Where(j => j.StaffId == p.ReviewerId && j.jxType.Contains("处理")).FirstOrDefault();
+                            if (clrJX != null)
+                            {
+                                row["系统核算绩效"] = clrJX.totalBasePoint;
+                            }
                         }
                         else
                         {
-                            row["核稿人"] = p.Reviewer?.Name;
-                            var vCoefficient = Context.VerifyCoefficients.FirstOrDefault(c => c.CheckerId == p.ReviewerId && c.DoPersonId == iStaff.DoPersonId);
-                            if (vCoefficient != null)
+                            var clrJX = jxList.Where(j => j.StaffId == iStaff.DoPersonId && j.jxType.Contains("处理")).FirstOrDefault();
+                            if (clrJX != null)
+                            {
+                                row["系统核算绩效"] = clrJX.totalBasePoint;
+                            }
+
+                            if (p.Reviewer != null)
+                            {
+                                row["核稿人"] = p.Reviewer?.Name;
+
+                                var temJX = jxList.FirstOrDefault(j => j.StaffId == p.ReviewerId && j.jxType.Contains("审核"));
+                                if(temJX != null)
+                                {
+                                    row["核稿绩效"] = temJX.totalBasePoint;
+                                }
+                                var vCoefficient = spDb.VerifyCoefficients.FirstOrDefault(c => c.CheckerId == p.Reviewer.StaffGradeId && c.DoPersonId == iStaff.DoPerson.StaffGradeId);
+                                if (vCoefficient != null)
+                                {
+                                    row["核稿系数"] = vCoefficient.Coefficient;
+                                    //row["核稿绩效"] = (p.BasePoint / total) * vCoefficient.Coefficient;
+                                }
+                            }
+                            else
                             {
-                                row["核稿系数"] = vCoefficient.Coefficient;
-                                row["核稿绩效"] = (p.BasePoint / total) * vCoefficient.Coefficient;
+                                row["核稿人"] = "";
+                                row["核稿系数"] = "";
+                                row["核稿绩效"] = "";
+                                
                             }
                         }
                         
                     }
 
-                    row["客户名称"] = p.Customer.Name;
+                    row["客户名称"] = p.Customer?.Name;
                     row["申请人"] = p.ApplicationName;
                     row["处理事项完成日"] = p.FinishedDate?.ToString("yyyy-MM-dd");
                     row["定稿日"] = p.FinalizationDate?.ToString("yyyy-MM-dd");
@@ -876,13 +1003,21 @@ namespace wispro.sp.api.Controllers
                     row["初稿日"] = p.FirstDraftDate?.ToString("yyyy-MM-dd");
                     row["备注(发文严重超期是否属客观原因,若为否,请填写原因"] = p.OverDueMemo;
                     row["绩效类型"] = p.Type;
-                    row["案件备注"] = p.CaseMemo;
+                    row["案件备注"] = $"{p.CaseMemo}\r\n{row["案件备注"]}";
+                    if(!string.IsNullOrEmpty(strCaseMemo))
+                    {
+                        row["案件备注"] = $"{strCaseMemo}\r\n{row["案件备注"]}";
+                    }
                     
                     dt.Rows.Add(row);
                 }
+                
+                file.Processed += 1;
+                
             }
 
-            NPOIExcel.DataTableToExcel(dt,$"c:\\temp\\{DateTime.Now.ToString("yyyyMMddhhmmss")}-线下绩效核算数据.xlsx");
+            NPOIExcel.DataTableToExcel(dt, file.FilePath);
+            file.Finished = true;
         }
 
         private void _CompareExcel2DB()
@@ -1375,13 +1510,7 @@ namespace wispro.sp.api.Controllers
             
             System.Collections.Hashtable doPersonsBL = new System.Collections.Hashtable();
 
-            bool isPJFP = true;
-            double total = item.ItemStaffs.Count();
-            if (item.ItemStaffs.Where<ItemStaff>(p => p.PerformancePoint != null || p.PerformancePoint == 0).Count() > 0)
-            {
-                total = item.ItemStaffs.Select(i => i.PerformancePoint.Value).Sum();
-                isPJFP = false;
-            }
+            
 
             List<StaffStatistics> itemStatistics = new List<StaffStatistics>();
 
@@ -1391,7 +1520,29 @@ namespace wispro.sp.api.Controllers
                 //spDb.Entry(item.Reviewer).Reference(b => b.StaffGrade).Load();
             }
 
-            foreach (ItemStaff itemStaff in item.ItemStaffs)
+            List<ItemStaff> temIStaffs = new List<ItemStaff>();
+            foreach(var itemStaff in item.ItemStaffs)
+            {
+                if (itemStaff.DoPerson == null)
+                {
+                    itemStaff.DoPerson = spDb.Staffs.Include(s => s.StaffGrade).FirstOrDefault(p => p.Id == itemStaff.DoPersonId);
+                }
+
+                if(itemStaff.DoPerson.Status != "试用期")
+                {
+                    temIStaffs.Add(itemStaff);
+                }
+            }
+
+            bool isPJFP = true;
+            double total = temIStaffs.Count();
+            if (temIStaffs.Where<ItemStaff>(p => p.PerformancePoint != null || p.PerformancePoint == 0).Count() > 0)
+            {
+                total = temIStaffs.Select(i => i.PerformancePoint.Value).Sum();
+                isPJFP = false;
+            }
+
+            foreach (ItemStaff itemStaff in temIStaffs)
             {
                 if(itemStaff.DoPerson == null)
                 {
@@ -1473,7 +1624,15 @@ namespace wispro.sp.api.Controllers
                     }
                     else
                     {
-                        handlerBasePoint = itemStaff.PerformancePoint.Value;
+                        if(item.ItemStaffs.Count ==1 && itemStaff .PerformancePoint == 0)
+                        {
+                            handlerBasePoint = item.BasePoint.Value;
+                        }
+                        else
+                        {
+                            handlerBasePoint = itemStaff.PerformancePoint.Value;
+                        }
+                        
                     }
                 }
 
@@ -1481,7 +1640,7 @@ namespace wispro.sp.api.Controllers
                 var temStatic = itemStatistics.Where<StaffStatistics>(s => s.StaffId == itemStaff.DoPersonId && s.jxType == handlerJxType && s.CalMonth.Id == calMonth.Id).FirstOrDefault();
                 if (temStatic != null)
                 {
-                    if (item.Type != "专案")
+                    if (item.Type == "OA" || item.Type =="新申请")
                     {
                         temStatic.totalBasePoint += handlerBasePoint * itemStaff.DoPerson.StaffGrade.Coefficient;
                     }
@@ -1494,7 +1653,7 @@ namespace wispro.sp.api.Controllers
                 {
                     if (itemStaff.DoPerson.StaffGradeId  != null && itemStaff.DoPerson.IsOnJob)
                     {
-                        if (item.Type != "专案")
+                        if (item.Type == "OA" || item.Type == "新申请")
                         {
                             if (itemStaff.DoPerson.Status == "试用期" && item.Reviewer != null)
                             {
@@ -2123,19 +2282,178 @@ namespace wispro.sp.api.Controllers
             return retObj;
         }
 
-        public PerformanceItem GetItemInfoByCaseStage(string CaseNo, string DoItem,string caseStage)
+        public PerformanceItem GetItemInfoByCaseStage(string CaseNo, string DoItem,string caseStage,bool UpdateFromIPEasy=true)
         {
             var retObj = Context.PerformanceItems.Include(p=>p.Customer).FirstOrDefault<PerformanceItem>(p => p.CaseNo == CaseNo.Trim() 
             && p.DoItem == DoItem.Trim() && p.CaseStage == caseStage);
 
-            if (retObj == null)
+            if (retObj == null && UpdateFromIPEasy)
             {
-                retObj = IPEasyUtility.GetPerformanceRecord(CaseNo, DoItem, caseStage);
+                var temObj = IPEasyUtility.GetPerformanceRecord(CaseNo, DoItem, caseStage);
+
+                
+                System.Dynamic.ExpandoObject temExpandoObject = (System.Dynamic.ExpandoObject)temObj;
+
+                retObj = new PerformanceItem();
+                retObj.CaseNo = temObj.CaseNo.ToString();
+                retObj.CaseName = temObj.CaseName.ToString();
+
+                try
+                {
+                    if (temObj.ApplicationType != null)
+                        retObj.ApplicationType = temObj.ApplicationType.ToString();
+
+                    if (temObj.CaseMemo != null)
+                        retObj.CaseMemo = temObj.CaseMemo.ToString();
+
+                    if (temObj.BusinessType != null)
+                        retObj.BusinessType = temObj.BusinessType.ToString();
+
+                    if (temObj.DoItem != null)
+                        retObj.DoItem = temObj.DoItem.ToString();
+
+                    if (temObj.CaseStage != null)
+                        retObj.CaseStage = temObj.CaseStage.ToString();
+
+                    if (temObj.CaseType != null)
+                        retObj.CaseType = temObj.CaseType.ToString();
+
+                    if (temObj.DoItemState != null)
+                        retObj.DoItemState = temObj.DoItemState.ToString();
+
+                    if (temObj.DoItemCoefficient != null)
+                        retObj.DoItemCoefficient = temObj.DoItemCoefficient.ToString();
+
+                    if (temObj.CaseCoefficient != null)
+                        retObj.CaseCoefficient = temObj.CaseCoefficient.ToString();
+
+                    if (temObj.EntrustingDate != null)
+                    {
+                        if (!string.IsNullOrEmpty(temObj.EntrustingDate.ToString()))
+                            retObj.EntrustingDate = DateTime.Parse(temObj.EntrustingDate.ToString());
+                    }
+                        
+
+                    if (temObj.InternalDate != null)
+                    {
+                        if (!string.IsNullOrEmpty(temObj.InternalDate.ToString()))
+                            retObj.InternalDate = DateTime.Parse(temObj.InternalDate.ToString());
+                    }
+
+                    if (temObj.CustomerLimitDate != null)
+                    {
+                        if (!string.IsNullOrEmpty(temObj.InternalDate.ToString()))
+                            retObj.CustomerLimitDate = DateTime.Parse(temObj.InternalDate.ToString());
+                    }
+
+
+                    if (temObj.ReturnDate != null)
+                    {
+                        if (!string.IsNullOrEmpty(temObj.ReturnDate.ToString()))
+                            retObj.ReturnDate = DateTime.Parse(temObj.ReturnDate.ToString());
+                    }
+
+                    if (temObj.FinalizationDate != null)
+                    {
+                        if (!string.IsNullOrEmpty(temObj.FinalizationDate.ToString()))
+                            retObj.FinalizationDate = DateTime.Parse(temObj.FinalizationDate.ToString());
+                    }
+                    if (temObj.FinishedDate != null)
+                    {
+                        if (!string.IsNullOrEmpty(temObj.FinishedDate.ToString()))
+                            retObj.FinishedDate = DateTime.Parse(temObj.FinishedDate.ToString());
+                    }
+                }
+                catch { }
+
+                int temWordCount;
+
+                if (temObj.WordCount != null)
+                {
+                    if (int.TryParse(temObj.WordCount, out temWordCount))
+                    {
+                        retObj.WordCount = temWordCount;
+                    }
+                }
+
+                try
+                {
+                    if (temObj.CustomerName != null)
+                    {
+                        string strCustomer = temObj.CustomerName.ToString();
+                        retObj.Customer = new Customer() { Name = strCustomer };
+                        var temCustomer = Context.Customers.Where(c => c.Name == strCustomer.Trim()).FirstOrDefault();
+                        if (temCustomer != null)
+                        {
+                            retObj.CustomerId = temCustomer.Id;
+                        }
+                    }
+                }
+                catch { }
+
+                try
+                {
+                    if (temObj.Reviewer != null)
+                    {
+                        string strReViewer = temObj.Reviewer.ToString();
+                        var temReviewer = Context.Staffs.Where(s => s.Name == strReViewer.Trim()).FirstOrDefault();
+                        if (temReviewer != null)
+                        {
+                            retObj.ReviewerId = temReviewer.Id;
+                        }
+                    }
+                }
+                catch { }
+
+                if (temObj.DoPersons != null)
+                {
+                    string DoPersons = temObj.DoPersons.ToString();
+
+                    string[] Persons = DoPersons.Split(new char[] { ',' });
+                    List<ItemStaff> itemStaffs = new List<ItemStaff>();
+                    foreach (var doPerson in Persons)
+                    {
+                        itemStaffs.Add(new ItemStaff() { DoPerson = new Staff() { Name = doPerson } });
+                    }
+                    retObj.ItemStaffs = itemStaffs;
+                }
+                
             }
 
             return retObj;
         }
 
+       
+
+        public PerformanceItem GetItemInfoByMonthId(string CaseNo, string DoItem, string caseStage,int calMonthId)
+        {
+            var retObj = Context.PerformanceItems.Include(p => p.Customer).FirstOrDefault<PerformanceItem>(p => p.CaseNo == CaseNo.Trim()
+              && p.DoItem == DoItem.Trim()  && p.CalMonthId == calMonthId);
+
+            if(retObj != null)
+            {
+                if(string.IsNullOrEmpty (retObj.CaseStage) && string.IsNullOrEmpty(caseStage))
+                {
+                    return retObj;
+                }
+                else
+                {
+                    if(retObj.CaseStage == caseStage)
+                    {
+                        return retObj;
+                    }
+                    else
+                    {
+                        return null;
+                    }
+                }
+            }
+            else
+            {
+                return null;
+            }
+        }
+
         public bool MovePerformance2ProjectInfo()
         {
             var response = Context.PerformanceItems.Include(p=>p.ItemStaffs)

+ 104 - 32
wispro.sp.api/Controllers/ProjectController.cs

@@ -137,6 +137,16 @@ namespace wispro.sp.api.Controllers
                 var currentUser = Context.Staffs.FirstOrDefault(s => s.Name == User.Identity.Name);
                 saveObj.ProjectContentRecord.StaffId = currentUser.Id;
 
+                var temObj = Context.ProjectContentRecords.FirstOrDefault(p => 
+                                        p.StaffId == currentUser.Id && 
+                                        p.ProjectNo == saveObj.ProjectContentRecord.ProjectNo && 
+                                        p.CalMonthId== saveObj.ProjectContentRecord.CalMonthId );
+
+                if(temObj != null)
+                {
+                    throw new ApplicationException($"本月已提交{temObj.ProjectNo}工作内容!");
+                }
+
                 Context.ProjectContentRecords.Add(saveObj.ProjectContentRecord);
                 Context.SaveChanges();
             }
@@ -148,6 +158,11 @@ namespace wispro.sp.api.Controllers
                 temObj.ReviewerId = saveObj.ProjectContentRecord.ReviewerId;
                 //temObj.StaffId = saveObj.ProjectContentRecord.StaffId;
                 temObj.State = saveObj.ProjectContentRecord.State;
+                temObj.PointS = saveObj.ProjectContentRecord.PointS;
+                temObj.PointA = saveObj.ProjectContentRecord.PointA;
+                temObj.PointB = saveObj.ProjectContentRecord.PointB;
+                temObj.PointC = saveObj.ProjectContentRecord.PointC;
+                temObj.PointD = saveObj.ProjectContentRecord.PointD;
                 dbContext.SaveChanges();
                 saveObj.ProjectContentRecord = temObj;
             }
@@ -236,15 +251,7 @@ namespace wispro.sp.api.Controllers
                         }
                         
                         saveObj.ProjectContentRecord.ReviewerId = Reviewer.Id;
-                        PerformanceItem item = new PerformanceItem();
-
-                        if (saveObj.ProjectContentRecord.State == 2)
-                        {
-                            item = Context.PerformanceItems.FirstOrDefault(p=>
-                                p.CaseNo == saveObj.ProjectContentRecord.ProjectNo &&
-                                p.ItemStaffs.Where(s=>s.DoPersonId == saveObj.ProjectContentRecord.StaffId).Count()>0 &&
-                                p.CalMonthId == saveObj.ProjectContentRecord.CalMonthId);
-                        }
+                        
 
                         saveObj.ProjectContentRecord.State = 2;
 
@@ -255,33 +262,98 @@ namespace wispro.sp.api.Controllers
                             saveObj.ProjectContentRecord.Project = Context.ProjectInfos.Include(p=>p.Customer)
                                 .FirstOrDefault(p=>p.CaseNo == saveObj.ProjectContentRecord.ProjectNo);
                         }
-                        
-                        item.CalMonthId = saveObj.ProjectContentRecord.CalMonthId.Value;
-                        item.CaseCoefficient = saveObj.ProjectContentRecord.CaseCoefficient;
-                        item.CaseName = saveObj.ProjectContentRecord.Project.CaseName;
-                        item.CaseNo = saveObj.ProjectContentRecord.ProjectNo;
-                        item.Type = "专案";
-                        item.CustomerId = saveObj.ProjectContentRecord.Project.CustomerId;
-                        item.BasePoint = saveObj.ProjectContentRecord.Point;
-
-                        if (item.Id == 0)
+
+                        Dictionary<string, double> finanlJXDic = new Dictionary<string, double>();
+                        if (saveObj.ProjectContentRecord.PointS.HasValue)
                         {
-                            Context.PerformanceItems.Add(item);
-                            Context.SaveChanges();
-
-                            ItemStaff itemStaff = new ItemStaff();
-                            itemStaff.DoPersonId = saveObj.ProjectContentRecord.StaffId;
-                            itemStaff.ItemId = item.Id;
-                            itemStaff.PerformancePoint = saveObj.ProjectContentRecord.Point;
-                            Context.ItemStaffs.Add(itemStaff);
-                            Context.SaveChanges();
+                            finanlJXDic.Add("S", saveObj.ProjectContentRecord.PointS.Value);
                         }
-                        else
+
+                        if (saveObj.ProjectContentRecord.PointA.HasValue)
+                        {
+                            finanlJXDic.Add("A", saveObj.ProjectContentRecord.PointA.Value);
+                        }
+
+                        if (saveObj.ProjectContentRecord.PointB.HasValue)
                         {
-                            item.BasePoint = saveObj.ProjectContentRecord.Point;
-                            item.CaseCoefficient = saveObj.ProjectContentRecord.CaseCoefficient;
-                            Context.SaveChanges();
+                            finanlJXDic.Add("B", saveObj.ProjectContentRecord.PointB.Value);
                         }
+
+                        if (saveObj.ProjectContentRecord.PointC.HasValue)
+                        {
+                            finanlJXDic.Add("C", saveObj.ProjectContentRecord.PointC.Value);
+                        }
+
+                        if (saveObj.ProjectContentRecord.PointD.HasValue)
+                        {
+                            finanlJXDic.Add("D", saveObj.ProjectContentRecord.PointD.Value);
+                        }
+
+                        if (finanlJXDic.Count == 0)
+                        {
+                            //throw new ApplicationException("没有填写最终绩效!");
+                        }
+
+                        if (saveObj.ProjectContentRecord.State == 2)
+                        {
+                            if (finanlJXDic.Count > 0)
+                            {
+                                var retItems = Context.PerformanceItems.Include(p => p.ItemStaffs).Where(p =>
+                                          p.CaseNo == saveObj.ProjectContentRecord.ProjectNo &&
+                                          p.ItemStaffs.Where(s => s.DoPersonId == saveObj.ProjectContentRecord.StaffId).Count() > 0 &&
+                                          p.CalMonthId == saveObj.ProjectContentRecord.CalMonthId).ToList();
+
+                                foreach (var temItem in retItems)
+                                {
+                                    Context.ItemStaffs.RemoveRange(temItem.ItemStaffs);
+                                    Context.PerformanceItems.Remove(temItem);
+                                    Context.SaveChanges();
+                                }
+                            }
+
+                            foreach (string strKey in finanlJXDic.Keys)
+                            {
+                                PerformanceItem item = Context.PerformanceItems.FirstOrDefault(p =>
+                                    p.CaseNo == saveObj.ProjectContentRecord.ProjectNo &&
+                                    p.ItemStaffs.Where(s => s.DoPersonId == saveObj.ProjectContentRecord.StaffId).Count() > 0 &&
+                                    p.CaseCoefficient == strKey &&
+                                    p.CalMonthId == saveObj.ProjectContentRecord.CalMonthId);
+
+                                if(item == null)
+                                {
+                                    item = new PerformanceItem();
+                                }
+
+                                item.CalMonthId = saveObj.ProjectContentRecord.CalMonthId.Value;
+                                item.CaseCoefficient = strKey;
+                                item.CaseName = saveObj.ProjectContentRecord.Project.CaseName;
+                                item.CaseNo = saveObj.ProjectContentRecord.ProjectNo;
+
+                                item.Type = "专案";
+                                item.CustomerId = saveObj.ProjectContentRecord.Project.CustomerId;
+                                item.BasePoint = finanlJXDic[strKey];
+
+                                if (item.Id == 0)
+                                {
+                                    Context.PerformanceItems.Add(item);
+                                    Context.SaveChanges();
+
+                                    ItemStaff itemStaff = new ItemStaff();
+                                    itemStaff.DoPersonId = saveObj.ProjectContentRecord.StaffId;
+                                    itemStaff.ItemId = item.Id;
+                                    itemStaff.PerformancePoint = finanlJXDic[strKey]; 
+                                    Context.ItemStaffs.Add(itemStaff);
+                                    Context.SaveChanges();
+                                }
+                                else
+                                {
+                                    item.BasePoint = finanlJXDic[strKey];
+                                    item.CaseCoefficient = strKey;
+                                    Context.SaveChanges();
+                                }
+                            }
+                        }
+                        
                     }
 
                     t.Commit();

+ 117 - 0
wispro.sp.api/Controllers/ReportController.cs

@@ -0,0 +1,117 @@
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using wispro.sp.share;
+
+namespace wispro.sp.api.Controllers
+{
+    [Route("api/[controller]/[action]")]
+    [ApiController]
+    //[Authorize]
+    public class ReportController : ControllerBase
+    {
+        spDbContext Context;
+
+        public ReportController(spDbContext context)
+        {
+            Context = context;
+
+
+        }
+        public ChartDatas AppealReport(int type,DateTime? start,DateTime? end,int? userId)
+        {
+            ChartDatas retDatas = new ChartDatas();
+
+            var results = Context.AppealRecords.Where(b=>(1==1));
+            if (start.HasValue)
+            {
+                results = results.Where(b => b.CreateTime >= start);
+            }
+
+            if (end.HasValue)
+            {
+                results = results.Where(b => b.CreateTime <= end);
+            }
+
+            if (userId.HasValue)
+            {
+                results = results.Where(b => b.CreaterId == userId);
+            }
+
+            switch (type)
+            {
+                case 0:
+                    var retData = results.GroupBy(c => c.Creater.Name)
+                        .Select(g => new { key = g.Key, Count = g.Count() }).OrderByDescending(g=>g.Count)
+                        .ToDictionary(g => g.key, g => g.Count);
+
+                    retDatas.ATitle = "申诉人";
+                    retDatas.Title = "申诉人统计";
+                    retDatas.Datas = new List<ChartData>();
+                    
+                    foreach (var key in retData.Keys)
+                    {
+                        retDatas.Datas.Add(new ChartData() { ColumnA = key,value=retData[key]} );
+                    }
+                    return retDatas;
+                    break;
+                case 1:
+                    var retData1 = results.GroupBy(c => c.Type.Name)
+                        .Select(g => new { key = g.Key, Count = g.Count() }).OrderByDescending(g => g.Count)
+                        .ToDictionary(g => g.key, g => g.Count);
+
+                    retDatas.ATitle = "申诉类型";
+                    retDatas.Title = "申诉类型统计";
+                    retDatas.Datas = new List<ChartData>();
+                    
+                    foreach (var key in retData1.Keys)
+                    {
+                        retDatas.Datas.Add(new ChartData() { ColumnA = key, value = retData1[key] });
+                    }
+                    return retDatas;
+                    break;
+                case 2:
+                    var retData2 = results.GroupBy(c => c.Creater.Department)
+                        .Select(g => new { key = g.Key, Count = g.Count() }).OrderByDescending(g => g.Count)
+                        .ToDictionary(g => g.key, g => g.Count);
+
+                    retDatas.ATitle = "部门";
+                    retDatas.Title = "部门申诉统计";
+                    retDatas.Datas = new List<ChartData>();
+
+                    foreach (var key in retData2.Keys)
+                    {
+                        retDatas.Datas.Add(new ChartData() { ColumnA = key, value = retData2[key] });
+                    }
+                    return retDatas;
+                    break;
+                case 3:
+                    var retData3 = results.GroupBy(c => new { c.Creater.Name,c.CreateTime.Year, c.CreateTime.Month })
+                        .Select(g => new { key = g.Key, Count = g.Count() }).OrderByDescending(g => g.Count)
+                        .ToDictionary(g => g.key, g => g.Count);
+
+                    retDatas.ATitle = "申诉人";
+                    retDatas.BTitle = "绩效月份";
+                    retDatas.Title = "申诉人每月申诉统计";
+                    retDatas.Datas = new List<ChartData>();
+
+                    foreach (var key in retData3.Keys)
+                    {
+                        retDatas.Datas.Add(new ChartData() { ColumnA = key.Name, ColumnB = $"{key.Year}-{key.Month}", value = retData3[key] });
+                    }
+                    return retDatas;
+                    
+                    break;
+                default:
+                    return null;
+                    break;
+            }
+            
+        }
+    }
+}

+ 22 - 15
wispro.sp.api/Job/ImportReportJob.cs

@@ -82,7 +82,7 @@ namespace wispro.sp.api.Job
 
                 if (iCount > 0)
                 {
-                    return Task.CompletedTask;
+                     return Task.CompletedTask;
                 }
                 calMonth = temCalMonth;
             }
@@ -330,7 +330,11 @@ namespace wispro.sp.api.Job
                 {
                     if (!InValidDoItem.Contains(item.DoItem))
                     {
-                        
+                        foreach(var temObj in item.ItemStaffs)
+                        {
+                            temObj.DoPerson.Name = temObj.DoPerson.Name.Replace("-君龙", "");
+                        }
+
                         SavePerformanceItem(item, rules);
                         
                         strDebug = $"{strDebug}\t保存成功";
@@ -409,7 +413,8 @@ namespace wispro.sp.api.Job
             foreach (string name in temHandlers)
             {
                 ItemStaff itemStaff = new ItemStaff();
-                int? iTem = GetStaff(name);
+                string temName = name.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
+                int? iTem = GetStaff(temName);
                 if ((iTem != null))
                 {
                     //itemStaff.Item = item;
@@ -420,11 +425,11 @@ namespace wispro.sp.api.Job
                 {
                     itemStaff.DoPerson = new Staff()
                     {
-                        Name = name,
-                        Account = name,
+                        Name = temName,
+                        Account = temName,
                         Password = "12345678",
                         IsCalPerformsnce = false,
-                        Status = "正式员工",
+                        Status = "试用期",
                         StaffGradeId = 4
                     };
                     item.ItemStaffs.Add(itemStaff);
@@ -520,7 +525,8 @@ namespace wispro.sp.api.Job
             foreach (string name in temHandlers)
             {
                 ItemStaff itemStaff = new ItemStaff();
-                int? iTem = GetStaff(name);
+                string temName = name.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
+                int? iTem = GetStaff(temName);
                 if ((iTem != null))
                 {
                     //itemStaff.Item = item;
@@ -531,11 +537,11 @@ namespace wispro.sp.api.Job
                 {
                     itemStaff.DoPerson = new Staff()
                     {
-                        Name = name,
-                        Account = name,
+                        Name = temName,
+                        Account = temName,
                         Password = "12345678",
                         IsCalPerformsnce = false,
-                        Status = "正式员工",
+                        Status = "试用期",
                         StaffGradeId = 4
                     };
                     item.ItemStaffs.Add(itemStaff);
@@ -631,7 +637,8 @@ namespace wispro.sp.api.Job
             foreach (string name in temHandlers)
             {
                 ItemStaff itemStaff = new ItemStaff();
-                int? iTem = GetStaff(name);
+                string temName = name.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
+                int? iTem = GetStaff(temName);
                 if ((iTem != null))
                 {
                     //itemStaff.Item = item;
@@ -642,11 +649,11 @@ namespace wispro.sp.api.Job
                 {
                     itemStaff.DoPerson = new Staff()
                     {
-                        Name = name,
-                        Account = name,
+                        Name = temName,
+                        Account = temName,
                         Password = "12345678",
                         IsCalPerformsnce = false,
-                        Status = "正式员工",
+                        Status = "试用期",
                         StaffGradeId = 4
                     };
                     item.ItemStaffs.Add(itemStaff);
@@ -776,7 +783,7 @@ namespace wispro.sp.api.Job
                         Account = temName,
                         Password = "12345678",
                         IsCalPerformsnce = false,
-                        Status = "已离职",
+                        Status = "试用期",
                         StaffGradeId = 4
                     };
                     item.ItemStaffs.Add(itemStaff);

+ 1 - 1
wispro.sp.api/Job/InvalidDataMessageJob.cs

@@ -66,7 +66,7 @@ namespace wispro.sp.api.Job
                 _ = QuartzUtil.AddMailJob("疑似有问题绩效数据清单", strBody, "夏敏", "xiamin@china-wispro.com", strPath);
                 _ = QuartzUtil.AddMailJob("疑似有问题绩效数据清单", strBody, "吴芳", "wufang@china-wispro.com", strPath);
                 _ = QuartzUtil.AddMailJob("疑似有问题绩效数据清单", strBody, "邢丽霞", "xinglixia@china-wispro.com", strPath);
-                
+
             }
 
             return Task.CompletedTask;

+ 1 - 1
wispro.sp.api/Job/UpdateJXDataFromIPEasyJob.cs

@@ -154,7 +154,7 @@ namespace wispro.sp.api.Job
 
             if (keyValuePairs.ContainsKey("CaseCoefficient") && Item.CaseCoefficient != retObj.CaseCoefficient && !string.IsNullOrEmpty(retObj.CaseCoefficient))
             {
-                if (!string.IsNullOrEmpty(retObj.CaseCoefficient))
+                if (string.IsNullOrEmpty(Item.CaseCoefficient) &&  !string.IsNullOrEmpty(retObj.CaseCoefficient))
                 {
                     Item.CaseCoefficient = retObj.CaseCoefficient;
                 }

+ 21 - 10
wispro.sp.api/Utility/Utility.cs

@@ -12,6 +12,14 @@ namespace wispro.sp.api.Utility
     {
         public static void CalBasePoint(PerformanceItem item, List<BasePointRule> rules)
         {
+            if(item.CaseNo == "PAUS2116474")
+            {
+                System.Diagnostics.Debug.WriteLine("");
+            }
+            if (item.CaseNo.ToUpper().StartsWith("S"))
+            {
+                return;
+            }
             #region 计算基本点数值及绩效类型
 
             rules.Sort((a, b) =>
@@ -26,7 +34,10 @@ namespace wispro.sp.api.Utility
                 var interpreter = new Interpreter(options)
                     .Reference(typeof(System.Linq.Enumerable));
 
-                
+                //if (rule.Rule.Contains("Appeal Decision"))
+                //{
+                //    System.Diagnostics.Debug.WriteLine(rule.Rule);
+                //}
 
                 try
                 {
@@ -37,10 +48,10 @@ namespace wispro.sp.api.Utility
 
                     if (result)
                     {
-                        if (((item.Customer.Name.Contains("OPPO") && (item.CaseNo.StartsWith("PAUS") || item.ApplicationType=="实用新型")) || rule.PointExpress.Contains("p.WordCount")) && item.DoItem == "新申请")
-                        {
-                            System.Diagnostics.Debug.WriteLine("");
-                        }
+                        //if ((( item.Customer.Name.Contains("OPPO") && (item.CaseNo.StartsWith("PAUS") || item.ApplicationType=="实用新型")) || rule.PointExpress.Contains("p.WordCount")) && item.DoItem == "新申请")
+                        //{
+                        //    System.Diagnostics.Debug.WriteLine("");
+                        //}
                         var temString = rule.PointExpress;
                         if (!rule.PointExpress.Contains("."))
                         {
@@ -53,7 +64,7 @@ namespace wispro.sp.api.Utility
                         
 
                         double? temPoint = (double?)target.Eval(temString);
-
+                        string temType = rule.Type;
                         if(temString.Contains("p.WordCount") && item.DoItem == "新申请" && temPoint.HasValue)
                         {
                             switch (item.DoItemCoefficient)
@@ -61,7 +72,7 @@ namespace wispro.sp.api.Utility
                                 case "中-德":
                                     if (1.9 > temPoint.Value)
                                     {
-                                        rule.Type = "新申请";
+                                        temType = "新申请";
                                         temPoint = 1.9;
                                     }
                                    
@@ -69,14 +80,14 @@ namespace wispro.sp.api.Utility
                                 case "中-英":
                                     if (1.8 > temPoint.Value)
                                     {
-                                        rule.Type = "新申请";
+                                        temType = "新申请";
                                         temPoint = 1.8;
                                     }
                                     break;
                                 case "英-中":
                                     if (1.5 > temPoint.Value)
                                     {
-                                        rule.Type = "新申请";
+                                        temType = "新申请";
                                         temPoint = 1.5;
                                     }
                                     break;
@@ -87,7 +98,7 @@ namespace wispro.sp.api.Utility
                         if(item.BasePoint != temPoint)
                         {
                             item.BasePoint = temPoint;
-                            item.Type = rule.Type;
+                            item.Type = temType;
                         }
                         
                         break;

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

@@ -11,8 +11,8 @@
     "DefaultConnect": "Data Source=(local);Initial Catalog=spDB;User ID=sa;Password=Lqftiu807005"
   },
 
-  "UpdateScheduleSetting": "00 10 09 * * ? *",
-  "InvalidDataScheduleSetting": "00 58 17 * * ? *",
+  "UpdateScheduleSetting": "00 01 09 * * ? *",
+  "InvalidDataScheduleSetting": "00 10 15 * * ? *",
 
   "ValidAudience": "StaffPerformance",
   "ValidIssuer": "http://localhost:39476",

+ 1 - 1
wispro.sp.api/spDbContext.cs

@@ -99,7 +99,7 @@ namespace wispro.sp.api
                 //ConfigurationManager.AppSettings["ValidAudience"]
             }
 
-            _ = optionsBuilder.UseLoggerFactory(LoggerFactory);
+            //_ = optionsBuilder.UseLoggerFactory(LoggerFactory);
         }
 
         protected override void OnModelCreating(ModelBuilder modelBuilder)

+ 34 - 0
wispro.sp.share/ChartData.cs

@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace wispro.sp.share
+{
+    public class ChartData
+    {
+        public string ColumnA { get; set; }
+
+        public string CustomerColumnA { get; set; }
+
+        public string ColumnB { get; set; }
+
+        public string CustomerColumnB { get; set; }
+
+        public double value { get; set; }
+    }
+
+    public class ChartDatas
+    {
+        public List<ChartData> Datas { get; set; }
+
+        public string Title { get; set; }
+
+        public string ATitle { get; set; }
+
+        public string BTitle { get; set; }
+
+
+    }
+}

+ 1 - 1
wispro.sp.web/Components/SubmitWorkContent.razor

@@ -11,7 +11,7 @@
                 <span>@_Model.Project.CaseName</span>
             </FormItem>
             <FormItem Label="客户">
-                <span>@_Model.Project.Customer.Name</span>
+                <span>@_Model.Project.Customer?.Name</span>
             </FormItem>
         }
     </Form>

+ 16 - 1
wispro.sp.web/Layouts/BasicLayout.razor

@@ -114,7 +114,22 @@
                 },
             }
         },
-
+        new MenuDataItem
+        {
+            Name = "报表管理",
+            Key = "ReportManage",
+            Icon = "dashboard",
+            Children= new MenuDataItem[]
+            {
+                new MenuDataItem
+                {
+                    Path ="/Report/PieChart",
+                    Name ="申诉类型统计",
+                    Key= "appealType",
+                    Icon = "pie-chart"
+                }
+            }
+        },
         new MenuDataItem
         {
             Name = "基本资料管理",

+ 1 - 1
wispro.sp.web/Pages/AppCase/MyCaselist.razor

@@ -127,7 +127,7 @@
                                      @bind-SelectedRows="selectedItems"
                                      OnRow="OnRow"
                                      Loading="_loading"
-                                     RowClassName="@(x => x.Data.isDanger() ? "danger" : "")"
+                                     RowClassName="@(x => (x.Data.isDanger()&& string.IsNullOrEmpty(x.Data.OverDueMemo))?"danger" : "")"
                                      OnChange="HandleTableChange" RemoteDataSource>
                         <RowTemplate>
                             <AntDesign.Selection Key="@(context.Id.ToString())" Width="50" Fixed="left" />

+ 35 - 19
wispro.sp.web/Pages/LoginPages.razor

@@ -12,7 +12,7 @@
                                 <AntDesign.Input Placeholder="请输入用户名" Size="@InputSize.Large" @bind-Value="context.Name">
                                     <Prefix><Icon Type="user"></Icon></Prefix>
                                 </AntDesign.Input>
-                                <br/>
+                                <br />
                             </SpaceItem>
                             <SpaceItem>
                                 <AntDesign.Input Placeholder="请输入密码" Size="@InputSize.Large" @bind-Value="context.Password" type="password">
@@ -29,9 +29,8 @@
                         </SpaceItem>
                         <SpaceItem>
                             <div class="other">
-                                <a style="float: right;">
-                                    忘记密码
-                                </a>
+                                <Button Type="@ButtonType.Link" @onclick="ResetPassword">我忘记密码,需要重置!</Button>
+                                
                             </div>
                         </SpaceItem>
                     </Space>
@@ -41,22 +40,39 @@
     </div>
 </div>
 
+<Modal Title="密码重置"
+       Visible="@ShowResetPassword"
+       OnOk="@HandleOk"
+       OnCancel="@HandleCancel"
+       OkText="@("重置")"
+       CancelText="@("取消")">
+    <Form Model="EditingStaff" LabelColSpan="6"
+          WrapperColSpan="16">
+        <FormItem Label="账号">
+            <Input @bind-Value="@context.Account" />
+        </FormItem>
 
-<style>
-    .login-NavLogin {
-        position: absolute;
-        left: 50%;
-        top: 40%;
-        transform: translate(-50%, -50%);
-    }
+        <FormItem Label="邮箱">
+            <Input @bind-Value="@context.Mail"/>
+        </FormItem>
+    </Form>
+</Modal>
 
-    body {
-        background-image: url(images/bg1.jpg);
-        background-attachment: fixed;
-        background-repeat: no-repeat;
-        background-size: cover;
-        background-position: center;
-    }
-</style>
+    <style>
+        .login-NavLogin {
+            position: absolute;
+            left: 50%;
+            top: 40%;
+            transform: translate(-50%, -50%);
+        }
+
+        body {
+            background-image: url(images/bg1.jpg);
+            background-attachment: fixed;
+            background-repeat: no-repeat;
+            background-size: cover;
+            background-position: center;
+        }
+    </style>
 
 

+ 37 - 0
wispro.sp.web/Pages/LoginPages.razor.cs

@@ -12,6 +12,9 @@ using System.Security.Claims;
 using Blazored.LocalStorage;
 using System;
 using System.Text.Json;
+using wispro.sp.entity;
+using wispro.sp.share;
+using Microsoft.AspNetCore.Components.Web;
 
 namespace wispro.sp.web.Pages
 {
@@ -54,5 +57,39 @@ namespace wispro.sp.web.Pages
             
             isLoading = false;
         }
+
+        bool ShowResetPassword = false;
+        private Staff EditingStaff = new Staff();
+        void ResetPassword()
+        {
+            ShowResetPassword = true;
+            EditingStaff = new Staff();
+        }
+
+        private async System.Threading.Tasks.Task HandleOk(MouseEventArgs e)
+        {
+            if(String.IsNullOrEmpty(EditingStaff.Account ) || string.IsNullOrEmpty(EditingStaff.Mail)){
+                await MsgSvr.Success("请输入账号名称和邮箱!");
+                return;
+            }
+            var data = await authService.ResetPassword(EditingStaff.Account,EditingStaff.Mail);
+
+            if (data.Success)
+            {
+                await MsgSvr.Success("重置成功,新密码已发您邮箱!");
+                ShowResetPassword = false;
+            }
+            else
+            {
+                await MsgSvr.Error($"请求发生错误 {data.ErrorMessage}");
+            }
+
+
+        }
+
+        private void HandleCancel(MouseEventArgs e)
+        {
+            ShowResetPassword = false;
+        }
     }
 }

+ 5 - 3
wispro.sp.web/Pages/Project/AssignPoint.razor

@@ -26,6 +26,7 @@
                     <Form Model="task">
                         @if (!Id.HasValue)
                         {
+                            
                             <FormItem Label="我方文号">
                                 <Select DataSource="@ProjectInfos"
                                         @bind-Value="@task.ProjectContentRecord.ProjectNo"
@@ -33,17 +34,18 @@
                                         ValueName="@nameof(wispro.sp.entity.ProjectInfo.CaseNo)"
                                         Style="width: 200px"
                                         Placeholder="请选择"
+                                        OnSelectedItemChanged="OnSelectedItemChangedHandler"
                                         IgnoreItemChanges="false"
                                         EnableSearch="true"
                                         AllowClear
-                                        OnSelectedItemChanged="OnSelectedItemChangedHandler"
                                         OnSearch="OnSearch"
-                                        DefaultActiveFirstOption>
+                                        >
                                 </Select>
                             </FormItem>
                         }
                         else
                         {
+                            Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(task));
                             <FormItem Label="我方文号">
                                 <span>@task.ProjectContentRecord.ProjectNo</span>
                             </FormItem>
@@ -60,7 +62,7 @@
                                         <span>@task.ProjectContentRecord.Project.BusinessType</span>
                                     </FormItem>
                                     <FormItem Label="客户">
-                                        <span>@task.ProjectContentRecord.Project.Customer.Name</span>
+                                        <span>@task.ProjectContentRecord.Project.Customer?.Name</span>
                                     </FormItem>
                                 </Panel>
                             </Collapse>

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

@@ -42,6 +42,7 @@ namespace wispro.sp.web.Pages.Project
         private void AddNew()
         {
             addDoItem = new ViewProjectWorkContent();
+            addDoItem.WorkDate = DateTime.Now;
             addDoItem.modifyState = ModifyState.New;
 
             task.ProjectWorkContents.Add(addDoItem);
@@ -53,15 +54,12 @@ namespace wispro.sp.web.Pages.Project
             isLoading = true;
             ProjectInfos =await _itemService.GetProjectInfos(0);
             ShowProjectInfos = ProjectInfos;
-
+            
             if (Id.HasValue)
             {
                 task = await _itemService.getProjectWorkContent(Id.Value);
-
                 _ShowWorkContent = GetShowWorkContents();
             }
-
-
             await base.OnInitializedAsync();
 
             isLoading = false;
@@ -69,8 +67,15 @@ namespace wispro.sp.web.Pages.Project
 
         private void OnSelectedItemChangedHandler(ProjectInfo value)
         {
-            task.ProjectContentRecord.ProjectNo   = value.CaseNo;
-            task.ProjectContentRecord.Project = value;
+
+            if (value != null)
+            {
+                //Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(value));
+
+                
+                task.ProjectContentRecord.ProjectNo = value.CaseNo;
+                task.ProjectContentRecord.Project = value;
+            }
         }
 
         private void OnSearch(string value)

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

@@ -47,7 +47,7 @@
                         }
                     </AntDesign.Column>
                     <AntDesign.Column Title="最终绩效" TData="string">
-                        @($"{context.Point}{context.CaseCoefficient}")
+                        @FininalJX(context)
                     </AntDesign.Column>
                     <AntDesign.Column Title="业务类型" DataIndex="Project.BusinessType" TData="string" Sortable Filterable />
                     <AntDesign.Column Title="状态" TData="string">

+ 37 - 0
wispro.sp.web/Pages/Project/MyProject.razor.cs

@@ -92,6 +92,42 @@ namespace wispro.sp.web.Pages.Project
             _NavigationManager.NavigateTo($"/Project/WorkContent/{projectContent.Id}");
         }
 
+        private string FininalJX(ProjectContentRecord projectContent)
+        {
+            string strRet = "";
+
+            if (projectContent.PointS.HasValue)
+            {
+                strRet = $"{strRet}{projectContent.PointS}S,";
+            }
+
+            if (projectContent.PointA.HasValue)
+            {
+                strRet = $"{strRet}{projectContent.PointA}A,";
+            }
+
+            if (projectContent.PointB.HasValue)
+            {
+                strRet = $"{strRet}{projectContent.PointB}B,";
+            }
+
+            if (projectContent.PointC.HasValue)
+            {
+                strRet = $"{strRet}{projectContent.PointC}C,";
+            }
+
+            if (projectContent.PointD.HasValue)
+            {
+                strRet = $"{strRet}{projectContent.PointS}D,";
+            }
+
+            if(strRet.Length > 0)
+            {
+                strRet = strRet.Substring(0, strRet.Length - 1);
+            }
+            return strRet;
+        }
+
         async void Submit(ProjectContentRecord projectContent)
         {
             var modalConfig = new ModalOptions();
@@ -128,6 +164,7 @@ namespace wispro.sp.web.Pages.Project
                         _ModalService.Success(SuccessConfig);
 
                         ProjectInfos = await _itemService.GetMyProjects();
+                        StateHasChanged();
                     }
                     else
                     {

+ 20 - 13
wispro.sp.web/Pages/Project/ProjectReviewer.razor

@@ -34,19 +34,26 @@
                 <Card Title="@pContent.ProjectContentRecord.Staff.Name">
                     <Extra>
                         <Space>
-                            <SpaceItem>最终绩效点数:<AntDesign.InputNumber @bind-Value="@pContent.ProjectContentRecord.Point" Step="0.01" Size="50" /></SpaceItem>
                             <SpaceItem>
-                                <Select @bind-Value="@pContent.ProjectContentRecord.CaseCoefficient"
-                                        TItemValue="string" TItem="string" Size="50" DefaultActiveFirstOption>
-                                    <SelectOptions>
-                                        <SelectOption TItemValue="string" TItem="string" Value="@("S")" Label="S" />
-                                        <SelectOption TItemValue="string" TItem="string" Value="@("A")" Label="A" />
-                                        <SelectOption TItemValue="string" TItem="string" Value="@("B")" Label="B" />
-                                        <SelectOption TItemValue="string" TItem="string" Value="@("C")" Label="C" />
-                                        <SelectOption TItemValue="string" TItem="string" Value="@("D")" Label="D" />
-                                    </SelectOptions>
-                                </Select>
+                                最终绩效点数:
+                                <AntDesign.InputNumber @bind-Value="@pContent.ProjectContentRecord.PointS" Step="0.01" Size="@InputSize.Small" />S
                             </SpaceItem>
+                            <SpaceItem><AntDesign.InputNumber @bind-Value="@pContent.ProjectContentRecord.PointA" Step="0.01" Size="@InputSize.Small" />A</SpaceItem>
+                            <SpaceItem><AntDesign.InputNumber @bind-Value="@pContent.ProjectContentRecord.PointB" Step="0.01" Size="@InputSize.Small" />B</SpaceItem>
+                            <SpaceItem><AntDesign.InputNumber @bind-Value="@pContent.ProjectContentRecord.PointC" Step="0.01" Size="@InputSize.Small" />C</SpaceItem>
+                            <SpaceItem><AntDesign.InputNumber @bind-Value="@pContent.ProjectContentRecord.PointD" Step="0.01" Size="@InputSize.Small" />D</SpaceItem>
+                            @*<SpaceItem>
+            <Select @bind-Value="@pContent.ProjectContentRecord.CaseCoefficient"
+                    TItemValue="string" TItem="string" Size="50" DefaultActiveFirstOption>
+                <SelectOptions>
+                    <SelectOption TItemValue="string" TItem="string" Value="@("S")" Label="S" />
+                    <SelectOption TItemValue="string" TItem="string" Value="@("A")" Label="A" />
+                    <SelectOption TItemValue="string" TItem="string" Value="@("B")" Label="B" />
+                    <SelectOption TItemValue="string" TItem="string" Value="@("C")" Label="C" />
+                    <SelectOption TItemValue="string" TItem="string" Value="@("D")" Label="D" />
+                </SelectOptions>
+            </Select>
+        </SpaceItem>*@
                         </Space>
                     </Extra>
                     <Body>
@@ -70,9 +77,9 @@
                                 <AntDesign.Column Title="实际绩效" TData="string">
                                     <Input Type="text" @bind-Value="@pp.ActualPerformance" OnBlur="stopEdit" Size="20" @oninput="()=>ContentChanged(pp)" />
                                 </AntDesign.Column>
-                                <AntDesign.Column Title="最终绩效" TData="string">
+                                @*<AntDesign.Column Title="最终绩效" TData="string">
                                     <Input Type="text" @bind-Value="@pp.FinalPerformance" OnBlur="stopEdit" Size="20" @oninput="()=>ContentChanged(pp)" />
-                                </AntDesign.Column>
+                                </AntDesign.Column>*@
                             </ChildContent>
                         </Table>
 

+ 31 - 0
wispro.sp.web/Pages/Report/PieChart.razor

@@ -0,0 +1,31 @@
+@page  "/Report/PieChart"
+
+<PageContainer>
+    <Breadcrumb>
+        <Breadcrumb>
+            <BreadcrumbItem>
+                <a href="/Home"><Icon Type="home"></Icon></a>
+            </BreadcrumbItem>
+            <BreadcrumbItem>
+                <span>报表</span>
+            </BreadcrumbItem>
+        </Breadcrumb>
+    </Breadcrumb>
+    <Content></Content>
+    <ChildContent>
+        <div>
+            @if (Datas == null)
+            {
+
+            }
+            else
+            {
+                <Pie Data="Datas.Datas" Config="config4" @ref="@chart" />
+                //chart.ChangeData(Datas.Datas);
+                //chart.UpdateConfig(config4);
+            }
+        </div>
+    </ChildContent>
+</PageContainer>
+
+

+ 71 - 0
wispro.sp.web/Pages/Report/PieChart.razor.cs

@@ -0,0 +1,71 @@
+using AntDesign.Charts;
+using Microsoft.AspNetCore.Components;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using wispro.sp.web.Services;
+
+namespace wispro.sp.web.Pages.Report
+{
+    public partial class PieChart
+    {
+        private AntDesign.Charts.IChartComponent chart;
+        private PieConfig config4 = new PieConfig
+        {
+            ForceFit = true,
+            Title = new Title
+            {
+                Visible = true,
+                Text = "Pie Chart-Graphic Tab Spider Layout",
+                AlignTo= "left"
+            },
+            Description = new Description
+            {
+                Visible = false,
+                Text = "When the type of the pie chart label is set to spider, the labels are divided into two groups, and they are displayed in alignment by pulling lines on both sides of the chart. Generally speaking, the labels of the spider layout are less likely to block each other."
+            },
+            Radius = 0.8,
+            AngleField = "value",
+            ColorField = "ColumnA",
+            Label = new PieLabelConfig
+            {
+                Visible = true,
+                Type = "spider"
+            }
+        };
+
+        
+
+        private share.ChartDatas Datas=new share.ChartDatas() { 
+            Title ="初始化标题",
+            Datas = new List<share.ChartData>() { 
+                new share.ChartData(){ ColumnA ="A",value =1}
+            },
+            ATitle =""
+        };
+
+        
+
+        [Inject] ReportService reportService { get; set; }
+
+        [Obsolete]
+        protected async override Task OnInitializedAsync()
+        {
+            Datas = await reportService.GetAppealReportData(1,DateTime.Parse("2022-02-01"),null,null);
+
+            if (Datas != null)
+            {
+
+                config4.Title.Text = Datas.Title;
+                config4.XField = Datas.ATitle;
+
+                await chart.ChangeData(Datas.Datas);
+                await chart.UpdateChart(config4);
+                StateHasChanged();
+            }
+
+            await base.OnInitializedAsync();
+        }
+    }
+}

+ 18 - 11
wispro.sp.web/Pages/Welcome.razor.cs

@@ -145,22 +145,29 @@ namespace wispro.sp.web.Pages
             {
                 try
                 {
-                    await _atService.ReviewerAppeal(templateOptions);
+                    var retData = await _atService.ReviewerAppeal(templateOptions);
 
-                    await _modalRef.CloseAsync();
+                    if (retData.Success)
+                    {
+                        await _modalRef.CloseAsync();
 
-                    AppealRecords = await _atService.GetUserAppeals(_CurrentUser.Userid);
+                        AppealRecords = await _atService.GetUserAppeals(_CurrentUser.Userid);
 
-                    StateHasChanged();
+                        StateHasChanged();
 
-                    var SuccessConfig = new ConfirmOptions()
-                    {
-                        Content = @"审核成功!"
-                    };
+                        var SuccessConfig = new ConfirmOptions()
+                        {
+                            Content = @"审核成功!"
+                        };
 
-                    //modalConfig.Footer = null;
-                    modalConfig.DestroyOnClose = true;
-                    _ModalService.Success(SuccessConfig);
+                        //modalConfig.Footer = null;
+                        modalConfig.DestroyOnClose = true;
+                        _ModalService.Success(SuccessConfig);
+                    }
+                    else
+                    {
+                        throw new ApplicationException(retData.ErrorMessage);
+                    }
                     
 
                 }

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

@@ -42,6 +42,7 @@ namespace wispro.sp.web
             builder.Services.AddScoped<IHttpService, HttpService>();
             builder.Services.AddScoped<OrganizationService, OrganizationService>();
             builder.Services.AddScoped<WorkflowService, WorkflowService>();
+            builder.Services.AddScoped<ReportService, ReportService>();
 
             builder.Services.AddBlazorContextMenu();
 

+ 9 - 6
wispro.sp.web/Services/AppealTypeService.cs

@@ -168,7 +168,7 @@ namespace wispro.sp.web.Services
 
         }
 
-        public async Task ReviewerAppeal(ReviewerAppealModel model)
+        public async Task<ApiSaveResponse> ReviewerAppeal(ReviewerAppealModel model)
         {
 
             string strUrl = $"Appeal/ReviewerAppeal?appealRecordId={model.AppealRecord.Id}";
@@ -184,15 +184,18 @@ namespace wispro.sp.web.Services
             {
                 var data = await _httpClient.Post<ApiSaveResponse>(strUrl, appealObject);
 
-                if (!data.Success)
-                {
-                    throw new ApplicationException(data.ErrorMessage);
-                }
+                return data;
                 
             }
             catch(Exception ex)
             {
-                throw ex;
+                return new ApiSaveResponse()
+                {
+                    Success = false,
+                    ErrorMessage = "审核发送未知错误!"
+
+                };
+                
             }
 
             //if (!data.IsSuccessStatusCode)

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

@@ -15,6 +15,7 @@ using wispro.sp.web.Models;
 using AntDesign;
 using Microsoft.AspNetCore.Components;
 using Microsoft.JSInterop;
+using wispro.sp.share;
 
 namespace wispro.sp.web.Services
 {
@@ -64,6 +65,12 @@ namespace wispro.sp.web.Services
             return httpResponse;
         }
 
+        public async Task<ApiSaveResponse> ResetPassword(string account,string mail)
+        {
+            var httpResponse = await httpClient.Get<ApiSaveResponse>($"account/ResetPassword?accountName={account}&mail={mail}");
+            return httpResponse;
+        }
+
         public async Task LogoutAsync()
         {
             await localStorageService.RemoveItemAsync("authToken");

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

@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
+using wispro.sp.share;
 using wispro.sp.share.webViewObject;
 
 namespace wispro.sp.web.Services
@@ -17,5 +18,6 @@ namespace wispro.sp.web.Services
         Task<bool> ChangePassword(changePasswordDto dto);
 
         Task CanVisitResource();
+        Task<ApiSaveResponse> ResetPassword(string account, string mail);
     }
 }

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

@@ -319,6 +319,7 @@ namespace wispro.sp.web.Services
         {
             var data = await _httpClient.Get<ApiSaveResponse>($"PerformanceItem/RefreshFromIPEasyById?itemId={Id}");
 
+            
             return await _httpClient.Get<PerformanceItem>($"PerformanceItem/PerformanceItem?Id={Id}");
            
         }

+ 40 - 0
wispro.sp.web/Services/ReportService.cs

@@ -0,0 +1,40 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using wispro.sp.share;
+
+namespace wispro.sp.web.Services
+{
+    public class ReportService
+    {
+        private readonly IHttpService _httpClient;
+
+        public ReportService(IHttpService httpClient)
+        {
+            _httpClient = httpClient;
+        }
+        public async Task<ChartDatas> GetAppealReportData(int type,DateTime? start,DateTime? end,int? userId)
+        {
+            //AppealReport(int type, DateTime ? start, DateTime ? end, int ? userId)
+
+            string strUrl = $"Report/AppealReport?type={type}";
+            if (start.HasValue)
+            {
+                strUrl = $"{strUrl}&start={start?.ToString("yyyy-MM-dd")}";
+            }
+
+            if (end.HasValue)
+            {
+                strUrl = $"{strUrl}&end={end?.ToString("yyyy-MM-dd")}";
+            }
+
+            if (userId.HasValue)
+            {
+                strUrl = $"{strUrl}&userId={userId.Value}";
+            }
+            var data = await _httpClient.Get<share.ChartDatas>(strUrl);
+            return data;
+        }
+    }
+}

+ 2 - 1
wispro.sp.web/wwwroot/index.html

@@ -222,8 +222,9 @@
     </div>
 
     <script src="_content/AntDesign/js/ant-design-blazor.js"></script>
+    <script src="https://unpkg.com/@antv/g2plot@1.1.28/dist/g2plot.js"></script>
     <script src="_content/AntDesign.Charts/ant-design-charts-blazor.js"></script>
-    <script src="_framework/blazor.webassembly.js"  autostart="false"></script>
+    <script src="_framework/blazor.webassembly.js" autostart="false"></script>
     <!--<script src="script/helper.js"></script>-->
     <script src="https://d3js.org/d3.v5.min.js"></script>
     <script src="https://unpkg.com/@hpcc-js/wasm@0.3.11/dist/index.min.js"></script>

+ 57 - 4
wispro.sp.winClient/Form1.cs

@@ -770,17 +770,70 @@ namespace wispro.sp.winClient
             return retStr;
         }
 
-        string strAPIBaseUri = "https://47.106.221.167"; //"http://localhost:39476";// 
+        string strAPIBaseUri = "http://localhost:39476";// "https://47.106.221.167"; // 
 
         userToken Token;
 
         public async Task GetTest()
         {
             await Login();
-            var strUrl = "https://47.106.221.167/api/PerformanceItem/CalMyStatistics?userid=98&year=2021&month=12";
-            var response =await CreateHttp().GetFromJsonAsync<List<StaffStatistics>>(strUrl);
+            string strUrl = $"{strAPIBaseUri}/api/PerformanceItem/CurrentData2Excel";
+            HttpClient http = CreateHttp();
+            http.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("bearer", Token.Token);
+
+            var response = await http.GetFromJsonAsync<FileProcessTask>(strUrl);
+            while (!response.Finished)
+            {
+                response = await http.GetFromJsonAsync<FileProcessTask>($"{strAPIBaseUri}/api/FileProcesTask/Get?Id={response.Id}");
+                System.Diagnostics.Debug.WriteLine($"{response.Processed}/{response.Size}");
+                System.Threading.Thread.Sleep(2000);
+            }
+
+            byte[] data = await http.GetByteArrayAsync($"{strAPIBaseUri}/api/FileProcesTask/Download?Id={response.Id}");
+
+            using (var file = System.IO.File.Create(response.FilePath))
+            {
+                file.Write(data, 0, data.Length);
+            }
+                
+
+            #region aaa
+            //DataTable dt = utility.NPOIExcel.ExcelToDataTable("C:\\temp\\userList.xlsx", true, false, 0);
+
+            //foreach (DataRow row in dt.Rows)
+            //{
+                
+            //    string strAccount = row["Account"].ToString();
+
+            //    System.Diagnostics.Debug.WriteLine(strAccount);
+
+            //    string strStatus = row["Status"].ToString();
+            //    if (string.IsNullOrEmpty(strStatus))
+            //    {
+            //        strStatus = "未知";
+            //    }
+
+            //    string strMail = row["Mail"].ToString();
+                
+
+            //    if (strAccount != "陈金勇" && strAccount!="南通流程邮箱")
+            //    {
+
+            //        string strUrl = $"{strAPIBaseUri}/api/Account/Modify?accountName={strAccount}&status={strStatus}&mail={strMail}";
+            //        var response = await CreateHttp().GetFromJsonAsync<ApiSaveResponse>(strUrl);
+            //    }
+            //    else
+            //    {
+            //        Console.WriteLine("");
+            //    }
+                       
+            //}
+            #endregion
+
+            //var strUrl = "https://47.106.221.167/api/PerformanceItem/CalMyStatistics?userid=98&year=2021&month=12";
+            //var response =await CreateHttp().GetFromJsonAsync<List<StaffStatistics>>(strUrl);
+
 
-            
         }
         public async Task Login()
         {

+ 9 - 0
wospro.sp.entity/ProjectContentRecord.cs

@@ -51,6 +51,15 @@ namespace wispro.sp.entity
         /// </summary>
         public double Point { get; set; }
 
+        public double? PointS { get; set; }
+        public double? PointA { get; set; }
+
+        public double? PointB { get; set; }
+
+        public double? PointC { get; set; }
+
+        public double? PointD { get; set; }
+
         /// <summary>
         /// 难度系数
         /// </summary>