|
@@ -153,16 +153,6 @@ namespace wispro.sp.api.Controllers
|
|
|
{
|
|
|
Context.CalMonths.Add(item.CalMonth);
|
|
|
|
|
|
- if (item.BasePoint > 0)
|
|
|
- {
|
|
|
- _calItemJX(item, Context);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- var oldJxList = Context.StaffStatistics.Where(p => p.ItemId == item.Id);
|
|
|
- Context.StaffStatistics.RemoveRange(oldJxList);
|
|
|
- }
|
|
|
-
|
|
|
Context.SaveChanges();
|
|
|
}
|
|
|
else
|
|
@@ -170,6 +160,8 @@ namespace wispro.sp.api.Controllers
|
|
|
item.CalMonth = calMonth;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
item.CalMonthId = item.CalMonth.Id;
|
|
|
item.CalMonth = null;
|
|
|
}
|
|
@@ -235,6 +227,27 @@ namespace wispro.sp.api.Controllers
|
|
|
Context.ItemStaffs.AddRange(ItemStaffs);
|
|
|
Context.SaveChanges();
|
|
|
|
|
|
+ #region 计算绩效
|
|
|
+ if (item.BasePoint > 0)
|
|
|
+ {
|
|
|
+ _calItemJX(item, Context);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var oldJxList = Context.StaffStatistics.Where(p => p.ItemId == item.Id);
|
|
|
+ Context.StaffStatistics.RemoveRange(oldJxList);
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ Context.SaveChanges();
|
|
|
+
|
|
|
+ #region 添加其他新申请的绩效分配(默认是对外处理人与处理人50:50)
|
|
|
+ if(item.Type == "其他新申请")
|
|
|
+ {
|
|
|
+ //Context.AllocationRatios.Add();
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
Context.Database.CommitTransaction();
|
|
|
}
|
|
|
catch (Exception ex)
|
|
@@ -370,25 +383,14 @@ namespace wispro.sp.api.Controllers
|
|
|
.Include(pi => pi.Reviewer)
|
|
|
.Include(pi => pi.Customer)
|
|
|
.Include(pi => pi.CalMonth)
|
|
|
+ .Include(pi => pi.ExternalHandler)
|
|
|
.OrderByDescending(o => o.Id)
|
|
|
.Skip<PerformanceItem>((pageIndex - 1) * pageSize).Take(pageSize).ToList<PerformanceItem>();
|
|
|
|
|
|
#region 将某些属性设为null,避免循环取值造成返回json过大
|
|
|
foreach (PerformanceItem item in retList)
|
|
|
{
|
|
|
- foreach (ItemStaff itemStaff in item.ItemStaffs)
|
|
|
- {
|
|
|
- itemStaff.DoPerson.ItemStaffs = null;
|
|
|
- itemStaff.DoPerson.ReviewerItems = null;
|
|
|
- itemStaff.Item = null;
|
|
|
- }
|
|
|
-
|
|
|
- item.Reviewer.ReviewerItems = null;
|
|
|
- item.Reviewer.Customers = null;
|
|
|
- item.Reviewer.ItemStaffs = null;
|
|
|
-
|
|
|
- item.Customer.PerformanceItems = null;
|
|
|
- item.CalMonth.PerformanceItems = null;
|
|
|
+ SetReturnItem(item);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
@@ -408,26 +410,12 @@ namespace wispro.sp.api.Controllers
|
|
|
.Include(pi => pi.Reviewer)
|
|
|
.Include(pi => pi.Customer)
|
|
|
.Include(pi => pi.CalMonth)
|
|
|
+ .Include (pi => pi.ExternalHandler)
|
|
|
.OrderByDescending(o => o.Id)
|
|
|
.FirstOrDefault();
|
|
|
|
|
|
#region 将某些属性设为null,避免循环取值造成返回json过大
|
|
|
- foreach (ItemStaff itemStaff in item.ItemStaffs)
|
|
|
- {
|
|
|
- itemStaff.DoPerson.ItemStaffs = null;
|
|
|
- itemStaff.DoPerson.ReviewerItems = null;
|
|
|
- itemStaff.Item = null;
|
|
|
- }
|
|
|
-
|
|
|
- if (item.Reviewer != null)
|
|
|
- {
|
|
|
- item.Reviewer.ReviewerItems = null;
|
|
|
- item.Reviewer.Customers = null;
|
|
|
- item.Reviewer.ItemStaffs = null;
|
|
|
- }
|
|
|
-
|
|
|
- item.Customer.PerformanceItems = null;
|
|
|
- item.CalMonth.PerformanceItems = null;
|
|
|
+ SetReturnItem(item);
|
|
|
#endregion
|
|
|
|
|
|
return item;
|
|
@@ -456,6 +444,7 @@ namespace wispro.sp.api.Controllers
|
|
|
.Include(pi => pi.Reviewer)
|
|
|
.Include(pi => pi.Customer)
|
|
|
.Include(pi => pi.CalMonth)
|
|
|
+ .Include(pi => pi.ExternalHandler)
|
|
|
.OrderByDescending(o => o.Id)
|
|
|
.Skip<PerformanceItem>((pageIndex - 1) * pageSize).Take(pageSize)
|
|
|
.ToList<PerformanceItem>();
|
|
@@ -463,19 +452,7 @@ namespace wispro.sp.api.Controllers
|
|
|
#region 将某些属性设为null,避免循环取值造成返回json过大
|
|
|
foreach (PerformanceItem item in retList)
|
|
|
{
|
|
|
- foreach (ItemStaff itemStaff in item.ItemStaffs)
|
|
|
- {
|
|
|
- itemStaff.DoPerson.ItemStaffs = null;
|
|
|
- itemStaff.DoPerson.ReviewerItems = null;
|
|
|
- itemStaff.Item = null;
|
|
|
- }
|
|
|
-
|
|
|
- item.Reviewer.ReviewerItems = null;
|
|
|
- item.Reviewer.Customers = null;
|
|
|
- item.Reviewer.ItemStaffs = null;
|
|
|
-
|
|
|
- item.Customer.PerformanceItems = null;
|
|
|
- item.CalMonth.PerformanceItems = null;
|
|
|
+ SetReturnItem(item);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
@@ -2739,6 +2716,7 @@ namespace wispro.sp.api.Controllers
|
|
|
dt.Columns.Add("处理人", typeof(string));
|
|
|
dt.Columns.Add("处理人部门", typeof(string));
|
|
|
dt.Columns.Add("核稿人", typeof(string));
|
|
|
+ dt.Columns.Add("对外处理人", typeof(string));
|
|
|
dt.Columns.Add("客户名称", typeof(string));
|
|
|
dt.Columns.Add("申请人", typeof(string));
|
|
|
dt.Columns.Add("处理事项完成日", typeof(string));
|
|
@@ -2825,6 +2803,8 @@ namespace wispro.sp.api.Controllers
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ row["对外处理人"] = item.ExternalHandler?.Name;
|
|
|
+
|
|
|
row["客户名称"] = item.Customer?.Name;
|
|
|
row["申请人"] = item.ApplicationName;
|
|
|
row["处理事项完成日"] = item.FinishedDate?.ToString("yyyy-MM-dd");
|
|
@@ -2874,6 +2854,7 @@ namespace wispro.sp.api.Controllers
|
|
|
.Include(pi => pi.Reviewer)
|
|
|
.Include(pi => pi.Customer)
|
|
|
.Include(pi => pi.CalMonth)
|
|
|
+ .Include(pi => pi.ExternalHandler)
|
|
|
.OrderConditions<PerformanceItem>(queryFilter.Sorts);
|
|
|
//.Pager<PerformanceItem>(1, queryFilter.PageSize, out totals);
|
|
|
}
|
|
@@ -2884,6 +2865,7 @@ namespace wispro.sp.api.Controllers
|
|
|
.Include(pi => pi.Reviewer)
|
|
|
.Include(pi => pi.Customer)
|
|
|
.Include(pi => pi.CalMonth)
|
|
|
+ .Include(pi => pi.ExternalHandler)
|
|
|
.OrderConditions<PerformanceItem>(queryFilter.Sorts);
|
|
|
//.Pager<PerformanceItem>(queryFilter.PageIndex, queryFilter.PageSize, out totals);
|
|
|
}
|
|
@@ -2897,47 +2879,76 @@ namespace wispro.sp.api.Controllers
|
|
|
#region 将某些属性设为null,避免循环取值造成返回json过大
|
|
|
foreach (PerformanceItem item in retList)
|
|
|
{
|
|
|
+ SetReturnItem(item);
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
|
|
|
- foreach (ItemStaff itemStaff in item.ItemStaffs)
|
|
|
- {
|
|
|
- itemStaff.DoPerson.ItemStaffs = null;
|
|
|
- itemStaff.DoPerson.ReviewerItems = null;
|
|
|
- itemStaff.DoPerson.Customers = null;
|
|
|
- itemStaff.Item = null;
|
|
|
- }
|
|
|
+ ret.Results = retList.ToList();
|
|
|
|
|
|
- if (item.Reviewer != null)
|
|
|
- {
|
|
|
- item.Reviewer.ReviewerItems = null;
|
|
|
- item.Reviewer.Customers = null;
|
|
|
- item.Reviewer.ItemStaffs = null;
|
|
|
- }
|
|
|
+ //string str= System.Text.Json.JsonSerializer.Serialize(ret);
|
|
|
|
|
|
- if (item.WorkflowUser != null)
|
|
|
- {
|
|
|
- item.WorkflowUser.ReviewerItems = null;
|
|
|
- item.WorkflowUser.Customers = null;
|
|
|
- item.WorkflowUser.ItemStaffs = null;
|
|
|
- }
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
|
|
|
- if (item.Customer != null)
|
|
|
- {
|
|
|
- item.Customer.PerformanceItems = null;
|
|
|
- item.Customer.ResponseMan = null;
|
|
|
- }
|
|
|
+ private static void SetReturnItem(PerformanceItem item)
|
|
|
+ {
|
|
|
+ foreach (ItemStaff itemStaff in item.ItemStaffs)
|
|
|
+ {
|
|
|
+ itemStaff.DoPerson.ItemStaffs = null;
|
|
|
+ itemStaff.DoPerson.ReviewerItems = null;
|
|
|
+ itemStaff.DoPerson.Customers = null;
|
|
|
+ itemStaff.DoPerson.AllocationRatios = null;
|
|
|
+ itemStaff.DoPerson.ExternalHandlerItems = null;
|
|
|
+ itemStaff.Item = null;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (item.Reviewer != null)
|
|
|
+ {
|
|
|
+ item.Reviewer.ReviewerItems = null;
|
|
|
+ item.Reviewer.Customers = null;
|
|
|
+ item.Reviewer.ItemStaffs = null;
|
|
|
+ item.Reviewer.AllocationRatios = null;
|
|
|
+ item.Reviewer.ExternalHandlerItems = null;
|
|
|
|
|
|
- if (item.CalMonth != null)
|
|
|
- {
|
|
|
- item.CalMonth.PerformanceItems = null;
|
|
|
- }
|
|
|
}
|
|
|
- #endregion
|
|
|
|
|
|
- ret.Results = retList.ToList();
|
|
|
+ if (item.ExternalHandler != null)
|
|
|
+ {
|
|
|
+ item.ExternalHandler.ReviewerItems = null;
|
|
|
+ item.ExternalHandler.Customers = null;
|
|
|
+ item.ExternalHandler.ItemStaffs = null;
|
|
|
+ item.ExternalHandler.AllocationRatios = null;
|
|
|
+ item.ExternalHandler.ExternalHandlerItems = null;
|
|
|
+ }
|
|
|
|
|
|
- //string str= System.Text.Json.JsonSerializer.Serialize(ret);
|
|
|
+ if (item.PreOastaff != null)
|
|
|
+ {
|
|
|
+ item.PreOastaff.ReviewerItems = null;
|
|
|
+ item.PreOastaff.Customers = null;
|
|
|
+ item.PreOastaff.ItemStaffs = null;
|
|
|
+ item.PreOastaff.AllocationRatios = null;
|
|
|
+ item.PreOastaff.ExternalHandlerItems = null;
|
|
|
+ }
|
|
|
|
|
|
- return ret;
|
|
|
+ if (item.WorkflowUser != null)
|
|
|
+ {
|
|
|
+ item.WorkflowUser.ReviewerItems = null;
|
|
|
+ item.WorkflowUser.Customers = null;
|
|
|
+ item.WorkflowUser.ItemStaffs = null;
|
|
|
+ item.WorkflowUser.AllocationRatios = null;
|
|
|
+ item.WorkflowUser.ExternalHandlerItems = null;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (item.Customer != null)
|
|
|
+ {
|
|
|
+ item.Customer.PerformanceItems = null;
|
|
|
+ item.Customer.ResponseMan = null;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (item.CalMonth != null)
|
|
|
+ {
|
|
|
+ item.CalMonth.PerformanceItems = null;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private IQueryable<PerformanceItem> NewMethod(QueryFilter queryFilter)
|
|
@@ -3531,13 +3542,20 @@ namespace wispro.sp.api.Controllers
|
|
|
var newList = spDb.PerformanceItems.Include(p => p.ItemStaffs).ThenInclude(p=>p.DoPerson)
|
|
|
.Include(p=>p.CalMonth)
|
|
|
.Where(p=>p.CalMonthId == calMonthId && p.BasePoint >0
|
|
|
- && (p.Type =="新申请" || p.Type =="专案" || (p.Type == "其它" && p.WordCount >0 && (p.DoItem =="新申请" || p.DoItem == "翻译")))
|
|
|
+ && (p.Type =="新申请" || p.Type == "其他新申请" || p.Type =="专案" || (p.Type == "其它" && p.WordCount >0 && (p.DoItem =="新申请" || p.DoItem == "翻译")))
|
|
|
).ToList();
|
|
|
|
|
|
foreach(var p in newList)
|
|
|
{
|
|
|
#region 严重延期降系数
|
|
|
string strCaseCeoffcient = p.CaseCoefficient;
|
|
|
+
|
|
|
+ if(p.Type == "其他新申请")
|
|
|
+ {
|
|
|
+ //宁德时代的案件按照B统计
|
|
|
+ strCaseCeoffcient = "B";
|
|
|
+ }
|
|
|
+
|
|
|
if (string.IsNullOrEmpty(strCaseCeoffcient))
|
|
|
{
|
|
|
strCaseCeoffcient = "B";
|
|
@@ -3589,79 +3607,76 @@ namespace wispro.sp.api.Controllers
|
|
|
|
|
|
if(doPersons >0)
|
|
|
{
|
|
|
- //System.Diagnostics.Debug.WriteLine("");
|
|
|
-
|
|
|
-
|
|
|
- foreach(var h in doList)
|
|
|
- {
|
|
|
- var temObj = retlist.FirstOrDefault(s=>s.StaffId == h.StaffId && s.Type == "新申请" && s.isReview == false);
|
|
|
- if(temObj == null)
|
|
|
+ foreach(var h in doList)
|
|
|
{
|
|
|
- temObj = new StaffStatisticsforLevel();
|
|
|
- temObj.StaffId = h.StaffId;
|
|
|
+ var temObj = retlist.FirstOrDefault(s=>s.StaffId == h.StaffId && s.Type == "新申请" && s.isReview == false);
|
|
|
+ if(temObj == null)
|
|
|
+ {
|
|
|
+ temObj = new StaffStatisticsforLevel();
|
|
|
+ temObj.StaffId = h.StaffId;
|
|
|
|
|
|
- temObj.GradeId = h.Staff.StaffGradeId.Value ;
|
|
|
+ temObj.GradeId = h.Staff.StaffGradeId.Value ;
|
|
|
|
|
|
- temObj.CalMonthId = p.CalMonthId;
|
|
|
- temObj.Type = "新申请";
|
|
|
- retlist.Add(temObj);
|
|
|
- }
|
|
|
+ temObj.CalMonthId = p.CalMonthId;
|
|
|
+ temObj.Type = "新申请";
|
|
|
+ retlist.Add(temObj);
|
|
|
+ }
|
|
|
|
|
|
- switch (strCaseCeoffcient)
|
|
|
- {
|
|
|
- case "S":
|
|
|
- if(p.Type == "专案")
|
|
|
- {
|
|
|
- temObj.S += h.totalBasePoint.Value;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- temObj.S+=(double)(1.0M/ (decimal)doPersons);
|
|
|
- }
|
|
|
- break;
|
|
|
- case "A":
|
|
|
- if (p.Type == "专案")
|
|
|
- {
|
|
|
- temObj.A += h.totalBasePoint.Value;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- temObj.A += (double)(1.0M / (decimal)doPersons);
|
|
|
- }
|
|
|
- break;
|
|
|
- case "B":
|
|
|
- if (p.Type == "专案")
|
|
|
- {
|
|
|
- temObj.B += h.totalBasePoint.Value;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- temObj.B += (double)(1.0M / (decimal)doPersons);
|
|
|
- }
|
|
|
- break;
|
|
|
- case "C":
|
|
|
- if (p.Type == "专案")
|
|
|
- {
|
|
|
- temObj.C += h.totalBasePoint.Value;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- temObj.C += (double)(1.0M / (decimal)doPersons);
|
|
|
- }
|
|
|
- break;
|
|
|
- case "D":
|
|
|
- if (p.Type == "专案")
|
|
|
- {
|
|
|
- temObj.D += h.totalBasePoint.Value;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- temObj.D += (double)(1.0M / (decimal)doPersons);
|
|
|
- }
|
|
|
- break;
|
|
|
- }
|
|
|
+ switch (strCaseCeoffcient)
|
|
|
+ {
|
|
|
+ case "S":
|
|
|
+ if(p.Type == "专案")
|
|
|
+ {
|
|
|
+ temObj.S += h.totalBasePoint.Value;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ temObj.S+=(double)(1.0M/ (decimal)doPersons);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "A":
|
|
|
+ if (p.Type == "专案")
|
|
|
+ {
|
|
|
+ temObj.A += h.totalBasePoint.Value;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ temObj.A += (double)(1.0M / (decimal)doPersons);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "B":
|
|
|
+ if (p.Type == "专案")
|
|
|
+ {
|
|
|
+ temObj.B += h.totalBasePoint.Value;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ temObj.B += (double)(1.0M / (decimal)doPersons);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "C":
|
|
|
+ if (p.Type == "专案")
|
|
|
+ {
|
|
|
+ temObj.C += h.totalBasePoint.Value;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ temObj.C += (double)(1.0M / (decimal)doPersons);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "D":
|
|
|
+ if (p.Type == "专案")
|
|
|
+ {
|
|
|
+ temObj.D += h.totalBasePoint.Value;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ temObj.D += (double)(1.0M / (decimal)doPersons);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
#endregion
|
|
|
|