浏览代码

修正附件大小为0时,申诉出错的问题
修正申诉出错时,也提示申诉成功的问题
添加导入数据时剔除处理答复意见没有完成日期的记录

luocaiyang 3 年之前
父节点
当前提交
bca636cd87

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

@@ -126,8 +126,8 @@ namespace wispro.sp.api.Controllers
             catch (Exception ex)
             {
                 t.Rollback();
-                response.Success = true;
-                response.ErrorMessage = ex.Message;
+                response.Success = false;
+                response.ErrorMessage = "申诉时发生错误!";
                 return response;
             }
         }

+ 1 - 7
wispro.sp.api/Controllers/AttachFilesController.cs

@@ -134,13 +134,7 @@ namespace wispro.sp.api.Controllers
 
                 if (filesProcessed < maxAllowedFiles)
                 {
-                    if (file.Length == 0)
-                    {
-                        logger.LogInformation("{FileName} length is 0 (Err: 1)",
-                            trustedFileNameForDisplay);
-                        //uploadResult.ErrorCode = 1;
-                    }
-                    else if (file.Length > maxFileSize)
+                    if (file.Length > maxFileSize)
                     {
                         logger.LogInformation("{FileName} of {Length} bytes is " +
                             "larger than the limit of {Limit} bytes (Err: 2)",

+ 95 - 175
wispro.sp.api/Controllers/PerformanceItemController.cs

@@ -38,6 +38,43 @@ namespace wispro.sp.api.Controllers
 
         }
 
+        public ApiSaveResponse RemoveDBNotFinishDate(int year,int month)
+        {
+            ApiSaveResponse ret = new ApiSaveResponse();
+            ret.Success = true;
+
+            var itemList = Context.PerformanceItems.Include(p=>p.ItemStaffs).Where(p => p.CalMonth.Year == year && 
+                                                    p.CalMonth.Month == month && 
+                                                    p.DoItem =="处理审查意见" &&
+                                                    p.FinishedDate ==null);
+            using var t = Context.Database.BeginTransaction();
+            try
+            {
+                foreach (var item in itemList.ToList())
+                {
+
+
+                    if (item != null)
+                    {
+                        Context.ItemStaffs.RemoveRange(item.ItemStaffs);
+                        Context.PerformanceItems.Remove(item);
+                    }
+                }
+
+                Context.SaveChanges();
+                t.Commit();
+                return ret;
+            }
+            catch (Exception ex)
+            {
+                t.Rollback();
+                ret.Success = false;
+                ret.ErrorMessage = ex.Message;
+                return ret;
+            }
+        }
+
+
         public bool IsExist(PerformanceItem item)
         {
             var results = Context.PerformanceItems.Where<PerformanceItem>(x =>
@@ -852,7 +889,7 @@ namespace wispro.sp.api.Controllers
 
         public ApiSaveResponse RefreshFromIPEasyById(int itemId)
         {
-            var Item = Context.PerformanceItems.Include(p=>p.Customer).FirstOrDefault(p => p.Id == itemId);
+            var Item = Context.PerformanceItems.Include(p=>p.Customer).Include(p=>p.ItemStaffs).ThenInclude(p=>p.DoPerson).FirstOrDefault(p => p.Id == itemId);
             if (Item != null)
             {
                 new Job.UpdateJXDataFromIPEasyJob().UpdateFromIPEasy(Item, Context);
@@ -999,65 +1036,44 @@ namespace wispro.sp.api.Controllers
             file.Size = items.Count;
             foreach(var p in items)
             {
-                if(p.CaseNo == "PAUS2117245")
-                {
-                    System.Diagnostics.Debug.WriteLine("");
-                }
-                System.Diagnostics.Debug.WriteLine(p.CaseNo);
-                
 
+                
                 List<ItemStaff> temItemStaffs = p.ItemStaffs.ToList();
 
                 string strCaseMemo = "";
-                if (p.ItemStaffs.Count > 1)
-                {
+                string strHandler = "";
+                
                     temItemStaffs = new List<ItemStaff>();
                     foreach (var iStaff in p.ItemStaffs)
                     {
-                        if (iStaff.DoPerson.Status != "试用期")
+                        strHandler = string.IsNullOrEmpty(strHandler)?iStaff.DoPerson.Name : $"{strHandler},{iStaff.DoPerson.Name}";
+                        if (iStaff.DoPerson.Status == "试用期")
                         {
-                            temItemStaffs.Add(iStaff);
+                            strCaseMemo = string.IsNullOrEmpty(strCaseMemo) ? $"{iStaff.DoPerson.Name}在试用期" : $"{strCaseMemo},{iStaff.DoPerson.Name}在试用期";
                         }
                         else
                         {
-                            strCaseMemo = string.IsNullOrEmpty(strCaseMemo) ? $"{iStaff.DoPerson.Name}" : $"{strCaseMemo},{iStaff.DoPerson.Name}";
+                            if(!iStaff.DoPerson.IsCalPerformsnce )
+                                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);
+                        if(iStaff.DoPersonId == p.ReviewerId)
+                        {
+                            strCaseMemo = String.IsNullOrEmpty(strCaseMemo) ? "核稿人与处理人相同" : $"{strCaseMemo},核稿人与处理人相同";
+                        }
+                    }
 
-                bool isPJFP = true;
-                bool isReviewerInDopersons = false;
-                if (p.ReviewerId.HasValue)
-                {
-                    isReviewerInDopersons = (p.ItemStaffs.Where(i => i.DoPersonId == p.ReviewerId).Count() > 0);
-                }
+                    
 
-                double total = temItemStaffs.Count();
-                if (temItemStaffs.Where<ItemStaff>(p => p.PerformancePoint != null || p.PerformancePoint == 0).Count() > 0)
-                {
-                    total = temItemStaffs.Select(i => i.PerformancePoint.Value).Sum();
-                    isPJFP = false;
-                }
+                var staffStatics = spDb.StaffStatistics.Include(s=>s.Staff).ThenInclude(s=>s.StaffGrade).Where(s=>s.ItemId == p.Id && s.jxType.Contains("处理"));
+                var reviewStatic = spDb.StaffStatistics.Include(s => s.Staff).ThenInclude(s => s.StaffGrade).FirstOrDefault(s => s.ItemId == p.Id && s.jxType.Contains("审核"));
 
-                foreach (var iStaff in temItemStaffs)
+                foreach (var iStaff in staffStatics.ToList())
                 {
                     DataRow row = dt.NewRow();
                     row["我方文号"] = p.CaseNo;
                     row["申请类型"] = p.ApplicationType;
+                    row["实际处理人"] = strHandler;
 
                     if(p.ApplicationName != null && p.ApplicationName.Contains("OPPO") && p.ApplicationType == "实用新型")
                     {
@@ -1075,9 +1091,9 @@ namespace wispro.sp.api.Controllers
 
                     }
 
-                    if(temItemStaffs.Count > 1)
+                    if(p.ItemStaffs.Count() > 1)
                     {
-                        row["备注(填表注意事项)"] = $"{row["备注(填表注意事项)"]},{temDoPerson}合写";
+                        row["备注(填表注意事项)"] = $"{row["备注(填表注意事项)"]},{strHandler}合写";
                     }
                     
                     row["案件阶段"] = p.CaseStage;
@@ -1107,102 +1123,15 @@ namespace wispro.sp.api.Controllers
                     row["处理事项系数"] = p.DoItemCoefficient;
                     row["前一次OA处理事项系数"] = "";
                     row["前一次OA处理人"] = p.PreOastaff?.Name;
+                    row["处理人"] = iStaff.Staff.Name;
+                    row["基本点数"] = iStaff.totalBasePoint;
+                    row["处理人绩效系数"] = iStaff.Staff.StaffGrade.Grade;
 
-                    if(iStaff.DoPerson.Status == "试用期")
+                    if(reviewStatic != null)
                     {
-                        row["实际处理人"] = iStaff.DoPerson.Name;
-                        row["案件备注"] = $"{row["案件备注"]}\r\n处理人{iStaff.DoPerson.Name}未转正";
-                        row["处理人"] = p.Reviewer?.Name;
-                        row["处理人等级"] = p.Reviewer?.StaffGrade?.Grade;
-
-                        if (isPJFP)
-                        {
-                            row["基本点数"] = (p.BasePoint  / total).ToString();
-                        }
-                        else
-                        {
-                            row["基本点数"] = (p.BasePoint * iStaff.PerformancePoint / 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["核稿人"] = reviewStatic.Staff.Name;
                     }
-                    else
-                    {
-                        row["处理人"] = iStaff.DoPerson.Name;
-                        row["处理人等级"] = iStaff.DoPerson.StaffGrade?.Grade;
-
-                        if (isPJFP)
-                        {
-                            row["基本点数"] = (p.BasePoint / total).ToString();
-                        }
-                        else
-                        {
-                            row["基本点数"] = (p.BasePoint * iStaff.PerformancePoint / total).ToString();
-                        }
-                        row["处理人绩效系数"] = iStaff.DoPerson.StaffGrade?.Coefficient;
-                        
-
-                        if (isReviewerInDopersons)
-                        {
-                            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
-                        {
-                            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["核稿人"] = "";
-                                row["核稿系数"] = "";
-                                row["核稿绩效"] = "";
-                                
-                            }
-                        }
-                        
-                    }
-
+                    
                     row["客户名称"] = p.Customer?.Name;
                     row["申请人"] = p.ApplicationName;
                     row["处理事项完成日"] = p.FinishedDate?.ToString("yyyy-MM-dd");
@@ -1221,11 +1150,11 @@ namespace wispro.sp.api.Controllers
                     row["备注(发文严重超期是否属客观原因,若为否,请填写原因"] = p.OverDueMemo;
                     row["绩效类型"] = p.Type;
                     row["案件备注"] = $"{p.CaseMemo}\r\n{row["案件备注"]}";
-                    if(!string.IsNullOrEmpty(strCaseMemo))
+                    if (!string.IsNullOrEmpty(strCaseMemo))
                     {
                         row["案件备注"] = $"{strCaseMemo}\r\n{row["案件备注"]}";
                     }
-                    
+
                     dt.Rows.Add(row);
                 }
                 
@@ -1354,7 +1283,7 @@ namespace wispro.sp.api.Controllers
                     List<StaffStatistics> retPoints = new List<StaffStatistics>();
                     try
                     {
-                        retPoints = _calItemJX(calMonth, verifyCoefficients, item, spDb);
+                        retPoints = _calItemJX( verifyCoefficients, item, spDb);
                     }
                     catch { }
                      
@@ -1450,7 +1379,7 @@ namespace wispro.sp.api.Controllers
                         List<StaffStatistics> retPoints = new List<StaffStatistics>();
                         try
                         {
-                            retPoints = _calItemJX(calMonth, verifyCoefficients, item, spDb);
+                            retPoints = _calItemJX( verifyCoefficients, item, spDb);
                         }
                         catch { }
 
@@ -1584,7 +1513,7 @@ namespace wispro.sp.api.Controllers
                     List<StaffStatistics> retPoints = new List<StaffStatistics>();
                     try
                     {
-                        retPoints = _calItemJX(calMonth, verifyCoefficients, item, spDb);
+                        retPoints = _calItemJX( verifyCoefficients, item, spDb);
                     }
                     catch { }
 
@@ -1720,7 +1649,7 @@ namespace wispro.sp.api.Controllers
             var Item = Context.PerformanceItems.Include(p=>p.CalMonth).FirstOrDefault(p=>p.Id == itemid);
             List<VerifyCoefficient> verifyCoefficients = Context.VerifyCoefficients.ToList<VerifyCoefficient>();
             
-            return _calItemJX(Item.CalMonth,verifyCoefficients,Item,Context);
+            return _calItemJX(verifyCoefficients,Item,Context);
 
         }
 
@@ -1729,8 +1658,11 @@ namespace wispro.sp.api.Controllers
         {
             List<VerifyCoefficient> verifyCoefficients = Context.VerifyCoefficients.ToList<VerifyCoefficient>();
 
-            var jxList = _calItemJX(Item.CalMonth, verifyCoefficients, Item, Context);
-            
+            var jxList = _calItemJX( verifyCoefficients, Item, Context);
+
+            var oldJxList = Context.StaffStatistics.Where(p=>p.ItemId == Item.Id);
+            Context.StaffStatistics.RemoveRange(oldJxList);
+
             foreach (var jx in jxList)
             {
                 if(jx.totalBasePoint == 0)
@@ -1738,25 +1670,14 @@ namespace wispro.sp.api.Controllers
                     return;
                 }
 
-                var temJX = Context.StaffStatistics.FirstOrDefault(j => j.ItemId == Item.Id && j.StaffId == jx.StaffId && j.CalMonthId == jx.CalMonthId);
-
-                if (temJX == null)
-                {
-                    jx.ItemId = Item.Id;
-                    Context.StaffStatistics.Add(jx);
-                }
-                else
-                {
-                    temJX.totalBasePoint = jx.totalBasePoint;
-                    temJX.totalActuallyPoint = jx.totalActuallyPoint;
-                    temJX.FinianlPoint = jx.FinianlPoint;
-                }
+                jx.ItemId = Item.Id;
+                Context.StaffStatistics.Add(jx);
 
                 Context.SaveChanges();
             }
         }
 
-        private List<StaffStatistics> _calItemJX(CalMonth calMonth, List<VerifyCoefficient> verifyCoefficients, PerformanceItem item,spDbContext spDb)
+        private List<StaffStatistics> _calItemJX( List<VerifyCoefficient> verifyCoefficients, PerformanceItem item,spDbContext spDb)
         {
             
             System.Collections.Hashtable doPersonsBL = new System.Collections.Hashtable();
@@ -1779,13 +1700,13 @@ namespace wispro.sp.api.Controllers
                     itemStaff.DoPerson = spDb.Staffs.Include(s => s.StaffGrade).FirstOrDefault(p => p.Id == itemStaff.DoPersonId);
                 }
 
-                if(itemStaff.DoPerson.Status != "试用期" || !itemStaff.DoPerson.IsCalPerformsnce )
+                if(itemStaff.DoPerson.Status == "试用期" || !itemStaff.DoPerson.IsCalPerformsnce )
                 {
-                    temIStaffs.Add(itemStaff);
+                    syqUsers += 1;
                 }
                 else
                 {
-                    syqUsers += 1;
+                    temIStaffs.Add(itemStaff);
                 }
             }
 
@@ -1816,8 +1737,8 @@ namespace wispro.sp.api.Controllers
                 //spDb.Entry(itemStaff.DoPerson).Reference(b => b.StaffGrade).Load();
 
                 #region 计算审核人绩效点数,核稿人绩效点数按照核稿人与个处理人的核稿系数计算后加总,没有找到核稿系数(比如同级别),核稿系数为0
-                if (item.ReviewerId != null && item.Type != "专案" && 
-                    item.ItemStaffs.FirstOrDefault(s=>s.DoPersonId == item.ReviewerId) == null)
+                if (item.ReviewerId != null && item.Type != "专案" &&
+                    temIStaffs.FirstOrDefault(s=>s.DoPersonId == item.ReviewerId) == null)
                 {
 
                     #region 取审核人等级审核等级系数
@@ -1835,7 +1756,7 @@ namespace wispro.sp.api.Controllers
 
                         string temJxType = $"{item.Type}审核";
 
-                        var temReviewerStatic = itemStatistics.Where<StaffStatistics>(s => s.StaffId == item.ReviewerId && s.jxType == temJxType && s.CalMonth.Id == calMonth.Id).FirstOrDefault();
+                        var temReviewerStatic = itemStatistics.Where<StaffStatistics>(s => s.StaffId == item.ReviewerId && s.jxType == temJxType && s.CalMonth.Id == item.CalMonthId).FirstOrDefault();
                         if (temReviewerStatic != null)
                         {
                             temReviewerStatic.totalBasePoint += reviewerBasePoint;
@@ -1843,12 +1764,12 @@ namespace wispro.sp.api.Controllers
                         }
                         else
                         {
-                            if (item.Reviewer.IsOnJob && itemStaff.DoPerson.Status != "试用期" && item.Reviewer.IsCalPerformsnce )  //判断是否在职
+                            if (itemStaff.DoPerson.Status != "试用期" && item.Reviewer.IsCalPerformsnce )  //判断是否在职
                             {
                                 temReviewerStatic = new StaffStatistics()
                                 {
-                                    CalMonth = calMonth,
-                                    CalMonthId = calMonth.Id,
+                                    
+                                    CalMonthId = item.CalMonthId,
                                     StaffId = item.ReviewerId.Value,
                                     totalBasePoint = reviewerBasePoint,
                                     totalActuallyPoint = reviewerBasePoint,
@@ -1903,7 +1824,7 @@ namespace wispro.sp.api.Controllers
                 }
 
                 string handlerJxType = $"{item.Type}处理";
-                var temStatic = itemStatistics.Where<StaffStatistics>(s => s.StaffId == itemStaff.DoPersonId && s.jxType == handlerJxType && s.CalMonth.Id == calMonth.Id).FirstOrDefault();
+                var temStatic = itemStatistics.Where<StaffStatistics>(s => s.StaffId == itemStaff.DoPersonId && s.jxType == handlerJxType && s.CalMonth.Id == item.CalMonthId).FirstOrDefault();
                 if (temStatic != null)
                 {
                     temStatic.totalBasePoint += handlerBasePoint;
@@ -1919,7 +1840,7 @@ namespace wispro.sp.api.Controllers
                 }
                 else
                 {
-                    if (itemStaff.DoPerson.StaffGradeId  != null && itemStaff.DoPerson.IsOnJob)
+                    if (itemStaff.DoPerson.StaffGradeId  != null && itemStaff.DoPerson.IsCalPerformsnce)
                     {
                         if (item.Type == "OA" || item.Type == "新申请")
                         {
@@ -1927,8 +1848,7 @@ namespace wispro.sp.api.Controllers
                             {
                                 temStatic = new StaffStatistics()
                                 {
-                                    CalMonth = calMonth,
-                                    CalMonthId = calMonth.Id,
+                                    CalMonthId = item.CalMonthId,
                                     StaffId = item.Reviewer.Id,
                                     totalActuallyPoint= handlerBasePoint * item.Reviewer.StaffGrade.Coefficient,
                                     totalBasePoint = handlerBasePoint,
@@ -1943,8 +1863,8 @@ namespace wispro.sp.api.Controllers
                                 itemStaff.DoPerson.StaffGrade = spDb.StaffGrades.FirstOrDefault(s=>s.Id == itemStaff.DoPerson.StaffGradeId);
                                 temStatic = new StaffStatistics()
                                 {
-                                    CalMonth = calMonth,
-                                    CalMonthId = calMonth.Id,
+                                    //CalMonth = calMonth,
+                                    CalMonthId = item.CalMonthId,
                                     StaffId = itemStaff.DoPersonId,
                                     totalActuallyPoint = handlerBasePoint * itemStaff.DoPerson.StaffGrade.Coefficient,
                                     totalBasePoint = handlerBasePoint,
@@ -1958,8 +1878,8 @@ namespace wispro.sp.api.Controllers
                         {
                             temStatic = new StaffStatistics()
                             {
-                                CalMonth = calMonth,
-                                CalMonthId = calMonth.Id,
+                                //CalMonth = calMonth,
+                                CalMonthId = item.CalMonthId,
                                 StaffId = itemStaff.DoPersonId,
                                 totalBasePoint = handlerBasePoint,
                                 totalActuallyPoint = handlerBasePoint,
@@ -2413,7 +2333,7 @@ namespace wispro.sp.api.Controllers
 
                     if (item.ReviewerId != null && item.BasePoint.HasValue)
                     {
-                        var jxList = _calItemJX(item.CalMonth, verifyCoefficients, item, new spDbContext());
+                        var jxList = _calItemJX( verifyCoefficients, item, new spDbContext());
 
                         row["核稿系数"] = "";
                         var temJx = jxList.FirstOrDefault<StaffStatistics>(s => s.jxType.Contains("审核") && s.StaffId == item.ReviewerId);

+ 61 - 4
wispro.sp.api/Job/ImportReportJob.cs

@@ -314,7 +314,7 @@ namespace wispro.sp.api.Job
 
                 if (item != null)
                 {
-                    if (!InValidDoItem.Contains(item.DoItem))
+                    if (!InValidDoItem.Contains(item.DoItem) && !isDBNotFinishedDate(item))
                     {
                         //foreach(var temObj in item.ItemStaffs)
                         //{
@@ -341,6 +341,10 @@ namespace wispro.sp.api.Job
             return Task.CompletedTask;
         }
 
+        private bool isDBNotFinishedDate(PerformanceItem item)
+        {
+            return (item.DoItem == "处理审查意见" && item.FinishedDate == null);
+        }
 
         private Task SavePerformanceItem(PerformanceItem item,List<BasePointRule> rules)
         {
@@ -400,7 +404,13 @@ namespace wispro.sp.api.Job
             {
                 ItemStaff itemStaff = new ItemStaff();
                 string temName = name.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
-                int? iTem = GetStaff(temName);
+
+                if (!name.Contains("君龙"))
+                {
+                    temName = name.Trim();
+                }
+
+                int? iTem = GetStaff(name);
                 if ((iTem != null))
                 {
                     //itemStaff.Item = item;
@@ -522,6 +532,10 @@ namespace wispro.sp.api.Job
             {
                 ItemStaff itemStaff = new ItemStaff();
                 string temName = name.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
+                if (!name.Contains("君龙"))
+                {
+                    temName = name.Trim();
+                }
                 int? iTem = GetStaff(temName);
                 if ((iTem != null))
                 {
@@ -565,7 +579,12 @@ namespace wispro.sp.api.Job
             {
                 if (!string.IsNullOrEmpty(row["业务人员"].ToString().Trim()))
                 {
-                    string temName = row["业务人员"].ToString().Trim().Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
+                    string name = row["业务人员"].ToString().Trim();
+                    string temName = name.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
+                    if (!name.Contains("君龙"))
+                    {
+                        temName = name.Trim();
+                    }
                     item.WorkflowUserId = GetStaff(temName);
                 }
             }
@@ -641,6 +660,10 @@ namespace wispro.sp.api.Job
             {
                 ItemStaff itemStaff = new ItemStaff();
                 string temName = name.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
+                if (!name.Contains("君龙"))
+                {
+                    temName = name.Trim();
+                }
                 int? iTem = GetStaff(temName);
                 if ((iTem != null))
                 {
@@ -684,7 +707,12 @@ namespace wispro.sp.api.Job
             {
                 if (!string.IsNullOrEmpty(row["业务人员"].ToString().Trim()))
                 {
+                    string name = row["业务人员"].ToString();
                     string temName = row["业务人员"].ToString().Trim().Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
+                    if (!name.Contains("君龙"))
+                    {
+                        temName = name.Trim();
+                    }
                     item.WorkflowUserId = GetStaff(temName);
                 }
             }
@@ -790,6 +818,10 @@ namespace wispro.sp.api.Job
             {
                 ItemStaff itemStaff = new ItemStaff();
                 string temName = name.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
+                if (!name.Contains("君龙"))
+                {
+                    temName = name.Trim();
+                }
                 int? iTem = GetStaff(temName);
                 if ((iTem != null))
                 {
@@ -821,7 +853,13 @@ namespace wispro.sp.api.Job
             {
                 if (!string.IsNullOrEmpty(row["核稿人"].ToString().Trim()))
                 {
-                    string temName = row["核稿人"].ToString().Trim().Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
+                    string name = row["核稿人"].ToString();
+                    string temName = name.Trim().Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
+
+                    if (!name.Contains("君龙"))
+                    {
+                        temName = name.Trim();
+                    }
                     item.ReviewerId = GetStaff(temName);
                 }
             }
@@ -831,7 +869,14 @@ namespace wispro.sp.api.Job
                 {
                     if (!string.IsNullOrEmpty(row["案件核稿人"].ToString().Trim()))
                     {
+                        string name = row["案件核稿人"].ToString();
                         string temName = row["案件核稿人"].ToString().Trim().Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
+
+                        if (!name.Contains("君龙"))
+                        {
+                            temName = name.Trim();
+                        }
+
                         item.ReviewerId = GetStaff(temName);
                     }
                 }
@@ -841,7 +886,14 @@ namespace wispro.sp.api.Job
             {
                 if (!string.IsNullOrEmpty(row["业务人员"].ToString().Trim()))
                 {
+                    string name = row["业务人员"].ToString();
                     string temName = row["业务人员"].ToString().Trim().Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
+
+                    if (!name.Contains("君龙"))
+                    {
+                        temName = name.Trim();
+                    }
+
                     item.WorkflowUserId = GetStaff(temName);
                 }
             }
@@ -932,6 +984,11 @@ namespace wispro.sp.api.Job
             if (!string.IsNullOrEmpty(v))
             {
                 string temName = v.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
+
+                if (!v.Contains("君龙"))
+                {
+                    temName = v;
+                }
                 var staff = spDb.Staffs.Where<Staff>(s => s.Name == temName).FirstOrDefault();
 
                 if (staff != null)

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

@@ -131,7 +131,12 @@ namespace wispro.sp.api.Job
                 if (!string.IsNullOrEmpty(name))
                 {
                     string temName = name.Split('-')[0].Trim();
-                    var temReviewer = spDb.Staffs.Where<Staff>(s => s.Name == name).FirstOrDefault();
+
+                    if (!name.Contains("君龙"))
+                    {
+                        temName = name;
+                    }
+                    var temReviewer = spDb.Staffs.Where<Staff>(s => s.Name == temName).FirstOrDefault();
                     if (temReviewer == null)
                     {
                         //Item.Reviewer = new Staff() { Name = retObj.Reviewer };

+ 2 - 2
wispro.sp.api/Startup.cs

@@ -86,12 +86,12 @@ namespace wispro.sp.api
                 app.UseDeveloperExceptionPage();
             }
 
-            app.UseCors(MyAllowSpecificOrigins);
-
             app.UseHttpsRedirection();
 
             app.UseRouting();
 
+            app.UseCors(MyAllowSpecificOrigins);
+
             app.UseAuthentication();
             app.UseAuthorization();
 

+ 8 - 0
wispro.sp.web/Pages/AppCase/CaseManager.razor

@@ -97,6 +97,14 @@ RenderFragment gdIcon =
                             <Icon Component="gdIcon" Style="font-size:28px;"></Icon>
                             完成本期绩效计算,归档数据
                         </a>
+
+                        if(isDownloading){
+                            <Button Icon="download" Type="@ButtonType.Text" Loading>导出线下绩效计算报表</Button>
+                        }
+                        else
+                        {
+                            <Button Icon="download" Type="@ButtonType.Text" OnClick="() => ExportCurrentMonthJXList()">导出线下绩效计算报表</Button>
+                        }
                     }
                     @if (isDownloading)
                     {

+ 16 - 0
wispro.sp.web/Pages/AppCase/CaseManager.razor.cs

@@ -133,6 +133,22 @@ namespace wispro.sp.web.Pages.AppCase
 
         }
 
+        private async Task ExportCurrentMonthJXList()
+        {
+            isDownloading = true;
+            var fileData = await _ItemService.CurrentData2Excel();
+
+            while (!fileData.Finished)
+            {
+                fileData = await _ItemService.getExportDataProcessing(fileData.Id);
+                await Task.Delay(20);
+            }
+
+            NavigationManager.NavigateTo($"{_configuration.GetValue<string>("APIUrl")}FileProcesTask/Download?Id={fileData.Id}");
+
+            isDownloading = false;
+        }
+
         async Task OnRefresh(PerformanceItem item)
         {
             item = await _ItemService.RefreshItem(item.Id);

+ 4 - 0
wispro.sp.web/Pages/AppCase/MyCaselist.razor.cs

@@ -89,6 +89,7 @@ namespace wispro.sp.web.Pages.AppCase
         {
             //_selectedItem = value;
             //Console.WriteLine($"selected: ${value?.Name}");
+            _pageIndex = 1;
             table.ReloadData();
             StateHasChanged();
         }
@@ -220,6 +221,7 @@ namespace wispro.sp.web.Pages.AppCase
         private async Task HandleTableChange(QueryModel<PerformanceItem> queryModel)
         {
             var _user = await _userService.GetUser();
+            
             if (_CurrentKey == tabList[0].Key)
             {
                 _loading = true;
@@ -346,6 +348,8 @@ namespace wispro.sp.web.Pages.AppCase
         void OnTabChange(string key)
         {
             _CurrentKey = key;
+            _pageIndex = 1;
+            //table.PageIndex = 1;
             table.ReloadData();
             StateHasChanged();
         }

+ 1 - 1
wispro.sp.web/Pages/Report/StaffStaticsReport.razor

@@ -36,7 +36,7 @@
             {
                 <div>
                     <center>
-                        <Blazor.ECharts.Components.ELine  Class="chart-normal" EventTypes="EventTypes" OnEventCallback="OnEchartsEvent" @ref="chart"/>
+                        <Blazor.ECharts.Components.ELine Option="option" Class="chart-normal" EventTypes="EventTypes" OnEventCallback="OnEchartsEvent" @ref="chart"/>
                         @{
                             System.Data.DataTable tableData = Datas.GetTableData();
 

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

@@ -66,6 +66,13 @@ namespace wispro.sp.web.Services
             return fileData;
         }
 
+        public async Task<FileProcessTask> CurrentData2Excel()
+        {
+            var fileData = await _httpClient.Get<FileProcessTask>($"PerformanceItem/CurrentData2Excel");
+
+            return fileData;
+        }
+
         public async Task<FileProcessTask> ExportData(int userid, jxType jxType,int DoingOrReview=0)
         {
             QueryFilter query = new QueryFilter();

+ 22 - 1
wispro.sp.winClient/Form1.cs

@@ -188,6 +188,7 @@ namespace wispro.sp.winClient
        
         private async void button3_Click(object sender, EventArgs e)
         {
+            //await RemoveDBNotFinishedDate();
             await CalJXPoint();
             //await RefreshPerformanceItem(3);
             //await UpdateStaff();
@@ -594,7 +595,18 @@ namespace wispro.sp.winClient
             }
 
             await CalJXPointAsync(2022,2);
-            await CalJXPointAsync(2022, 1);
+            //await CalJXPointAsync(2022, 1);
+        }
+
+        private async Task RemoveDBNotFinishedDate()
+        {
+            if (Token == null)
+            {
+                await Login();
+            }
+
+            await DeleteDBNotFinishedTimeAsync(2022, 2);
+            //await CalJXPointAsync(2022, 1);
         }
 
         List<string> lstJXBL = new List<string>() {
@@ -1162,6 +1174,15 @@ namespace wispro.sp.winClient
             return data;
         }
 
+        private async Task<PerformanceItem> DeleteDBNotFinishedTimeAsync(int year, int month)
+        {
+            HttpClient http = CreateHttp();
+            http.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("bearer", Token.Token);
+            var data = await http.GetFromJsonAsync<PerformanceItem>($"{strAPIBaseUri}/api/PerformanceItem/RemoveDBNotFinishDate?year={year}&month={month}");
+
+            return data;
+        }
+
         private async Task<PerformanceItem> RefreshItemAsync(int type)
         {
             HttpClient http = CreateHttp();