|
@@ -293,9 +293,12 @@ namespace wispro.sp.api.Controllers
|
|
itemStaff.Item = null;
|
|
itemStaff.Item = null;
|
|
}
|
|
}
|
|
|
|
|
|
- item.Reviewer.ReviewerItems = null;
|
|
|
|
- item.Reviewer.Customers = null;
|
|
|
|
- item.Reviewer.ItemStaffs = null;
|
|
|
|
|
|
+ if (item.Reviewer != null)
|
|
|
|
+ {
|
|
|
|
+ item.Reviewer.ReviewerItems = null;
|
|
|
|
+ item.Reviewer.Customers = null;
|
|
|
|
+ item.Reviewer.ItemStaffs = null;
|
|
|
|
+ }
|
|
|
|
|
|
item.Customer.PerformanceItems = null;
|
|
item.Customer.PerformanceItems = null;
|
|
item.CalMonth.PerformanceItems = null;
|
|
item.CalMonth.PerformanceItems = null;
|
|
@@ -432,8 +435,21 @@ namespace wispro.sp.api.Controllers
|
|
List<StaffStatistics> retList = new List<StaffStatistics>();
|
|
List<StaffStatistics> retList = new List<StaffStatistics>();
|
|
List<VerifyCoefficient> verifyCoefficients = Context.VerifyCoefficients.ToList<VerifyCoefficient>();
|
|
List<VerifyCoefficient> verifyCoefficients = Context.VerifyCoefficients.ToList<VerifyCoefficient>();
|
|
|
|
|
|
|
|
+ var Rules = Context.BasePointRules.ToList();
|
|
|
|
+
|
|
foreach (PerformanceItem item in ItemList)
|
|
foreach (PerformanceItem item in ItemList)
|
|
{
|
|
{
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //if (item.BasePoint == null)
|
|
|
|
+ //{
|
|
|
|
+
|
|
|
|
+ Utility.Utility.CalBasePoint(item,Rules);
|
|
|
|
+
|
|
|
|
+ Context.SaveChanges();
|
|
|
|
+ //}
|
|
|
|
|
|
if (item.BasePoint != null && item.BasePoint.Value > 0)
|
|
if (item.BasePoint != null && item.BasePoint.Value > 0)
|
|
{
|
|
{
|
|
@@ -443,7 +459,7 @@ namespace wispro.sp.api.Controllers
|
|
|
|
|
|
bool isPJFP = true;
|
|
bool isPJFP = true;
|
|
double total = item.ItemStaffs.Count();
|
|
double total = item.ItemStaffs.Count();
|
|
- if (item.ItemStaffs.Where<ItemStaff>(p => p.PerformancePoint == null || p.PerformancePoint == 0).Count() == 0)
|
|
|
|
|
|
+ if (item.ItemStaffs.Where<ItemStaff>(p => p.PerformancePoint != null || p.PerformancePoint == 0).Count() > 0)
|
|
{
|
|
{
|
|
total = item.ItemStaffs.Select(i => i.PerformancePoint.Value).Sum();
|
|
total = item.ItemStaffs.Select(i => i.PerformancePoint.Value).Sum();
|
|
isPJFP = false;
|
|
isPJFP = false;
|
|
@@ -464,8 +480,10 @@ namespace wispro.sp.api.Controllers
|
|
#region 计算审核人绩效点数,核稿人绩效点数按照核稿人与个处理人的核稿系数计算后加总,没有找到核稿系数(比如同级别),核稿系数为0
|
|
#region 计算审核人绩效点数,核稿人绩效点数按照核稿人与个处理人的核稿系数计算后加总,没有找到核稿系数(比如同级别),核稿系数为0
|
|
if (item.ReviewerId != null && item.Type !="专案")
|
|
if (item.ReviewerId != null && item.Type !="专案")
|
|
{
|
|
{
|
|
|
|
+
|
|
#region 取审核人等级审核等级系数
|
|
#region 取审核人等级审核等级系数
|
|
- VerifyCoefficient vcoefficient = verifyCoefficients.Where<VerifyCoefficient>(v =>
|
|
|
|
|
|
+ VerifyCoefficient vcoefficient
|
|
|
|
+ = verifyCoefficients.Where<VerifyCoefficient>(v =>
|
|
v.CheckerId == item.Reviewer.StaffGrade.Id
|
|
v.CheckerId == item.Reviewer.StaffGrade.Id
|
|
&& v.DoPersonId == itemStaff.DoPerson.StaffGradeId)
|
|
&& v.DoPersonId == itemStaff.DoPerson.StaffGradeId)
|
|
.FirstOrDefault<VerifyCoefficient>();
|
|
.FirstOrDefault<VerifyCoefficient>();
|
|
@@ -485,7 +503,7 @@ namespace wispro.sp.api.Controllers
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- if (item.Reviewer.IsOnJob) //判断是否在职
|
|
|
|
|
|
+ if (item.Reviewer.IsOnJob && itemStaff.DoPerson.Status != "试用期") //判断是否在职
|
|
{
|
|
{
|
|
temReviewerStatic = new StaffStatistics()
|
|
temReviewerStatic = new StaffStatistics()
|
|
{
|
|
{
|
|
@@ -540,17 +558,34 @@ namespace wispro.sp.api.Controllers
|
|
{
|
|
{
|
|
if (item.Type != "专案")
|
|
if (item.Type != "专案")
|
|
{
|
|
{
|
|
- temStatic = new StaffStatistics()
|
|
|
|
|
|
+ if (itemStaff.DoPerson.Status == "试用期" && item.Reviewer != null)
|
|
{
|
|
{
|
|
- CalMonth = calMonth,
|
|
|
|
- CalMonthId = calMonth.Id,
|
|
|
|
- StaffId = itemStaff.DoPersonId,
|
|
|
|
- totalBasePoint = handlerBasePoint * itemStaff.DoPerson.StaffGrade.Coefficient,
|
|
|
|
- jxType = handlerJxType
|
|
|
|
- };
|
|
|
|
|
|
+ temStatic = new StaffStatistics()
|
|
|
|
+ {
|
|
|
|
+ CalMonth = calMonth,
|
|
|
|
+ CalMonthId = calMonth.Id,
|
|
|
|
+ StaffId = item.Reviewer.Id,
|
|
|
|
+ totalBasePoint = handlerBasePoint * item.Reviewer.StaffGrade.Coefficient,
|
|
|
|
+ jxType = handlerJxType
|
|
|
|
+ };
|
|
|
|
|
|
|
|
|
|
- itemStatistics.Add(temStatic);
|
|
|
|
|
|
+ itemStatistics.Add(temStatic);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ temStatic = new StaffStatistics()
|
|
|
|
+ {
|
|
|
|
+ CalMonth = calMonth,
|
|
|
|
+ CalMonthId = calMonth.Id,
|
|
|
|
+ StaffId = itemStaff.DoPersonId,
|
|
|
|
+ totalBasePoint = handlerBasePoint * itemStaff.DoPerson.StaffGrade.Coefficient,
|
|
|
|
+ jxType = handlerJxType
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ itemStatistics.Add(temStatic);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
@@ -725,7 +760,7 @@ namespace wispro.sp.api.Controllers
|
|
IQueryable<PerformanceItem> response;
|
|
IQueryable<PerformanceItem> response;
|
|
if (queryFilter.userId > 0)
|
|
if (queryFilter.userId > 0)
|
|
{
|
|
{
|
|
- response = Context.PerformanceItems.Where<PerformanceItem>(dynamicWhere).Where(s => (s.ItemStaffs.Where<ItemStaff>(iStaff => iStaff.DoPerson.Id == queryFilter.userId).Count() > 0 || s.ReviewerId == queryFilter.userId));
|
|
|
|
|
|
+ response = Context.PerformanceItems.Where<PerformanceItem>(dynamicWhere).Where(s => (s.ItemStaffs.Where<ItemStaff>(iStaff => iStaff.DoPerson.Id == queryFilter.userId).Count() > 0));// || s.ReviewerId == queryFilter.userId));
|
|
|
|
|
|
}
|
|
}
|
|
else
|
|
else
|
|
@@ -892,5 +927,18 @@ namespace wispro.sp.api.Controllers
|
|
|
|
|
|
return retObj;
|
|
return retObj;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public PerformanceItem GetItemInfoByCaseStage(string CaseNo, string DoItem,string caseStage)
|
|
|
|
+ {
|
|
|
|
+ var retObj = Context.PerformanceItems.FirstOrDefault<PerformanceItem>(p => p.CaseNo == CaseNo.Trim()
|
|
|
|
+ && p.DoItem == DoItem.Trim() && p.CaseStage == caseStage);
|
|
|
|
+
|
|
|
|
+ if (retObj == null)
|
|
|
|
+ {
|
|
|
|
+ retObj = IPEasyUtility.GetPerformanceRecord(CaseNo, DoItem, caseStage);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return retObj;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|