|
@@ -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)
|
|
public bool IsExist(PerformanceItem item)
|
|
{
|
|
{
|
|
var results = Context.PerformanceItems.Where<PerformanceItem>(x =>
|
|
var results = Context.PerformanceItems.Where<PerformanceItem>(x =>
|
|
@@ -852,7 +889,7 @@ namespace wispro.sp.api.Controllers
|
|
|
|
|
|
public ApiSaveResponse RefreshFromIPEasyById(int itemId)
|
|
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)
|
|
if (Item != null)
|
|
{
|
|
{
|
|
new Job.UpdateJXDataFromIPEasyJob().UpdateFromIPEasy(Item, Context);
|
|
new Job.UpdateJXDataFromIPEasyJob().UpdateFromIPEasy(Item, Context);
|
|
@@ -999,65 +1036,44 @@ namespace wispro.sp.api.Controllers
|
|
file.Size = items.Count;
|
|
file.Size = items.Count;
|
|
foreach(var p in items)
|
|
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();
|
|
List<ItemStaff> temItemStaffs = p.ItemStaffs.ToList();
|
|
|
|
|
|
string strCaseMemo = "";
|
|
string strCaseMemo = "";
|
|
- if (p.ItemStaffs.Count > 1)
|
|
|
|
- {
|
|
|
|
|
|
+ string strHandler = "";
|
|
|
|
+
|
|
temItemStaffs = new List<ItemStaff>();
|
|
temItemStaffs = new List<ItemStaff>();
|
|
foreach (var iStaff in p.ItemStaffs)
|
|
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
|
|
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();
|
|
DataRow row = dt.NewRow();
|
|
row["我方文号"] = p.CaseNo;
|
|
row["我方文号"] = p.CaseNo;
|
|
row["申请类型"] = p.ApplicationType;
|
|
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 == "实用新型")
|
|
{
|
|
{
|
|
@@ -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;
|
|
row["案件阶段"] = p.CaseStage;
|
|
@@ -1107,102 +1123,15 @@ namespace wispro.sp.api.Controllers
|
|
row["处理事项系数"] = p.DoItemCoefficient;
|
|
row["处理事项系数"] = p.DoItemCoefficient;
|
|
row["前一次OA处理事项系数"] = "";
|
|
row["前一次OA处理事项系数"] = "";
|
|
row["前一次OA处理人"] = p.PreOastaff?.Name;
|
|
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.Customer?.Name;
|
|
row["申请人"] = p.ApplicationName;
|
|
row["申请人"] = p.ApplicationName;
|
|
row["处理事项完成日"] = p.FinishedDate?.ToString("yyyy-MM-dd");
|
|
row["处理事项完成日"] = p.FinishedDate?.ToString("yyyy-MM-dd");
|
|
@@ -1221,11 +1150,11 @@ namespace wispro.sp.api.Controllers
|
|
row["备注(发文严重超期是否属客观原因,若为否,请填写原因"] = p.OverDueMemo;
|
|
row["备注(发文严重超期是否属客观原因,若为否,请填写原因"] = p.OverDueMemo;
|
|
row["绩效类型"] = p.Type;
|
|
row["绩效类型"] = p.Type;
|
|
row["案件备注"] = $"{p.CaseMemo}\r\n{row["案件备注"]}";
|
|
row["案件备注"] = $"{p.CaseMemo}\r\n{row["案件备注"]}";
|
|
- if(!string.IsNullOrEmpty(strCaseMemo))
|
|
|
|
|
|
+ if (!string.IsNullOrEmpty(strCaseMemo))
|
|
{
|
|
{
|
|
row["案件备注"] = $"{strCaseMemo}\r\n{row["案件备注"]}";
|
|
row["案件备注"] = $"{strCaseMemo}\r\n{row["案件备注"]}";
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
dt.Rows.Add(row);
|
|
dt.Rows.Add(row);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1354,7 +1283,7 @@ namespace wispro.sp.api.Controllers
|
|
List<StaffStatistics> retPoints = new List<StaffStatistics>();
|
|
List<StaffStatistics> retPoints = new List<StaffStatistics>();
|
|
try
|
|
try
|
|
{
|
|
{
|
|
- retPoints = _calItemJX(calMonth, verifyCoefficients, item, spDb);
|
|
|
|
|
|
+ retPoints = _calItemJX( verifyCoefficients, item, spDb);
|
|
}
|
|
}
|
|
catch { }
|
|
catch { }
|
|
|
|
|
|
@@ -1450,7 +1379,7 @@ namespace wispro.sp.api.Controllers
|
|
List<StaffStatistics> retPoints = new List<StaffStatistics>();
|
|
List<StaffStatistics> retPoints = new List<StaffStatistics>();
|
|
try
|
|
try
|
|
{
|
|
{
|
|
- retPoints = _calItemJX(calMonth, verifyCoefficients, item, spDb);
|
|
|
|
|
|
+ retPoints = _calItemJX( verifyCoefficients, item, spDb);
|
|
}
|
|
}
|
|
catch { }
|
|
catch { }
|
|
|
|
|
|
@@ -1584,7 +1513,7 @@ namespace wispro.sp.api.Controllers
|
|
List<StaffStatistics> retPoints = new List<StaffStatistics>();
|
|
List<StaffStatistics> retPoints = new List<StaffStatistics>();
|
|
try
|
|
try
|
|
{
|
|
{
|
|
- retPoints = _calItemJX(calMonth, verifyCoefficients, item, spDb);
|
|
|
|
|
|
+ retPoints = _calItemJX( verifyCoefficients, item, spDb);
|
|
}
|
|
}
|
|
catch { }
|
|
catch { }
|
|
|
|
|
|
@@ -1720,7 +1649,7 @@ namespace wispro.sp.api.Controllers
|
|
var Item = Context.PerformanceItems.Include(p=>p.CalMonth).FirstOrDefault(p=>p.Id == itemid);
|
|
var Item = Context.PerformanceItems.Include(p=>p.CalMonth).FirstOrDefault(p=>p.Id == itemid);
|
|
List<VerifyCoefficient> verifyCoefficients = Context.VerifyCoefficients.ToList<VerifyCoefficient>();
|
|
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>();
|
|
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)
|
|
foreach (var jx in jxList)
|
|
{
|
|
{
|
|
if(jx.totalBasePoint == 0)
|
|
if(jx.totalBasePoint == 0)
|
|
@@ -1738,25 +1670,14 @@ namespace wispro.sp.api.Controllers
|
|
return;
|
|
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();
|
|
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();
|
|
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);
|
|
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
|
|
else
|
|
{
|
|
{
|
|
- syqUsers += 1;
|
|
|
|
|
|
+ temIStaffs.Add(itemStaff);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1816,8 +1737,8 @@ namespace wispro.sp.api.Controllers
|
|
//spDb.Entry(itemStaff.DoPerson).Reference(b => b.StaffGrade).Load();
|
|
//spDb.Entry(itemStaff.DoPerson).Reference(b => b.StaffGrade).Load();
|
|
|
|
|
|
#region 计算审核人绩效点数,核稿人绩效点数按照核稿人与个处理人的核稿系数计算后加总,没有找到核稿系数(比如同级别),核稿系数为0
|
|
#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 取审核人等级审核等级系数
|
|
#region 取审核人等级审核等级系数
|
|
@@ -1835,7 +1756,7 @@ namespace wispro.sp.api.Controllers
|
|
|
|
|
|
string temJxType = $"{item.Type}审核";
|
|
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)
|
|
if (temReviewerStatic != null)
|
|
{
|
|
{
|
|
temReviewerStatic.totalBasePoint += reviewerBasePoint;
|
|
temReviewerStatic.totalBasePoint += reviewerBasePoint;
|
|
@@ -1843,12 +1764,12 @@ namespace wispro.sp.api.Controllers
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- if (item.Reviewer.IsOnJob && itemStaff.DoPerson.Status != "试用期" && item.Reviewer.IsCalPerformsnce ) //判断是否在职
|
|
|
|
|
|
+ if (itemStaff.DoPerson.Status != "试用期" && item.Reviewer.IsCalPerformsnce ) //判断是否在职
|
|
{
|
|
{
|
|
temReviewerStatic = new StaffStatistics()
|
|
temReviewerStatic = new StaffStatistics()
|
|
{
|
|
{
|
|
- CalMonth = calMonth,
|
|
|
|
- CalMonthId = calMonth.Id,
|
|
|
|
|
|
+
|
|
|
|
+ CalMonthId = item.CalMonthId,
|
|
StaffId = item.ReviewerId.Value,
|
|
StaffId = item.ReviewerId.Value,
|
|
totalBasePoint = reviewerBasePoint,
|
|
totalBasePoint = reviewerBasePoint,
|
|
totalActuallyPoint = reviewerBasePoint,
|
|
totalActuallyPoint = reviewerBasePoint,
|
|
@@ -1903,7 +1824,7 @@ namespace wispro.sp.api.Controllers
|
|
}
|
|
}
|
|
|
|
|
|
string handlerJxType = $"{item.Type}处理";
|
|
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)
|
|
if (temStatic != null)
|
|
{
|
|
{
|
|
temStatic.totalBasePoint += handlerBasePoint;
|
|
temStatic.totalBasePoint += handlerBasePoint;
|
|
@@ -1919,7 +1840,7 @@ namespace wispro.sp.api.Controllers
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- if (itemStaff.DoPerson.StaffGradeId != null && itemStaff.DoPerson.IsOnJob)
|
|
|
|
|
|
+ if (itemStaff.DoPerson.StaffGradeId != null && itemStaff.DoPerson.IsCalPerformsnce)
|
|
{
|
|
{
|
|
if (item.Type == "OA" || item.Type == "新申请")
|
|
if (item.Type == "OA" || item.Type == "新申请")
|
|
{
|
|
{
|
|
@@ -1927,8 +1848,7 @@ namespace wispro.sp.api.Controllers
|
|
{
|
|
{
|
|
temStatic = new StaffStatistics()
|
|
temStatic = new StaffStatistics()
|
|
{
|
|
{
|
|
- CalMonth = calMonth,
|
|
|
|
- CalMonthId = calMonth.Id,
|
|
|
|
|
|
+ CalMonthId = item.CalMonthId,
|
|
StaffId = item.Reviewer.Id,
|
|
StaffId = item.Reviewer.Id,
|
|
totalActuallyPoint= handlerBasePoint * item.Reviewer.StaffGrade.Coefficient,
|
|
totalActuallyPoint= handlerBasePoint * item.Reviewer.StaffGrade.Coefficient,
|
|
totalBasePoint = handlerBasePoint,
|
|
totalBasePoint = handlerBasePoint,
|
|
@@ -1943,8 +1863,8 @@ namespace wispro.sp.api.Controllers
|
|
itemStaff.DoPerson.StaffGrade = spDb.StaffGrades.FirstOrDefault(s=>s.Id == itemStaff.DoPerson.StaffGradeId);
|
|
itemStaff.DoPerson.StaffGrade = spDb.StaffGrades.FirstOrDefault(s=>s.Id == itemStaff.DoPerson.StaffGradeId);
|
|
temStatic = new StaffStatistics()
|
|
temStatic = new StaffStatistics()
|
|
{
|
|
{
|
|
- CalMonth = calMonth,
|
|
|
|
- CalMonthId = calMonth.Id,
|
|
|
|
|
|
+ //CalMonth = calMonth,
|
|
|
|
+ CalMonthId = item.CalMonthId,
|
|
StaffId = itemStaff.DoPersonId,
|
|
StaffId = itemStaff.DoPersonId,
|
|
totalActuallyPoint = handlerBasePoint * itemStaff.DoPerson.StaffGrade.Coefficient,
|
|
totalActuallyPoint = handlerBasePoint * itemStaff.DoPerson.StaffGrade.Coefficient,
|
|
totalBasePoint = handlerBasePoint,
|
|
totalBasePoint = handlerBasePoint,
|
|
@@ -1958,8 +1878,8 @@ namespace wispro.sp.api.Controllers
|
|
{
|
|
{
|
|
temStatic = new StaffStatistics()
|
|
temStatic = new StaffStatistics()
|
|
{
|
|
{
|
|
- CalMonth = calMonth,
|
|
|
|
- CalMonthId = calMonth.Id,
|
|
|
|
|
|
+ //CalMonth = calMonth,
|
|
|
|
+ CalMonthId = item.CalMonthId,
|
|
StaffId = itemStaff.DoPersonId,
|
|
StaffId = itemStaff.DoPersonId,
|
|
totalBasePoint = handlerBasePoint,
|
|
totalBasePoint = handlerBasePoint,
|
|
totalActuallyPoint = handlerBasePoint,
|
|
totalActuallyPoint = handlerBasePoint,
|
|
@@ -2413,7 +2333,7 @@ namespace wispro.sp.api.Controllers
|
|
|
|
|
|
if (item.ReviewerId != null && item.BasePoint.HasValue)
|
|
if (item.ReviewerId != null && item.BasePoint.HasValue)
|
|
{
|
|
{
|
|
- var jxList = _calItemJX(item.CalMonth, verifyCoefficients, item, new spDbContext());
|
|
|
|
|
|
+ var jxList = _calItemJX( verifyCoefficients, item, new spDbContext());
|
|
|
|
|
|
row["核稿系数"] = "";
|
|
row["核稿系数"] = "";
|
|
var temJx = jxList.FirstOrDefault<StaffStatistics>(s => s.jxType.Contains("审核") && s.StaffId == item.ReviewerId);
|
|
var temJx = jxList.FirstOrDefault<StaffStatistics>(s => s.jxType.Contains("审核") && s.StaffId == item.ReviewerId);
|