Przeglądaj źródła

修正计算绩效规则如下:

luocaiyang 3 lat temu
rodzic
commit
096cec685f

+ 7 - 0
wispro.sp.api/AppealHandler/ChangeDoPersonReviewer.cs

@@ -26,6 +26,13 @@ namespace wispro.sp.api.AppealHandler
                     isAggree = true;
                     break;
                 }
+                else
+                {
+                    if(iv.InputField.FieldName == "审核意见" && string.IsNullOrEmpty(iv.Value))
+                    {
+                        throw (new ApplicationException("请填写审核意见!"));
+                    }
+                }
 
             }
             if (isAggree)

+ 7 - 0
wispro.sp.api/AppealHandler/ChangeReviewerReviewer.cs

@@ -23,6 +23,13 @@ namespace wispro.sp.api.AppealHandler
                     isAggree = true;
                     break;
                 }
+                else
+                {
+                    if (iv.InputField.FieldName == "审核意见" && string.IsNullOrEmpty(iv.Value))
+                    {
+                        throw (new ApplicationException("请填写审核意见!"));
+                    }
+                }
 
             }
             if (isAggree)

+ 7 - 0
wispro.sp.api/AppealHandler/MissingCaseReviewHandler.cs

@@ -27,6 +27,13 @@ namespace wispro.sp.api.AppealHandler
                     isAggree = true;
                     break;
                 }
+                else
+                {
+                    if (iv.InputField.FieldName == "审核意见" && string.IsNullOrEmpty(iv.Value))
+                    {
+                        throw (new ApplicationException("请填写审核意见!"));
+                    }
+                }
 
             }
             if (isAggree)

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

@@ -37,7 +37,7 @@ namespace wispro.sp.api.Controllers
         {
             //添加验证代码
             
-            Staff staff = dbContext.Staffs.Where<Staff>(s => s.Account == loginUser.Name).FirstOrDefault(); //
+            Staff staff = dbContext.Staffs.Where<Staff>(s => s.Account == loginUser.Name && s.Password == utility.MD5Utility.GetMD5(loginUser.Password)).FirstOrDefault(); //
 
             if (staff != null)
             {

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

@@ -217,7 +217,7 @@ namespace wispro.sp.api.Controllers
 
                     Context.SaveChanges();
 
-                    new PerformanceItemController(Context, new Services.FileTaskCacheService()).RefreshBasePoint();
+                    //new PerformanceItemController(Context, new Services.FileTaskCacheService()).RefreshBasePoint();
                     t.Commit();
 
                     return response;

+ 332 - 214
wispro.sp.api/Controllers/PerformanceItemController.cs

@@ -134,6 +134,11 @@ namespace wispro.sp.api.Controllers
                             {
                                 _calItemJX(item,Context);
                             }
+                            else
+                            {
+                                var oldJxList = Context.StaffStatistics.Where(p => p.ItemId == item.Id);
+                                Context.StaffStatistics.RemoveRange(oldJxList);
+                            }
 
                             Context.SaveChanges();
                         }
@@ -313,6 +318,11 @@ namespace wispro.sp.api.Controllers
                     {
                         _calItemJX(item,Context);
                     }
+                    else
+                    {
+                        var oldJxList = Context.StaffStatistics.Where(p => p.ItemId == item.Id);
+                        Context.StaffStatistics.RemoveRange(oldJxList);
+                    }
 
                     Context.SaveChanges();
                 }
@@ -468,11 +478,11 @@ namespace wispro.sp.api.Controllers
 
             string jxType = isReivewer ? "新申请审核" : "新申请处理";
 
-            var results = spDb.StaffStatistics.Where(s => s.CalMonthId == calMonth.Id && s.jxType == jxType && s.StaffId == userId);
+            var results = spDb.StaffStatistics.Include(p => p.Item).Where(s => s.CalMonthId == calMonth.Id && s.jxType == jxType && s.StaffId == userId);
 
             if (!isReivewer)
             {
-                results = spDb.StaffStatistics.Where(s => s.CalMonthId == calMonth.Id && (s.jxType == jxType || s.jxType == "专案处理") && s.StaffId == userId);
+                results = spDb.StaffStatistics.Include(p=>p.Item).Where(s => s.CalMonthId == calMonth.Id && (s.jxType == jxType || s.jxType == "专案处理") && s.StaffId == userId);
             }
                 
             #region 循环计算
@@ -482,104 +492,107 @@ namespace wispro.sp.api.Controllers
 
             foreach (var item in retList)
             {
-                string strCaseCeoffcient = item.Item.CaseCoefficient;
-
-                if (string.IsNullOrEmpty(strCaseCeoffcient))
+                if (item.Item != null)
                 {
-                    strCaseCeoffcient = "B";
-                }
+                    string strCaseCeoffcient = item.Item.CaseCoefficient;
 
-                #region 严重延期降系数
-                if (item.Item.isDanger() && string.IsNullOrEmpty(item.Item.OverDueMemo))
-                {
-                    switch (item.Item.CaseCoefficient)
+                    if (string.IsNullOrEmpty(strCaseCeoffcient))
+                    {
+                        strCaseCeoffcient = "B";
+                    }
+
+                    #region 严重延期降系数
+                    if (item.Item.isDanger() && string.IsNullOrEmpty(item.Item.OverDueMemo))
+                    {
+                        switch (item.Item.CaseCoefficient)
+                        {
+                            case "S":
+                                strCaseCeoffcient = "A";
+                                break;
+                            case "A":
+                                strCaseCeoffcient = "B";
+                                break;
+                            case "B":
+                                strCaseCeoffcient = "C";
+                                break;
+                            case "C":
+                                strCaseCeoffcient = "D";
+                                break;
+                        }
+                    }
+                    #endregion
+
+                    switch (strCaseCeoffcient)
                     {
                         case "S":
-                            strCaseCeoffcient = "A";
+                            if (item.Item.Type == "专案")
+                            {
+                                retObj.S += item.totalBasePoint.Value;
+                            }
+                            else
+                            {
+                                retObj.S += 1;
+                            }
+
                             break;
                         case "A":
-                            strCaseCeoffcient = "B";
+                            if (item.Item.Type == "专案")
+                            {
+                                retObj.A += item.totalBasePoint.Value;
+                            }
+                            else
+                            {
+                                retObj.A += 1;
+                            }
                             break;
                         case "B":
-                            strCaseCeoffcient = "C";
+                            if (item.Item.Type == "专案")
+                            {
+                                retObj.B += item.totalBasePoint.Value;
+                            }
+                            else
+                            {
+                                retObj.B += 1;
+                            }
                             break;
                         case "C":
-                            strCaseCeoffcient = "D";
+                            if (item.Item.Type == "专案")
+                            {
+                                retObj.C += item.totalBasePoint.Value;
+                            }
+                            else
+                            {
+                                retObj.C += 1;
+                            }
+                            break;
+                        case "D":
+                            if (item.Item.Type == "专案")
+                            {
+                                retObj.D += item.totalBasePoint.Value;
+                            }
+                            else
+                            {
+                                retObj.D += 1;
+                            }
+                            break;
+                        default:
+                            if (item.Item.Type == "专案")
+                            {
+                                retObj.B += item.totalBasePoint.Value;
+                            }
+                            else
+                            {
+                                retObj.B += 1;
+                            }
                             break;
-                    }
-                }
-                #endregion
-
-                switch (strCaseCeoffcient)
-                {
-                    case "S":
-                        if (item.Item.Type == "专案")
-                        {
-                            retObj.S += item.totalBasePoint.Value;
-                        }
-                        else
-                        {
-                            retObj.S += 1;
-                        }
-
-                        break;
-                    case "A":
-                        if (item.Item.Type == "专案")
-                        {
-                            retObj.A += item.totalBasePoint.Value;
-                        }
-                        else
-                        {
-                            retObj.A += 1;
-                        }
-                        break;
-                    case "B":
-                        if (item.Item.Type == "专案")
-                        {
-                            retObj.B += item.totalBasePoint.Value;
-                        }
-                        else
-                        {
-                            retObj.B += 1;
-                        }
-                        break;
-                    case "C":
-                        if (item.Item.Type == "专案")
-                        {
-                            retObj.C += item.totalBasePoint.Value;
-                        }
-                        else
-                        {
-                            retObj.C += 1;
-                        }
-                        break;
-                    case "D":
-                        if (item.Item.Type == "专案")
-                        {
-                            retObj.D += item.totalBasePoint.Value;
-                        }
-                        else
-                        {
-                            retObj.D += 1;
-                        }
-                        break;
-                    default:
-                        if (item.Item.Type == "专案")
-                        {
-                            retObj.B += item.totalBasePoint.Value;
-                        }
-                        else
-                        {
-                            retObj.B += 1;
-                        }
-                        break;
 
-                }
+                    }
 
-                if (CaseXiShu.ContainsKey(strCaseCeoffcient))
-                {
-                    d += CaseXiShu[strCaseCeoffcient];
-                    iCount += 1;
+                    if (CaseXiShu.ContainsKey(strCaseCeoffcient))
+                    {
+                        d += CaseXiShu[strCaseCeoffcient];
+                        iCount += 1;
+                    }
                 }
 
             }
@@ -602,9 +615,9 @@ namespace wispro.sp.api.Controllers
             NanduStatics retObj = new NanduStatics();
             
             IDictionary<string, double> CaseXiShu = new Dictionary<string, double>();
-            var list = Context.CaseCeoffcients;
+            var list = spDb.CaseCeoffcients.ToList();
 
-            foreach (var cx in list.ToList<CaseCeoffcient>())
+            foreach (var cx in list)
             {
                 CaseXiShu.Add(cx.Ceoffcient, cx.Value);
             }
@@ -860,23 +873,53 @@ namespace wispro.sp.api.Controllers
         private void _RefreshBasePoint()
         {
             spDbContext spDb = new spDbContext();
-            var lstItem = spDb.PerformanceItems.Include(p => p.Customer).Where(p => p.CalMonth.Status != 4).ToList();
-            var rules = spDb.BasePointRules.ToList();
-            foreach (var item in lstItem)
+
+            var calMonth = spDb.CalMonths.FirstOrDefault(c => c.Status == 0);
+            _RefreshBasePoint(calMonth,spDb);
+
+        }
+
+        private void _RefreshBasePoint(CalMonth calMonth,spDbContext spDb )
+        {
+            if (calMonth != null)
             {
-                if (item.AgentFeedbackMemo != "特殊点数申诉")
+                var lstItem = spDb.PerformanceItems
+                    .Include(p => p.Customer)
+                    .Include(p => p.ItemStaffs)
+                    .Include(p => p.Reviewer)
+                    .Include(p => p.CalMonth)
+                    .Where(p => p.CalMonthId == calMonth.Id).ToList();
+
+                var rules = spDb.BasePointRules.ToList();
+
+                foreach (var item in lstItem)
                 {
-                    Utility.Utility.CalBasePoint(item, rules);
+                    try
+                    {
+                        Utility.Utility.CalBasePoint(item, rules);
+
+                        if (item.BasePoint > 0)
+                        {
+                            _calItemJX(item, spDb);
+                        }
+                        else
+                        {
+                            var oldJxList = spDb.StaffStatistics.Where(p => p.ItemId == item.Id);
+                            spDb.StaffStatistics.RemoveRange(oldJxList);
+                        }
 
-                    if(item.BasePoint > 0)
+                        spDb.SaveChanges();
+                    }
+                    catch (Exception ex)
                     {
-                        _calItemJX(item,spDb);
+                        System.Diagnostics.Debug.WriteLine(ex.Message);
                     }
-
-                    spDb.SaveChanges();
                 }
+
+                _CalJXPoint(calMonth, spDb);
             }
         }
+
         public ApiSaveResponse RefreshBasePoint()
         {
             System.Threading.Thread t = new Thread(_RefreshBasePoint);
@@ -887,6 +930,31 @@ namespace wispro.sp.api.Controllers
             };
         }
 
+        public void RefreshPoint(PerformanceItem item)
+        {
+            spDbContext spDb = new spDbContext();
+            
+            var rules = spDb.BasePointRules.ToList();
+            
+            if (item.AgentFeedbackMemo != "特殊点数申诉")
+            {
+                Utility.Utility.CalBasePoint(item, rules);
+
+                if (item.BasePoint > 0)
+                {
+                    _calItemJX(item, spDb);
+                }
+                else
+                {
+                    var oldJxList = Context.StaffStatistics.Where(p => p.ItemId == item.Id);
+                    Context.StaffStatistics.RemoveRange(oldJxList);
+                }
+
+                spDb.SaveChanges();
+            }
+            
+        }
+
         public ApiSaveResponse RefreshFromIPEasyById(int itemId)
         {
             var Item = Context.PerformanceItems.Include(p=>p.Customer).Include(p=>p.ItemStaffs).ThenInclude(p=>p.DoPerson).FirstOrDefault(p => p.Id == itemId);
@@ -901,6 +969,11 @@ namespace wispro.sp.api.Controllers
             {
                 _calItemJX(Item,Context);
             }
+            else
+            {
+                var oldJxList = Context.StaffStatistics.Where(p => p.ItemId == Item.Id);
+                Context.StaffStatistics.RemoveRange(oldJxList);
+            }
             Context.SaveChanges();
 
             return new ApiSaveResponse()
@@ -1075,10 +1148,10 @@ namespace wispro.sp.api.Controllers
                     row["申请类型"] = p.ApplicationType;
                     row["实际处理人"] = strHandler;
 
-                    if(p.ApplicationName != null && p.ApplicationName.Contains("OPPO") && p.ApplicationType == "实用新型")
+                    if(p.ApplicationName != null && p.ApplicationName.Contains("OPPO") && p.ApplicationType == "实用新型" && p.Type =="新申请")
                     {
                         row["申请类型"] = "发明";
-                        row["案件备注"] = $"{row["案件备注"]}\r\nOPPO案件实用新型修改为发明】";
+                        row["案件备注"] = $"{row["案件备注"]}\r\nOPPO案件实用新型修改为发明】";
                     }
                     row["处理事项"] = p.DoItem;
                     row["业务类型"] = p.BusinessType;
@@ -1125,13 +1198,23 @@ namespace wispro.sp.api.Controllers
                     row["前一次OA处理人"] = p.PreOastaff?.Name;
                     row["处理人"] = iStaff.Staff.Name;
                     row["基本点数"] = iStaff.totalBasePoint;
-                    row["处理人绩效系数"] = iStaff.Staff.StaffGrade.Grade;
+                    row["处理人等级"] = iStaff.Staff.StaffGrade.Grade;
+                    row["处理人绩效系数"] = iStaff.Staff.StaffGrade.Coefficient;
 
-                    if(reviewStatic != null)
+                    if (reviewStatic != null)
                     {
                         row["核稿人"] = reviewStatic.Staff.Name;
+
+                        var v = verifyCeoffients.FirstOrDefault(p => p.CheckerId == reviewStatic.Staff.StaffGradeId && p.DoPersonId == iStaff.Staff.StaffGradeId);
+                        if (v != null)
+                        {
+                            row["核稿绩效"] = ((decimal)iStaff.totalBasePoint * (decimal)v.Coefficient);
+                            row["核稿系数"] = v.Coefficient;
+                        }
+
+
                     }
-                    
+
                     row["客户名称"] = p.Customer?.Name;
                     row["申请人"] = p.ApplicationName;
                     row["处理事项完成日"] = p.FinishedDate?.ToString("yyyy-MM-dd");
@@ -1646,7 +1729,11 @@ namespace wispro.sp.api.Controllers
 
         public List<StaffStatistics> CalItemJX(int itemid)
         {
-            var Item = Context.PerformanceItems.Include(p=>p.CalMonth).FirstOrDefault(p=>p.Id == itemid);
+            var Item = Context.PerformanceItems.Include(p=>p.CalMonth)
+                .Include(p=>p.ItemStaffs).ThenInclude(p=>p.DoPerson).ThenInclude(s=>s.StaffGrade)
+                .Include(p=>p.Reviewer)
+                .Include(p=>p.Customer)
+                .FirstOrDefault(p=>p.Id == itemid);
             List<VerifyCoefficient> verifyCoefficients = Context.VerifyCoefficients.ToList<VerifyCoefficient>();
             
             return _calItemJX(verifyCoefficients,Item,Context);
@@ -1677,6 +1764,22 @@ namespace wispro.sp.api.Controllers
             }
         }
 
+        /// <summary>
+        /// 序号	情况		                          处理逻辑
+        ///  1	    处理人试用期算绩效 一人处理           正常算绩效给处理人
+        ///  2	    处理人试用期不算绩效 一人处理         算给核稿人,如果没有核稿人,这条数据忽略
+        ///  3	    处理人试用期算绩效 与人合写           合写人算绩效、与合写人一人一半
+        ///  4	    处理人试用期不算绩效 与人合写         合写人算绩效、全部绩效算给合写人
+        ///  5	    处理人试用期不算绩效 与人合写         合写人不算算绩效、这条数据忽略
+        ///  6	    处理人试用期算绩效 与人合写           合写人不算绩效、试用期人员拿一半
+        ///  7	    处理人不算绩效 一人处理               这条数据忽略
+        ///  8	    处理人不算绩效 与人合写               合写人算绩效、合写人拿一半
+        ///  9	    处理人不算绩效 与人合写               合写人不算绩效、这条数据忽略
+        /// </summary>
+        /// <param name="verifyCoefficients"></param>
+        /// <param name="item"></param>
+        /// <param name="spDb"></param>
+        /// <returns></returns>
         private List<StaffStatistics> _calItemJX( List<VerifyCoefficient> verifyCoefficients, PerformanceItem item,spDbContext spDb)
         {
             
@@ -1685,13 +1788,15 @@ namespace wispro.sp.api.Controllers
             
             List<StaffStatistics> itemStatistics = new List<StaffStatistics>();
 
-            if (item.ReviewerId  != null)
+            if (item.ReviewerId  != null && item.Reviewer == null)
             {
                 item.Reviewer  = spDb.Staffs.Include(s => s.StaffGrade).FirstOrDefault(p => p.Id == item.ReviewerId);
                 //spDb.Entry(item.Reviewer).Reference(b => b.StaffGrade).Load();
             }
 
             List<ItemStaff> temIStaffs = new List<ItemStaff>();
+
+            #region 将试用期且不算绩效的人员从处理人清单中剔除
             int syqUsers = 0;
             foreach(var itemStaff in item.ItemStaffs)
             {
@@ -1700,7 +1805,7 @@ 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 )
                 {
                     syqUsers += 1;
                 }
@@ -1709,8 +1814,10 @@ namespace wispro.sp.api.Controllers
                     temIStaffs.Add(itemStaff);
                 }
             }
+            #endregion
 
-            if(syqUsers == item.ItemStaffs.Count)
+            #region 处理人全部是试用期人员,则将核稿人当成处理人(处理人为试用期人)
+            if (syqUsers == item.ItemStaffs.Count)
             {
                 if(item.Reviewer != null)
                 {
@@ -1718,9 +1825,16 @@ namespace wispro.sp.api.Controllers
                 }
                 
             }
+            #endregion
 
             bool isPJFP = true;
             double total = temIStaffs.Count();
+
+            if (total > 1)
+            {
+                System.Diagnostics.Debug.WriteLine("");
+            }
+
             if (temIStaffs.Where<ItemStaff>(p => p.PerformancePoint != null || p.PerformancePoint == 0).Count() > 0)
             {
                 total = temIStaffs.Select(i => i.PerformancePoint.Value).Sum();
@@ -1733,164 +1847,160 @@ namespace wispro.sp.api.Controllers
                 {
                     itemStaff.DoPerson = spDb.Staffs.Include(s=>s.StaffGrade).FirstOrDefault(p=>p.Id==itemStaff.DoPersonId);
                 }
-                //spDb.Entry(itemStaff).Reference(b => b.DoPerson).Load();
-                //spDb.Entry(itemStaff.DoPerson).Reference(b => b.StaffGrade).Load();
 
-                #region 计算审核人绩效点数,核稿人绩效点数按照核稿人与个处理人的核稿系数计算后加总,没有找到核稿系数(比如同级别),核稿系数为0
-                if (item.ReviewerId != null && item.Type != "专案" &&
-                    temIStaffs.FirstOrDefault(s=>s.DoPersonId == item.ReviewerId) == null)
+                if (itemStaff.DoPerson.IsCalPerformsnce)
                 {
-
-                    #region 取审核人等级审核等级系数
-                    VerifyCoefficient vcoefficient
-                        = verifyCoefficients.Where<VerifyCoefficient>(v =>
-                            v.CheckerId == item.Reviewer.StaffGradeId
-                            && v.DoPersonId == itemStaff.DoPerson.StaffGradeId)
-                    .FirstOrDefault<VerifyCoefficient>();
-                    #endregion
-
-                    if (vcoefficient != null)
+                    #region 计算各处理人的绩效点数
+                    double handlerBasePoint;
+                    if (item.Type != "专案")
                     {
-                        double reviewerBasePoint = item.BasePoint.Value * vcoefficient.Coefficient;
-
-
-                        string temJxType = $"{item.Type}审核";
-
-                        var temReviewerStatic = itemStatistics.Where<StaffStatistics>(s => s.StaffId == item.ReviewerId && s.jxType == temJxType && s.CalMonth.Id == item.CalMonthId).FirstOrDefault();
-                        if (temReviewerStatic != null)
+                        if (isPJFP)
                         {
-                            temReviewerStatic.totalBasePoint += reviewerBasePoint;
-                            temReviewerStatic.totalActuallyPoint += reviewerBasePoint;
+                            handlerBasePoint = item.BasePoint.Value * 1.0 / total;
                         }
                         else
                         {
-                            if (itemStaff.DoPerson.Status != "试用期" && item.Reviewer.IsCalPerformsnce )  //判断是否在职
-                            {
-                                temReviewerStatic = new StaffStatistics()
-                                {
-                                    
-                                    CalMonthId = item.CalMonthId,
-                                    StaffId = item.ReviewerId.Value,
-                                    totalBasePoint = reviewerBasePoint,
-                                    totalActuallyPoint = reviewerBasePoint,
-                                    jxType = temJxType
-                                };
-
-                                itemStatistics.Add(temReviewerStatic);
-                            }
+                            handlerBasePoint = (double)((decimal)item.BasePoint.Value * (decimal)itemStaff.PerformancePoint.Value / (decimal)total);
                         }
                     }
-                }
-                #endregion
-
-                #region 计算各处理人的绩效点数
-                double handlerBasePoint;
-                if (item.Type != "专案")
-                {
-                    if (isPJFP)
-                    {
-                        handlerBasePoint = item.BasePoint.Value * 1.0 / total;
-                    }
                     else
                     {
-                        handlerBasePoint = item.BasePoint.Value * itemStaff.PerformancePoint.Value / total;
-                    }
-                }
-                else
-                {
-                    if (itemStaff.PerformancePoint == null)
-                    {
-                        if (isPJFP)
+                        if (itemStaff.PerformancePoint == null)
                         {
-                            handlerBasePoint = item.BasePoint.Value * 1.0 / total;
+                            if (isPJFP)
+                            {
+                                handlerBasePoint = item.BasePoint.Value * 1.0 / total;
+                            }
+                            else
+                            {
+                                handlerBasePoint = (double)((decimal)item.BasePoint.Value * (decimal)itemStaff.PerformancePoint.Value / (decimal)total);
+                            }
                         }
                         else
                         {
-                            handlerBasePoint = item.BasePoint.Value * itemStaff.PerformancePoint.Value / total;
+                            if (item.ItemStaffs.Count == 1 && itemStaff.PerformancePoint == 0)
+                            {
+                                handlerBasePoint = item.BasePoint.Value;
+                            }
+                            else
+                            {
+                                handlerBasePoint = itemStaff.PerformancePoint.Value;
+                            }
+
                         }
                     }
-                    else
+
+                    string handlerJxType = $"{item.Type}处理";
+                    var temStatic = itemStatistics.Where<StaffStatistics>(s => s.StaffId == itemStaff.DoPersonId && s.jxType == handlerJxType && s.CalMonth.Id == item.CalMonthId).FirstOrDefault();
+                    if (temStatic != null)
                     {
-                        if(item.ItemStaffs.Count ==1 && itemStaff .PerformancePoint == 0)
+                        temStatic.totalBasePoint += handlerBasePoint;
+
+                        if (item.Type == "OA" || item.Type == "新申请")
                         {
-                            handlerBasePoint = item.BasePoint.Value;
+                            temStatic.totalActuallyPoint += (double)((decimal)handlerBasePoint * (decimal)itemStaff.DoPerson.StaffGrade.Coefficient);
                         }
                         else
                         {
-                            handlerBasePoint = itemStaff.PerformancePoint.Value;
+                            temStatic.totalActuallyPoint += handlerBasePoint;
                         }
-                        
-                    }
-                }
-
-                string handlerJxType = $"{item.Type}处理";
-                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;
-
-                    if (item.Type == "OA" || item.Type == "新申请")
-                    {
-                        temStatic.totalActuallyPoint += handlerBasePoint * itemStaff.DoPerson.StaffGrade.Coefficient;
                     }
                     else
                     {
-                        temStatic.totalActuallyPoint += handlerBasePoint;
-                    }
-                }
-                else
-                {
-                    if (itemStaff.DoPerson.StaffGradeId  != null && itemStaff.DoPerson.IsCalPerformsnce)
-                    {
-                        if (item.Type == "OA" || item.Type == "新申请")
+                        if (itemStaff.DoPerson.StaffGradeId != null && itemStaff.DoPerson.IsCalPerformsnce)
                         {
-                            if (itemStaff.DoPerson.Status == "试用期" && item.Reviewer != null)
+                            if (item.Type == "OA" || item.Type == "新申请")
                             {
+                                if (itemStaff.DoPerson.StaffGrade == null)
+                                {
+                                    itemStaff.DoPerson.StaffGrade = spDb.StaffGrades.FirstOrDefault(s => s.Id == itemStaff.DoPerson.StaffGradeId);
+                                }
+
                                 temStatic = new StaffStatistics()
                                 {
+                                    //CalMonth = calMonth,
                                     CalMonthId = item.CalMonthId,
-                                    StaffId = item.Reviewer.Id,
-                                    totalActuallyPoint= handlerBasePoint * item.Reviewer.StaffGrade.Coefficient,
+                                    StaffId = itemStaff.DoPersonId,
+                                    totalActuallyPoint = (double)((decimal)handlerBasePoint * (decimal)itemStaff.DoPerson.StaffGrade.Coefficient),
                                     totalBasePoint = handlerBasePoint,
                                     jxType = handlerJxType
                                 };
 
-
                                 itemStatistics.Add(temStatic);
+                                
                             }
                             else
                             {
-                                itemStaff.DoPerson.StaffGrade = spDb.StaffGrades.FirstOrDefault(s=>s.Id == itemStaff.DoPerson.StaffGradeId);
                                 temStatic = new StaffStatistics()
                                 {
                                     //CalMonth = calMonth,
                                     CalMonthId = item.CalMonthId,
                                     StaffId = itemStaff.DoPersonId,
-                                    totalActuallyPoint = handlerBasePoint * itemStaff.DoPerson.StaffGrade.Coefficient,
                                     totalBasePoint = handlerBasePoint,
+                                    totalActuallyPoint = handlerBasePoint,
                                     jxType = handlerJxType
                                 };
 
                                 itemStatistics.Add(temStatic);
                             }
                         }
-                        else
+                    }
+                    #endregion
+
+                    #region 计算审核人绩效点数,核稿人绩效点数按照核稿人与个处理人的核稿系数计算后加总,没有找到核稿系数(比如同级别),核稿系数为0
+                    if (item.ReviewerId != null && item.Type != "专案" &&
+                        temIStaffs.FirstOrDefault(s => s.DoPersonId == item.ReviewerId) == null)
+                    {
+                        if(item.Reviewer == null)
+                        {
+                            item.Reviewer = spDb.Staffs.FirstOrDefault(s=>s.Id == item.ReviewerId);
+                        }
+
+                        if (item.Reviewer.IsCalPerformsnce)
                         {
-                            temStatic = new StaffStatistics()
+                            #region 取审核人等级审核等级系数
+                            VerifyCoefficient vcoefficient
+                                = verifyCoefficients.Where<VerifyCoefficient>(v =>
+                                    v.CheckerId == item.Reviewer.StaffGradeId
+                                    && v.DoPersonId == itemStaff.DoPerson.StaffGradeId)
+                            .FirstOrDefault<VerifyCoefficient>();
+                            #endregion
+
+                            if (vcoefficient != null)
                             {
-                                //CalMonth = calMonth,
-                                CalMonthId = item.CalMonthId,
-                                StaffId = itemStaff.DoPersonId,
-                                totalBasePoint = handlerBasePoint,
-                                totalActuallyPoint = handlerBasePoint,
-                                jxType = handlerJxType
-                            };
-
-                            itemStatistics.Add(temStatic);
+                                double reviewerBasePoint = (double)((decimal)handlerBasePoint * (decimal)vcoefficient.Coefficient);
+
+
+                                string temJxType = $"{item.Type}审核";
+
+                                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;
+                                    temReviewerStatic.totalActuallyPoint += reviewerBasePoint;
+                                }
+                                else
+                                {
+                                    if (itemStaff.DoPerson.Status != "试用期" && item.Reviewer.IsCalPerformsnce)  //判断是否在职
+                                    {
+                                        temReviewerStatic = new StaffStatistics()
+                                        {
+
+                                            CalMonthId = item.CalMonthId,
+                                            StaffId = item.ReviewerId.Value,
+                                            totalBasePoint = reviewerBasePoint,
+                                            totalActuallyPoint = reviewerBasePoint,
+                                            jxType = temJxType
+                                        };
+
+                                        itemStatistics.Add(temReviewerStatic);
+                                    }
+                                }
+                            }
                         }
                     }
+                    #endregion
                 }
-                #endregion
             }
 
             return itemStatistics;
@@ -1982,7 +2092,7 @@ namespace wispro.sp.api.Controllers
                 if (ss.jxType == "新申请处理" || ss.jxType == "专案处理")
                 {
                     ss.FinianlPoint = ss.FinianlPoint / totalFPBLPoint * (totalFPBLPoint + jlPoint);
-                    Context.SaveChanges();
+                    spDb.SaveChanges();
                 }
             }
             #endregion
@@ -2000,8 +2110,11 @@ namespace wispro.sp.api.Controllers
                         var result = Context.StaffStatistics.Where(s => s.CalMonthId == calMonth.Id);
                         Context.StaffStatistics.RemoveRange(result);
 
-                        var itemList = Context.PerformanceItems.Include(s => s.ItemStaffs).
-                            Where(s => s.CalMonthId == calMonth.Id).ToList();
+                        var itemList = Context.PerformanceItems
+                            .Include(s => s.ItemStaffs)
+                            .Include(p=>p.Customer)
+                            .Include(p=>p.Reviewer)
+                            .Where(s => s.CalMonthId == calMonth.Id).ToList();
 
                         var rules = Context.BasePointRules.ToList();
 
@@ -2014,8 +2127,12 @@ namespace wispro.sp.api.Controllers
                             {
                                 _calItemJX(item,Context);
                             }
+                            else
+                            {
+                                var oldJxList = Context.StaffStatistics.Where(p => p.ItemId == item.Id);
+                                Context.StaffStatistics.RemoveRange(oldJxList);
+                            }
 
-                            //_CalItemJX(item.Id);
                         }
 
                         _CalJXPoint(calMonth, Context);
@@ -2056,7 +2173,8 @@ namespace wispro.sp.api.Controllers
                 {
                     try
                     {
-                        _CalJXPoint(calMonth, Context);
+                        _RefreshBasePoint(calMonth,Context);
+                        //_CalJXPoint(calMonth, Context);
 
                         calMonth.Status = 4;
                         Context.SaveChanges();

+ 48 - 1
wispro.sp.api/Controllers/ProjectController.cs

@@ -291,7 +291,7 @@ namespace wispro.sp.api.Controllers
 
                         if (finanlJXDic.Count == 0)
                         {
-                            //throw new ApplicationException("没有填写最终绩效!");
+                            throw new ApplicationException("请填写最终绩效!");
                         }
 
                         if (saveObj.ProjectContentRecord.State == 2)
@@ -351,6 +351,8 @@ namespace wispro.sp.api.Controllers
                                     item.CaseCoefficient = strKey;
                                     Context.SaveChanges();
                                 }
+
+                                new PerformanceItemController(Context, new Services.FileTaskCacheService()).CalItemJX(item.Id);
                             }
                         }
                         
@@ -543,5 +545,50 @@ namespace wispro.sp.api.Controllers
 
             return retList;
         }
+
+        public List<ProjectContents> GetProjectHisttory(string projectNo)
+        {
+            var pcrList = Context.ProjectContentRecords
+                .Include(p => p.CalMonth)
+                .Include(p => p.Reviewer)
+                .Include(p => p.Staff)
+                .Include(p => p.Project).ThenInclude(p => p.Customer)
+                .Include(p => p.ProjectWorkContents)
+                .Where(p => p.ProjectNo == projectNo && p.State == 2)
+                .OrderByDescending(p=>p.SubmitTime)
+                .ToList();
+            
+
+            List<ProjectContents> retList = new List<ProjectContents>();
+            foreach (var retObj in pcrList)
+            {
+                ProjectContents ret = new ProjectContents();
+
+                ret.ProjectContentRecord = retObj;
+                ret.ProjectWorkContents = new List<ViewProjectWorkContent>();
+
+                foreach (var wContent in retObj.ProjectWorkContents)
+                {
+                    ViewProjectWorkContent tem = new ViewProjectWorkContent();
+                    tem.modifyState = ModifyState.UnChanged;
+                    tem.Id = wContent.Id;
+                    tem.Content = wContent.Content;
+                    tem.ActualPerformance = wContent.ActualPerformance;
+                    tem.ContentRecordId = wContent.ContentRecordId;
+                    tem.FinalPerformance = wContent.FinalPerformance;
+                    tem.TakeTime = wContent.TakeTime;
+                    tem.TimeSpan = wContent.TimeSpan;
+                    tem.WorkDate = wContent.WorkDate;
+
+                    ret.ProjectWorkContents.Add(tem);
+                }
+
+                ret.ProjectContentRecord.ProjectWorkContents = null;
+
+                retList.Add(ret);
+            }
+
+            return retList;
+        }
     }
 }

+ 17 - 9
wispro.sp.api/Job/UpdateJXDataFromIPEasyJob.cs

@@ -16,10 +16,15 @@ namespace wispro.sp.api.Job
         {
             dynamic retObj = utility.IPEasyUtility.GetPerformanceRecord(Item.CaseNo, Item.DoItem, string.IsNullOrEmpty(Item.CaseStage) ? null : Item.CaseStage);
 
+            var appealAJXS = spDb.AppealTypes.FirstOrDefault(p => p.Name.Contains("案件系数"));
+            var appealCLSXXS = spDb.AppealTypes.FirstOrDefault(p => p.Name.Contains("处理事项系数"));
+            var caseXS = (spDb.AppealRecords.FirstOrDefault(p => p.ItemId == Item.Id && p.TypeId == appealAJXS.Id && p.State == 1) == null);
+            var doItemXS = (spDb.AppealRecords.FirstOrDefault(p => p.ItemId == Item.Id && p.TypeId == appealCLSXXS.Id && p.State == 1) == null);
+
 
             IDictionary<String, Object> keyValuePairs = (IDictionary<String, Object>)retObj;
 
-            if (keyValuePairs.ContainsKey("DoItemCoefficient") && Item.DoItemCoefficient != retObj.DoItemCoefficient)
+            if (keyValuePairs.ContainsKey("DoItemCoefficient") && Item.DoItemCoefficient != retObj.DoItemCoefficient && doItemXS)
             {
                 Item.DoItemCoefficient = retObj.DoItemCoefficient;
             }
@@ -159,9 +164,10 @@ namespace wispro.sp.api.Job
             //    Item.BusinessType = retObj.BusinessType;
             //}
 
-            if (keyValuePairs.ContainsKey("CaseCoefficient") && Item.CaseCoefficient != retObj.CaseCoefficient)
+            if (keyValuePairs.ContainsKey("CaseCoefficient") && Item.CaseCoefficient != retObj.CaseCoefficient && caseXS)
             {
-                Item.CaseCoefficient = retObj.CaseCoefficient;
+                if(!(retObj.CaseCoefficient == null && string.IsNullOrEmpty(Item.CaseCoefficient)))
+                    Item.CaseCoefficient = retObj.CaseCoefficient;
             }
 
             //if (keyValuePairs.ContainsKey("CaseMemo") && Item.CaseMemo != retObj.CaseMemo && !string.IsNullOrEmpty(retObj.CaseMemo))
@@ -188,11 +194,11 @@ namespace wispro.sp.api.Job
             {
                 if (Item.AgentFeedbackMemo != "特殊点数申诉")
                 {
-                    Utility.Utility.CalBasePoint(Item, spDb.BasePointRules.ToList());
+                    //Utility.Utility.CalBasePoint(Item, spDb.BasePointRules.ToList());
 
-                    spDb.SaveChanges();
+                    //spDb.SaveChanges();
 
-                    new Controllers.PerformanceItemController(spDb, new Services.FileTaskCacheService()).RefreshBasePoint();
+                    new Controllers.PerformanceItemController(spDb, new Services.FileTaskCacheService()).RefreshPoint(Item);
                 }
             }
 
@@ -275,13 +281,14 @@ namespace wispro.sp.api.Job
             var lstItem = spDb.PerformanceItems.Where<PerformanceItem>(p =>
                 ((p.AgentFeedbackMemo != "已算绩效" || p.AgentFeedbackMemo==null ) 
                     && p.CalMonth.Status == 0 && 
-                    !p.CaseNo.StartsWith("J") &&
-                    (p.Type == null || (p.Type =="新申请" && string.IsNullOrEmpty(p.CaseCoefficient)))))
+                    !p.CaseNo.StartsWith("J")))
                 .Include(p=>p.Reviewer)
                 .Include(p=>p.CalMonth)
                 .Include(p=>p.Customer)
+                .Include(p=>p.ItemStaffs).ThenInclude(p=>p.DoPerson)
                 .ToList<PerformanceItem>();
-           
+
+            
 
             if (lstItem != null)
             {
@@ -295,6 +302,7 @@ namespace wispro.sp.api.Job
                     {
                         iTryCount++;
 
+                        
                         UpdateFromIPEasy(Item, spDb);
 
                         Log($"{DateTime.Now}\t{++i}/{lstItem.Count}\t{Item.CaseNo}");

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

@@ -13,7 +13,7 @@ namespace wispro.sp.api.Utility
         public static void CalBasePoint(PerformanceItem item, List<BasePointRule> rules)
         {
             
-            if (item.CaseNo.ToUpper().StartsWith("S"))
+            if (item.CaseNo.ToUpper().StartsWith("S") || item.AgentFeedbackMemo == "特殊点数申诉")
             {
                 return;
             }

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

@@ -11,7 +11,7 @@
     "DefaultConnect": "Data Source=(local);Initial Catalog=spDB;User ID=sa;Password=Lqftiu807005"
   },
 
-  "UpdateScheduleSetting": "00 30 09 1-8 * ? *",
+  "UpdateScheduleSetting": "00 31 20 1-9 * ? *",
   "InvalidDataScheduleSetting": "00 14 09 1-6 * ? *",
   "AgentMessageScheduleSetting": "00 10 06 7 * ? *",
 

+ 2 - 3
wispro.sp.web/Components/StaffSelect.razor

@@ -3,13 +3,12 @@
         DefaultValue="@StaffId"
         LabelName="@nameof(wispro.sp.entity.Staff.Name)"
         ValueName="@nameof(wispro.sp.entity.Staff.Id)"
+        DefaultActiveFirstOption ="false"
         Style="width: 200px"
         Placeholder="请选择"
-        IgnoreItemChanges="false"
-        EnableSearch="true"
+        EnableSearch
         AllowClear
         OnSelectedItemChanged="OnSelectedItemChangedHandler"
-        OnSearch="OnSearch"
         >
 </Select>
 

+ 1 - 1
wispro.sp.web/Components/StaffSelect.razor.cs

@@ -53,7 +53,7 @@ namespace wispro.sp.web.Components
 
         private void OnSearch(string value)
         {
-            _ShowStaffs = _ShowStaffs.Where<Staff>(p => p.Name.Contains(value)).ToList();
+            //_ShowStaffs = StaffLists.Where<Staff>(p => p.Name.Contains(value)).ToList();
             //StateHasChanged();
         }
     }

+ 7 - 7
wispro.sp.web/Layouts/BasicLayout.razor

@@ -136,13 +136,13 @@
                     Key= "appealTrend",
                     Icon = "line-chart"
                 },
-                //new MenuDataItem
-                //{
-                //    Path ="/Report/StaticsTrend",
-                //    Name ="绩效统计",
-                //    Key= "StaticsTrend",
-                //    Icon = "line-chart"
-                //}
+                new MenuDataItem
+                {
+                    Path ="/Report/StaticsTrend",
+                    Name ="绩效统计",
+                    Key= "StaticsTrend",
+                    Icon = "line-chart"
+                }
                 
 
             }

+ 0 - 84
wispro.sp.web/Pages/AppCase/AppealRecords.razor

@@ -47,7 +47,6 @@ RenderFragment avatar = @<Avatar Src="https://zos.alipayobjects.com/rmsportal/OD
                                             Placeholder="请选择"
                                             AllowClear>
                                     </Select>
-                                    @*<Input @bind-Value="@context.AppealTypeId" Placeholder="placeholder" />*@
                                 </FormItem>
                             </GridCol>
                             <GridCol Span="6">
@@ -104,88 +103,5 @@ RenderFragment avatar = @<Avatar Src="https://zos.alipayobjects.com/rmsportal/OD
     </Content>
     <ChildContent>
         <wispro.sp.web.Components.SSTable Datas="@showRecords" ShowAction="false"></wispro.sp.web.Components.SSTable>
-        @*<div style="height:600px;width:100%;overflow:auto;background:#FFFFFF;" id="div-Container">
-            <AntList DataSource="@showRecords" TItem="AppealRecord">
-                <ListItem OnClick="()=>ShowDetail(context)">
-                    <ListItemMeta AvatarTemplate="avatar" Description="@GetDescription(context)">
-                        <TitleTemplate>
-                            @context.Type.Name
-                        </TitleTemplate>
-                    </ListItemMeta>
-                </ListItem>
-            </AntList>
-
-            <Drawer Style="position:absolute" Width="600" Visible="_ShowDetail" Placement="right" Title='("申诉详情")' OnClose="_=>CloseDetail()">
-
-
-                @if (CurrentAppealRecord != null && CurrentAppealRecord.Item != null)
-                {
-
-                    <div>
-                        <Row>
-                            <AntDesign.Col Span="4"><b>我方文号:</b></AntDesign.Col>
-                            <AntDesign.Col Span="8">@CurrentAppealRecord.Item.CaseNo</AntDesign.Col>
-                            <AntDesign.Col Span="4"><b>处理事项:</b></AntDesign.Col>
-                            <AntDesign.Col Span="8">@CurrentAppealRecord.Item.DoItem</AntDesign.Col>
-                        </Row>
-
-                        <Row>
-                            <AntDesign.Col Span="4"><b>案件名称:</b></AntDesign.Col>
-                            <AntDesign.Col Span="20">@CurrentAppealRecord.Item.CaseName</AntDesign.Col>
-                        </Row>
-                    </div>
-
-                }
-
-
-                @if (_FieldValues != null)
-                {
-                    <Divider Orientation="left" Style="font-weight:bold">申诉人:@CurrentAppealRecord.Creater.Name  申诉时间:@CurrentAppealRecord.CreateTime.ToString("yyyy-MM-dd")  </Divider>
-
-                    foreach (InputFieldValue temValue in _FieldValues)
-                    {
-                        <Row>
-                            <AntDesign.Col Span="2"></AntDesign.Col>
-                            <AntDesign.Col Span="8"><b>@temValue.InputField.FieldName:</b></AntDesign.Col>
-                            <AntDesign.Col Span="14">@temValue.Value</AntDesign.Col>
-                        </Row>
-                    }
-                }
-                <Divider />
-
-                @if (_ReviewValues != null)
-                {
-                    <Divider Orientation="left" Style="font-weight:bold">审核人:@CurrentAppealRecord.Reviewer.Name  审核时间:@CurrentAppealRecord.ReviewTime?.ToString("yyyy-MM-dd")  </Divider>
-                    foreach (InputFieldValue temValue in _ReviewValues)
-                    {
-                        <Row>
-                            <AntDesign.Col Span="2"></AntDesign.Col>
-                            <AntDesign.Col Span="8"><b>@temValue.InputField.FieldName:</b></AntDesign.Col>
-                            <AntDesign.Col Span="14">@temValue.Value</AntDesign.Col>
-                        </Row>
-                    }
-                }
-
-                @if (attachFiles != null && attachFiles.Count > 0)
-                {
-                    <Divider Orientation="left" Style="font-weight:bold">附件</Divider>
-
-                    <Row>
-                        <AntDesign.Col Span="2"></AntDesign.Col>
-                        <AntDesign.Col Span="14">文件名称</AntDesign.Col>
-                        <AntDesign.Col Span="8">上传人</AntDesign.Col>
-                    </Row>
-                    @foreach (AttachFile file in attachFiles)
-                    {
-                        <Row>
-                            <AntDesign.Col Span="2"></AntDesign.Col>
-                            <AntDesign.Col Span="14"><a href="@($"{configuration.GetValue<string>("APIUrl")}AttachFiles/Download?id={file.Id}")">@file.Name </a></AntDesign.Col>
-                            <AntDesign.Col Span="8">@file.UploadUser.Name</AntDesign.Col>
-                        </Row>
-                    }
-                }
-            </Drawer>
-        </div>*@
-
     </ChildContent>
 </PageContainer>

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

@@ -97,12 +97,10 @@
                                     <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("其它处理", true)</center></AntDesign.Col>
                                     <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("其它审核", true)</center></AntDesign.Col>
                                     <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("专案处理", true)</center></AntDesign.Col>
-                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("一次OA授权处理", true)</center></AntDesign.Col>
-                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("一次OA授权审核", true)</center></AntDesign.Col>
                                     <AntDesign.Col Span="4" style="border:1px solid #000000"><center>@GetStatistics("ALL", true)</center></AntDesign.Col>
                                 </AntDesign.Row>
                                 <AntDesign.Row>
-                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>等级调整点数</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>调整点数</center></AntDesign.Col>
                                     <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("新申请处理")</center></AntDesign.Col>
                                     <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("新申请审核")</center></AntDesign.Col>
                                     <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("OA处理")</center></AntDesign.Col>
@@ -110,8 +108,6 @@
                                     <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("其它处理")</center></AntDesign.Col>
                                     <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("其它审核")</center></AntDesign.Col>
                                     <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("专案处理")</center></AntDesign.Col>
-                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("一次OA授权处理")</center></AntDesign.Col>
-                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("一次OA授权审核")</center></AntDesign.Col>
                                     <AntDesign.Col Span="4" style="border:1px solid #000000"><center>@GetStatistics("ALL")</center></AntDesign.Col>
                                 </AntDesign.Row>
 

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

@@ -164,7 +164,7 @@ namespace wispro.sp.web.Pages.AppCase
                     {
                         if (tem != null)
                         {
-                            return (tem.totalBasePoint.HasValue ? tem.totalBasePoint.Value.ToString("0.00") : "");
+                            return (tem.FinianlPoint .HasValue ? tem.FinianlPoint.Value.ToString("0.00") : "");
                         }
                         else
                         {
@@ -175,7 +175,7 @@ namespace wispro.sp.web.Pages.AppCase
                     {
                         if (tem != null)
                         {
-                            return (tem.totalActuallyPoint.HasValue ? tem.totalActuallyPoint.Value.ToString("0.00") : "");
+                            return (tem.FinianlPoint.HasValue ? tem.FinianlPoint.Value.ToString("0.00") : "");
                         }
                         else
                         {
@@ -188,11 +188,11 @@ namespace wispro.sp.web.Pages.AppCase
                 {
                     if (isBasePoint)
                     {
-                        return MyStatistics.Select(s => s.totalBasePoint.Value).Sum().ToString("0.00");
+                        return MyStatistics.Select(s => s.FinianlPoint.Value).Sum().ToString("0.00");
                     }
                     else
                     {
-                        return MyStatistics.Select(s => s.totalActuallyPoint.Value).Sum().ToString("0.00");
+                        return MyStatistics.Select(s => s.FinianlPoint.Value).Sum().ToString("0.00");
                     }
                 }
             }

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

@@ -23,6 +23,7 @@
             else
             {
                 <SpaceItem>@ProjectNo</SpaceItem>
+                <SpaceItem><Button Type="primary" Icon="" OnClick="ReviewHistory">查看往期点数</Button></SpaceItem>
             }
         </Space>
 
@@ -30,7 +31,6 @@
         {
             foreach (var pContent in projectContents)
             {
-                //Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(pContent));
                 <Card Title="@pContent.ProjectContentRecord.Staff.Name">
                     <Extra>
                         <Space>
@@ -42,18 +42,6 @@
                             <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>
@@ -95,3 +83,62 @@
     </ChildContent>
 </PageContainer>
 
+<Drawer Height="600" Visible="_ShowHistory" Placement="bottom" Title='($"【{ProjectNo}】历史点数")' OnClose="_=>CloseDetail()">
+
+    @if(HistroyContents != null){
+    <div>
+        @foreach(CalMonth calMonth in GetMonth(HistroyContents))
+        {
+            <span><b>@($"{calMonth.Year}年{calMonth.Month}月")</b></span>
+            <Divider/>
+
+            foreach(share.ProjectContents pContent in GetByMonth(calMonth, HistroyContents))
+            {
+                <Card Title="@pContent.ProjectContentRecord.Staff.Name">
+                    <Extra>
+                        <Space>
+                            <SpaceItem>
+                                最终绩效点数:
+                            </SpaceItem>
+                            <SpaceItem><span style ="text-decoration:underline;">@($"{GetPointString(pContent.ProjectContentRecord,"S")}") </span><b>S</b></SpaceItem>
+                            <SpaceItem><span style ="text-decoration:underline;">@($"{GetPointString(pContent.ProjectContentRecord,"A")}") </span><b>A</b></SpaceItem>
+                            <SpaceItem><span style ="text-decoration:underline;">@($"{GetPointString(pContent.ProjectContentRecord,"B")}") </span><b>B</b></SpaceItem>
+                            <SpaceItem><span style ="text-decoration:underline;">@($"{GetPointString(pContent.ProjectContentRecord,"C")}") </span><b>C</b></SpaceItem>
+                            <SpaceItem><span style ="text-decoration:underline;">@($"{GetPointString(pContent.ProjectContentRecord,"D")}") </span><b>D</b></SpaceItem>
+                        </Space>
+                    </Extra>
+                    <Body>
+                        <Table DataSource="pContent.ProjectWorkContents" Context="pp" Size="@TableSize.Small" HidePagination="@true">
+                            <ChildContent>
+                                <AntDesign.Column Title="工作内容" TData="string">
+                                    @pp.Content
+                                </AntDesign.Column>
+                                <AntDesign.Column Title="工作日期" TData="string">
+                                    @pp.WorkDate.ToString("yyyy-MM-dd")
+                                </AntDesign.Column>
+                                <AntDesign.Column Title="时间跨度" TData="string">
+                                    @pp.TimeSpan 天
+                                </AntDesign.Column>
+                                <AntDesign.Column Title="耗时" TData="string">
+                                    @pp.TakeTime 小时
+                                </AntDesign.Column>
+                                <AntDesign.Column Title="工作难度系数" TData="string">
+                                    @pp.DifficultFactor
+                                </AntDesign.Column>
+                                <AntDesign.Column Title="实际绩效" TData="string">
+                                    @pp.ActualPerformance
+                                </AntDesign.Column>
+                            </ChildContent>
+                        </Table>
+
+                    </Body>
+                </Card>
+            }
+        }
+    </div>
+    }
+    
+</Drawer>
+
+
+

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

@@ -37,6 +37,7 @@ namespace wispro.sp.web.Pages.Project
             if (!string.IsNullOrEmpty(ProjectNo))
             {
                 projectContents = await projectService.GetProjectCanReviewWorkContent(ProjectNo, cal);
+                HistroyContents = await projectService.GetProjectHistroy(ProjectNo);
             }
             else
             {
@@ -81,10 +82,79 @@ namespace wispro.sp.web.Pages.Project
             }
             else
             {
-               await _message.Error("保存出错!");
+               await _message.Error(ret.ErrorMessage);
             }
 
         }
 
+        List<ProjectContents> HistroyContents;
+        bool _ShowHistory = false;
+        async void ReviewHistory()
+        {
+            if (HistroyContents == null)
+            {
+                HistroyContents = await projectService.GetProjectHistroy(ProjectNo);
+            }
+
+            _ShowHistory = true;
+            StateHasChanged();
+
+        }
+
+        void CloseDetail()
+        {
+            _ShowHistory = false;
+        }
+
+        private List<CalMonth> GetMonth(List<ProjectContents> projectContents)
+        {
+            List<CalMonth> monthList = new List<CalMonth>();
+            foreach (var projectContentsItem in projectContents)
+            {
+                CalMonth calMonth = projectContentsItem.ProjectContentRecord.CalMonth;
+                var temMonth =monthList.FirstOrDefault(c => c.Month == calMonth.Month && c.Year == calMonth.Year);
+
+                if (temMonth == null)
+                {
+                    monthList.Add(calMonth);
+                }
+            }
+
+            return monthList;
+            
+        }
+
+        private List<ProjectContents> GetByMonth(CalMonth calMonth, List<ProjectContents> projectContents)
+        {
+            return projectContents.Where(p => p.ProjectContentRecord.CalMonthId == calMonth.Id).ToList(); 
+        }
+
+        private string GetPointString(ProjectContentRecord record,string CaseXS)
+        {
+            if(record != null)
+            {
+                switch (CaseXS)
+                {
+                    case "S":
+                        return record.PointS.HasValue ? record.PointS.Value.ToString() : "__";
+                        break;
+                    case "A":
+                        return record.PointA.HasValue ? record.PointA.Value.ToString() : "__";
+                        break;
+                    case "B":
+                        return record.PointB.HasValue ? record.PointB.Value.ToString() : "__";
+                        break;
+                    case "C":
+                        return record.PointC.HasValue ? record.PointC.Value.ToString() : "__";
+                        break;
+                    case "D":
+                        return record.PointD.HasValue ? record.PointD.Value.ToString() : "__";
+                        break;
+                }
+            }
+
+            return "";
+        }
+
     }
 }

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

@@ -41,7 +41,7 @@
                 @*<AntDesign.Charts.Line Data="Datas.Datas" Config="config" @ref="@chart" />*@
 
             <center>
-                <Blazor.ECharts.Components.ELine Option="@option" />
+                <Blazor.ECharts.Components.ELine Option="@option" @ref="chart"/>
             @{
                 System.Data.DataTable tableData = Datas.GetTableData();
 

+ 15 - 1
wispro.sp.web/Pages/Report/AppealTrend.razor.cs

@@ -21,6 +21,7 @@ namespace wispro.sp.web.Pages.Report
         private DateTime? start = new DateTime(DateTime.Now.Year, 1, 1);
         private DateTime? end = DateTime.Now;
         private EChartsOption<L.Line> option;
+        private Blazor.ECharts.Components.ELine chart;
 
         internal class TJType
         {
@@ -102,7 +103,10 @@ namespace wispro.sp.web.Pages.Report
                     for (int i = 1; i < dt.Columns.Count; i++)
                     {
                         double dTem = 0;
-                        double.TryParse(row[i].ToString(), out dTem);
+                        if(!double.TryParse(row[i].ToString(), out dTem))
+                        {
+                            dTem = 0;
+                        }
 
                         data.Add(dTem);
                     }
@@ -112,6 +116,11 @@ namespace wispro.sp.web.Pages.Report
                     series.Add(l);
                 }
 
+                Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(series, new JsonSerializerOptions()
+                {
+                    DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull
+                }));
+
                 option = new()
                 {
                     Toolbox = new()
@@ -158,6 +167,11 @@ namespace wispro.sp.web.Pages.Report
                     },
                     Series = series
                 };
+
+                Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(option, new JsonSerializerOptions()
+                {
+                    DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull
+                }));
             }
         }
 

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

@@ -23,7 +23,6 @@
                 </Select>
             </SpaceItem>
             <SpaceItem><Button Icon="search" Loading="_noIconLoading" OnClick="OnButtonClick">开始统计</Button></SpaceItem>
-            <SpaceItem><Button OnClick="OnButtonClick_1">开始统计</Button></SpaceItem>
         </Space>
     </Content>
     <ChildContent>

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

@@ -66,7 +66,11 @@ namespace wispro.sp.web.Pages.Report
                     for (int i = 1; i < dt.Columns.Count; i++)
                     {
                         double dTem = 0;
-                        double.TryParse(row[i].ToString(), out dTem);
+
+                        if(!double.TryParse(row[i].ToString(), out dTem))
+                        {
+                            dTem = 0;
+                        }
 
                         data.Add(dTem);
                     }

+ 10 - 0
wispro.sp.web/Services/ProjectService.cs

@@ -28,6 +28,8 @@ namespace wispro.sp.web.Services
         Task<List<ProjectContents>> GetProjectCanReviewWorkContent(string projectNo,CalMonth cal);
         Task<List<ProjectInfo>> GetWaitingReviewProjects();
         Task<ApiSaveResponse> ReviewProjectWorkContent(List<ProjectContents> projectContents);
+
+        Task<List<ProjectContents>> GetProjectHistroy(string projectNo);
     }
 
     public class ProjectService : IProjectService
@@ -101,10 +103,18 @@ namespace wispro.sp.web.Services
             return data;
         }
 
+        public async Task<List<ProjectContents>> GetProjectHistroy(string projectNo)
+        {
+            var data = await _httpClient.Get<List<ProjectContents>>($"Project/GetProjectHisttory?projectNo={projectNo}");
+            return data;
+        }
+
         public async Task<ApiSaveResponse> ReviewProjectWorkContent(List<ProjectContents> projectContents)
         {
             var response = await _httpClient.Post<ApiSaveResponse>("Project/ReviewProjectWorkContent", projectContents);
             return response;
         }
+
+       
     }
 }

+ 7 - 6
wispro.sp.winClient/Form1.cs

@@ -594,8 +594,8 @@ namespace wispro.sp.winClient
                  await Login();
             }
 
-            await CalJXPointAsync(2022,2);
-            //await CalJXPointAsync(2022, 1);
+            //await CalJXPointAsync(2022,2);
+            await CalJXPointAsync(2022, 1);
         }
 
         private async Task RemoveDBNotFinishedDate()
@@ -940,7 +940,7 @@ namespace wispro.sp.winClient
             return retStr;
         }
 
-        string strAPIBaseUri = "http://47.106.221.167:8081"; // "http://localhost:39476";//
+        string strAPIBaseUri = "http://47.106.221.167:8081"; //  "http://localhost:39476";// 
 
         userToken Token;
 
@@ -1167,11 +1167,12 @@ namespace wispro.sp.winClient
         }
         private async Task<PerformanceItem> CalJXPointAsync(int year,int month)
         {
-            HttpClient http = CreateHttp();
+            HttpClient http = CreateHttp();//
             http.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("bearer", Token.Token);
-            var data = await http.GetFromJsonAsync<PerformanceItem>($"{strAPIBaseUri}/api/PerformanceItem/CalJXPoint?year={year}&month={month}");
+            var data = await http.GetFromJsonAsync<ApiSaveResponse>($"{strAPIBaseUri}/api/PerformanceItem/RefreshBasePoint");
+            //var data = await http.GetFromJsonAsync<PerformanceItem>($"{strAPIBaseUri}/api/PerformanceItem/CalJXPoint?year={year}&month={month}");
 
-            return data;
+            return null;//data;
         }
 
         private async Task<PerformanceItem> DeleteDBNotFinishedTimeAsync(int year, int month)