|
@@ -521,13 +521,7 @@ namespace wispro.sp.api.Controllers
|
|
|
|
|
|
private List<StaffStatistics> _CalMyStatistics(CalMonth calMonth, int? userid = null)
|
|
|
{
|
|
|
- NanduStatics gspjXS = DegreeOfDifficulty(calMonth);
|
|
|
- calMonth.NanduXS = gspjXS.NanduXS;
|
|
|
- calMonth.S = gspjXS.S;
|
|
|
- calMonth.A = gspjXS.A;
|
|
|
- calMonth.B = gspjXS.B;
|
|
|
- calMonth.C = gspjXS.C;
|
|
|
- calMonth.D = gspjXS.D;
|
|
|
+
|
|
|
|
|
|
//未归档,从绩效记录中统计数据
|
|
|
var results = Context.PerformanceItems.Where<PerformanceItem>(s => s.CalMonth.Id == calMonth.Id);
|
|
@@ -588,6 +582,7 @@ namespace wispro.sp.api.Controllers
|
|
|
if (temValue != null)
|
|
|
{
|
|
|
temValue.totalBasePoint += retUserValue.totalBasePoint;
|
|
|
+ temValue.totalActuallyPoint += retUserValue.totalActuallyPoint;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -603,32 +598,7 @@ namespace wispro.sp.api.Controllers
|
|
|
retList = retList.Where<StaffStatistics>(s => s.StaffId == userid.Value).ToList();
|
|
|
}
|
|
|
|
|
|
- IDictionary<int, NanduStatics> staffXiShu = new Dictionary<int, NanduStatics>();
|
|
|
- foreach (StaffStatistics ss in retList)
|
|
|
- {
|
|
|
- if (ss.jxType.Contains("新申请") || ss.jxType.Contains("专案"))
|
|
|
- {
|
|
|
- if (!staffXiShu.ContainsKey(ss.StaffId))
|
|
|
- {
|
|
|
- NanduStatics nandu = DegreeOfDifficulty(calMonth, ss.StaffId);
|
|
|
- staffXiShu.Add(ss.StaffId, nandu);
|
|
|
- }
|
|
|
-
|
|
|
- ss.totalActuallyPoint = ss.totalBasePoint * staffXiShu[ss.StaffId].NanduXS / gspjXS.NanduXS;
|
|
|
- ss.NanduXS = staffXiShu[ss.StaffId].NanduXS;
|
|
|
- ss.S = staffXiShu[ss.StaffId].S;
|
|
|
- ss.A = staffXiShu[ss.StaffId].A;
|
|
|
- ss.B = staffXiShu[ss.StaffId].B;
|
|
|
- ss.C = staffXiShu[ss.StaffId].C;
|
|
|
- ss.D = staffXiShu[ss.StaffId].D;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- ss.totalActuallyPoint = ss.totalBasePoint;
|
|
|
- }
|
|
|
-
|
|
|
- //ss.CalMonth.PerformanceItems = null;
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
|
|
|
return retList;
|
|
@@ -787,6 +757,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));
|
|
@@ -802,7 +773,10 @@ namespace wispro.sp.api.Controllers
|
|
|
file.Size = items.Count;
|
|
|
foreach(var p in items)
|
|
|
{
|
|
|
-
|
|
|
+ if(p.CaseNo == "PAUS2117245")
|
|
|
+ {
|
|
|
+ System.Diagnostics.Debug.WriteLine("");
|
|
|
+ }
|
|
|
System.Diagnostics.Debug.WriteLine(p.CaseNo);
|
|
|
|
|
|
|
|
@@ -914,7 +888,15 @@ namespace wispro.sp.api.Controllers
|
|
|
row["案件备注"] = $"{row["案件备注"]}\r\n处理人{iStaff.DoPerson.Name}未转正";
|
|
|
row["处理人"] = p.Reviewer?.Name;
|
|
|
row["处理人等级"] = p.Reviewer?.StaffGrade?.Grade;
|
|
|
- row["基本点数"] = (p.BasePoint / total).ToString();
|
|
|
+
|
|
|
+ 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();
|
|
@@ -933,7 +915,15 @@ namespace wispro.sp.api.Controllers
|
|
|
{
|
|
|
row["处理人"] = iStaff.DoPerson.Name;
|
|
|
row["处理人等级"] = iStaff.DoPerson.StaffGrade?.Grade;
|
|
|
- row["基本点数"] = (p.BasePoint / total).ToString();
|
|
|
+
|
|
|
+ if (isPJFP)
|
|
|
+ {
|
|
|
+ row["基本点数"] = (p.BasePoint / total).ToString();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ row["基本点数"] = (p.BasePoint * iStaff.PerformancePoint / total).ToString();
|
|
|
+ }
|
|
|
row["处理人绩效系数"] = iStaff.DoPerson.StaffGrade?.Coefficient;
|
|
|
|
|
|
|
|
@@ -1001,6 +991,7 @@ namespace wispro.sp.api.Controllers
|
|
|
row["客户期限"] = p.CustomerLimitDate?.ToString("yyyy-MM-dd");
|
|
|
row["内部期限"] = p.InternalDate?.ToString("yyyy-MM-dd");
|
|
|
row["初稿日"] = p.FirstDraftDate?.ToString("yyyy-MM-dd");
|
|
|
+ row["翻译字数"] = p.WordCount;
|
|
|
row["备注(发文严重超期是否属客观原因,若为否,请填写原因"] = p.OverDueMemo;
|
|
|
row["绩效类型"] = p.Type;
|
|
|
row["案件备注"] = $"{p.CaseMemo}\r\n{row["案件备注"]}";
|
|
@@ -1510,7 +1501,10 @@ namespace wispro.sp.api.Controllers
|
|
|
|
|
|
System.Collections.Hashtable doPersonsBL = new System.Collections.Hashtable();
|
|
|
|
|
|
-
|
|
|
+ if(item.Type == "专案")
|
|
|
+ {
|
|
|
+ System.Diagnostics.Debug.WriteLine("");
|
|
|
+ }
|
|
|
|
|
|
List<StaffStatistics> itemStatistics = new List<StaffStatistics>();
|
|
|
|
|
@@ -1521,6 +1515,7 @@ namespace wispro.sp.api.Controllers
|
|
|
}
|
|
|
|
|
|
List<ItemStaff> temIStaffs = new List<ItemStaff>();
|
|
|
+ int syqUsers = 0;
|
|
|
foreach(var itemStaff in item.ItemStaffs)
|
|
|
{
|
|
|
if (itemStaff.DoPerson == null)
|
|
@@ -1528,10 +1523,23 @@ namespace wispro.sp.api.Controllers
|
|
|
itemStaff.DoPerson = spDb.Staffs.Include(s => s.StaffGrade).FirstOrDefault(p => p.Id == itemStaff.DoPersonId);
|
|
|
}
|
|
|
|
|
|
- if(itemStaff.DoPerson.Status != "试用期")
|
|
|
+ if(itemStaff.DoPerson.Status != "试用期" || !itemStaff.DoPerson.IsCalPerformsnce )
|
|
|
{
|
|
|
temIStaffs.Add(itemStaff);
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ syqUsers += 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(syqUsers == item.ItemStaffs.Count)
|
|
|
+ {
|
|
|
+ if(item.Reviewer != null)
|
|
|
+ {
|
|
|
+ temIStaffs.Add(new ItemStaff() { DoPersonId = item.ReviewerId.Value, ItemId = item.Id });
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
bool isPJFP = true;
|
|
@@ -1640,13 +1648,15 @@ namespace wispro.sp.api.Controllers
|
|
|
var temStatic = itemStatistics.Where<StaffStatistics>(s => s.StaffId == itemStaff.DoPersonId && s.jxType == handlerJxType && s.CalMonth.Id == calMonth.Id).FirstOrDefault();
|
|
|
if (temStatic != null)
|
|
|
{
|
|
|
- if (item.Type == "OA" || item.Type =="新申请")
|
|
|
+ temStatic.totalBasePoint += handlerBasePoint;
|
|
|
+
|
|
|
+ if (item.Type == "OA" || item.Type == "新申请")
|
|
|
{
|
|
|
- temStatic.totalBasePoint += handlerBasePoint * itemStaff.DoPerson.StaffGrade.Coefficient;
|
|
|
+ temStatic.totalActuallyPoint += handlerBasePoint * itemStaff.DoPerson.StaffGrade.Coefficient;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- temStatic.totalBasePoint += handlerBasePoint;
|
|
|
+ temStatic.totalActuallyPoint += handlerBasePoint;
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -1662,7 +1672,8 @@ namespace wispro.sp.api.Controllers
|
|
|
CalMonth = calMonth,
|
|
|
CalMonthId = calMonth.Id,
|
|
|
StaffId = item.Reviewer.Id,
|
|
|
- totalBasePoint = handlerBasePoint * item.Reviewer.StaffGrade.Coefficient,
|
|
|
+ totalActuallyPoint= handlerBasePoint * item.Reviewer.StaffGrade.Coefficient,
|
|
|
+ totalBasePoint = handlerBasePoint,
|
|
|
jxType = handlerJxType
|
|
|
};
|
|
|
|
|
@@ -1677,11 +1688,11 @@ namespace wispro.sp.api.Controllers
|
|
|
CalMonth = calMonth,
|
|
|
CalMonthId = calMonth.Id,
|
|
|
StaffId = itemStaff.DoPersonId,
|
|
|
- totalBasePoint = handlerBasePoint * itemStaff.DoPerson.StaffGrade.Coefficient,
|
|
|
+ totalActuallyPoint = handlerBasePoint * itemStaff.DoPerson.StaffGrade.Coefficient,
|
|
|
+ totalBasePoint = handlerBasePoint,
|
|
|
jxType = handlerJxType
|
|
|
};
|
|
|
|
|
|
-
|
|
|
itemStatistics.Add(temStatic);
|
|
|
}
|
|
|
}
|
|
@@ -1693,10 +1704,10 @@ namespace wispro.sp.api.Controllers
|
|
|
CalMonthId = calMonth.Id,
|
|
|
StaffId = itemStaff.DoPersonId,
|
|
|
totalBasePoint = handlerBasePoint,
|
|
|
+ totalActuallyPoint = handlerBasePoint,
|
|
|
jxType = handlerJxType
|
|
|
};
|
|
|
|
|
|
-
|
|
|
itemStatistics.Add(temStatic);
|
|
|
}
|
|
|
}
|
|
@@ -1707,14 +1718,92 @@ namespace wispro.sp.api.Controllers
|
|
|
return itemStatistics;
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 新申请/专案:
|
|
|
+ /// 调整点数 = 分配比例点数/分配比例点数之和*总点数
|
|
|
+ /// 等级调整点数+项目组点数之和 = 基础点数 * 代理人等级系数 + 项目组案件调整点数
|
|
|
+ /// 分配比例点数 = 个人平均难度系数 / 总平均难度系数 *(等级调整点数+项目组点数之和)
|
|
|
+ /// 总点数=等级调整点数+项目组点数之和+奖励点数
|
|
|
+ /// 奖励点数= S案数量*1.5 + A案数量 * 0.5
|
|
|
+ /// 难度系数=(S案数量*2.5 + A案数量* 1.5 + B案数量*1.0 + C案数量*0.7+ D案数量*0.4) / 总案件数量
|
|
|
+ /// 总案件数量= S案数量 + A案数量 + B案数量 + C案数量+ D案数量
|
|
|
+ /// OA :
|
|
|
+ /// 调整点数= 基础点数 * 等级系数
|
|
|
+ /// 其他:
|
|
|
+ /// 直接加和基础点数 不需要乘以系数
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="year"></param>
|
|
|
+ /// <param name="month"></param>
|
|
|
+ /// <returns></returns>
|
|
|
public ApiSaveResponse FinishedCalMonth(int year,int month)
|
|
|
{
|
|
|
CalMonth calMonth = Context.CalMonths.Where<CalMonth>(c => c.Month == month && c.Year == year).FirstOrDefault();
|
|
|
|
|
|
if (calMonth != null || calMonth.Status !=4)
|
|
|
{
|
|
|
+ NanduStatics gspjXS = DegreeOfDifficulty(calMonth);
|
|
|
+ calMonth.NanduXS = gspjXS.NanduXS;
|
|
|
+ calMonth.S = gspjXS.S;
|
|
|
+ calMonth.A = gspjXS.A;
|
|
|
+ calMonth.B = gspjXS.B;
|
|
|
+ calMonth.C = gspjXS.C;
|
|
|
+ calMonth.D = gspjXS.D;
|
|
|
+
|
|
|
var retList = _CalMyStatistics(calMonth);
|
|
|
|
|
|
+ double? totalActualPoint = retList.Where(s => s.jxType.Contains("新申请") || s.jxType.Contains("专案")).Sum(s => s.totalActuallyPoint);
|
|
|
+
|
|
|
+ #region 奖励点数
|
|
|
+ if (calMonth.S.HasValue)
|
|
|
+ {
|
|
|
+ totalActualPoint = totalActualPoint + (calMonth.S.Value * 1.5);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (calMonth.A.HasValue)
|
|
|
+ {
|
|
|
+ totalActualPoint = totalActualPoint + (calMonth.S.Value * 0.5);
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ double? totalFPBLPoint = 0; //分配比率总点数
|
|
|
+
|
|
|
+ #region 难度系数
|
|
|
+ IDictionary<int, NanduStatics> staffXiShu = new Dictionary<int, NanduStatics>();
|
|
|
+ foreach (StaffStatistics ss in retList)
|
|
|
+ {
|
|
|
+ if (ss.jxType.Contains("新申请") || ss.jxType.Contains("专案"))
|
|
|
+ {
|
|
|
+ if (!staffXiShu.ContainsKey(ss.StaffId))
|
|
|
+ {
|
|
|
+ NanduStatics nandu = DegreeOfDifficulty(calMonth, ss.StaffId);
|
|
|
+ staffXiShu.Add(ss.StaffId, nandu);
|
|
|
+ }
|
|
|
+
|
|
|
+ ss.FinianlPoint = ss.totalActuallyPoint * staffXiShu[ss.StaffId].NanduXS / gspjXS.NanduXS;
|
|
|
+ totalFPBLPoint += ss.FinianlPoint;
|
|
|
+ ss.NanduXS = staffXiShu[ss.StaffId].NanduXS;
|
|
|
+ ss.S = staffXiShu[ss.StaffId].S;
|
|
|
+ ss.A = staffXiShu[ss.StaffId].A;
|
|
|
+ ss.B = staffXiShu[ss.StaffId].B;
|
|
|
+ ss.C = staffXiShu[ss.StaffId].C;
|
|
|
+ ss.D = staffXiShu[ss.StaffId].D;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ss.FinianlPoint = ss.totalActuallyPoint;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ foreach(StaffStatistics ss in retList)
|
|
|
+ {
|
|
|
+ if (ss.jxType.Contains("新申请") || ss.jxType.Contains("专案"))
|
|
|
+ {
|
|
|
+ ss.FinianlPoint = ss.FinianlPoint / totalFPBLPoint * totalActualPoint;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
using (var t = Context.Database.BeginTransaction())
|
|
|
{
|
|
|
try
|