|
@@ -507,10 +507,10 @@ namespace wispro.sp.api.Controllers
|
|
|
|
|
|
|
|
var results = spDb.StaffStatistics.Include(p => p.Item).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.Include(p => p.Item).Where(s => s.CalMonthId == calMonth.Id && (s.jxType == jxType || s.jxType == "专案处理") && s.StaffId == userId);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //if (!isReivewer)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // results = spDb.StaffStatistics.Include(p => p.Item).Where(s => s.CalMonthId == calMonth.Id && (s.jxType == jxType ) && s.StaffId == userId);
|
|
|
|
|
+ //}
|
|
|
|
|
|
|
|
#region 循环计算
|
|
#region 循环计算
|
|
|
decimal iCount = 0;
|
|
decimal iCount = 0;
|
|
@@ -521,10 +521,6 @@ namespace wispro.sp.api.Controllers
|
|
|
{
|
|
{
|
|
|
if (item.Item != null)
|
|
if (item.Item != null)
|
|
|
{
|
|
{
|
|
|
- //if(item.Item.CaseNo == "PACN2220066")
|
|
|
|
|
- //{
|
|
|
|
|
- // System.Diagnostics.Debug.WriteLine("");
|
|
|
|
|
- //}
|
|
|
|
|
//合写人数
|
|
//合写人数
|
|
|
decimal CaseNumber = 1M;
|
|
decimal CaseNumber = 1M;
|
|
|
|
|
|
|
@@ -675,7 +671,7 @@ namespace wispro.sp.api.Controllers
|
|
|
var results = spDb.StaffStatistics
|
|
var results = spDb.StaffStatistics
|
|
|
.Where(p =>
|
|
.Where(p =>
|
|
|
p.CalMonthId == calMonth.Id &&
|
|
p.CalMonthId == calMonth.Id &&
|
|
|
- (p.Item.Type == "新申请" || p.Item.Type == "专案"))
|
|
|
|
|
|
|
+ (p.Item.Type == "新申请" )) //|| p.Item.Type == "专案"))
|
|
|
.Select(p => p.Item).Distinct();
|
|
.Select(p => p.Item).Distinct();
|
|
|
|
|
|
|
|
#region 循环计算
|
|
#region 循环计算
|
|
@@ -794,7 +790,7 @@ namespace wispro.sp.api.Controllers
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- System.Diagnostics.Debug.WriteLine($"{item.CaseNo}\t{item.DoItem}\t{item.DoItemCoefficient}\t{item.WordCount}\t{strCaseCeoffcient}\t{item.CaseCoefficient}\t{item.BasePoint}");
|
|
|
|
|
|
|
+ //System.Diagnostics.Debug.WriteLine($"{item.CaseNo}\t{item.DoItem}\t{item.DoItemCoefficient}\t{item.WordCount}\t{strCaseCeoffcient}\t{item.CaseCoefficient}\t{item.BasePoint}");
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
#endregion
|
|
#endregion
|
|
@@ -1570,7 +1566,7 @@ namespace wispro.sp.api.Controllers
|
|
|
var Rules = spDb.BasePointRules.ToList();
|
|
var Rules = spDb.BasePointRules.ToList();
|
|
|
while (iTable < temDt.Rows.Count && iList < items.Count)
|
|
while (iTable < temDt.Rows.Count && iList < items.Count)
|
|
|
{
|
|
{
|
|
|
- System.Diagnostics.Debug.WriteLine($"Excel:{iTable}/{temDt.Rows.Count}\t{iList}/{items.Count}");
|
|
|
|
|
|
|
+ //System.Diagnostics.Debug.WriteLine($"Excel:{iTable}/{temDt.Rows.Count}\t{iList}/{items.Count}");
|
|
|
|
|
|
|
|
DataRow row = temDt.Rows[iTable];
|
|
DataRow row = temDt.Rows[iTable];
|
|
|
PerformanceItem item = items[iList];
|
|
PerformanceItem item = items[iList];
|
|
@@ -2158,7 +2154,7 @@ namespace wispro.sp.api.Controllers
|
|
|
{
|
|
{
|
|
|
temStatic.totalBasePoint += handlerBasePoint;
|
|
temStatic.totalBasePoint += handlerBasePoint;
|
|
|
|
|
|
|
|
- if (item.Type == "OA" || item.Type == "新申请")
|
|
|
|
|
|
|
+ if (item.Type == "OA" || item.Type == "新申请") // || item.Type == "专案")
|
|
|
{
|
|
{
|
|
|
temStatic.totalActuallyPoint += (double)((decimal)handlerBasePoint * (decimal)itemStaff.DoPerson.StaffGrade.Coefficient);
|
|
temStatic.totalActuallyPoint += (double)((decimal)handlerBasePoint * (decimal)itemStaff.DoPerson.StaffGrade.Coefficient);
|
|
|
}
|
|
}
|
|
@@ -2171,7 +2167,7 @@ namespace wispro.sp.api.Controllers
|
|
|
{
|
|
{
|
|
|
if (itemStaff.DoPerson.StaffGradeId != null && itemStaff.DoPerson.IsCalPerformsnce)
|
|
if (itemStaff.DoPerson.StaffGradeId != null && itemStaff.DoPerson.IsCalPerformsnce)
|
|
|
{
|
|
{
|
|
|
- if (item.Type == "OA" || item.Type == "新申请")
|
|
|
|
|
|
|
+ if (item.Type == "OA" || item.Type == "新申请") // || item.Type == "专案")
|
|
|
{
|
|
{
|
|
|
if (itemStaff.DoPerson.StaffGrade == null)
|
|
if (itemStaff.DoPerson.StaffGrade == null)
|
|
|
{
|
|
{
|
|
@@ -2298,13 +2294,9 @@ namespace wispro.sp.api.Controllers
|
|
|
IDictionary<int, NanduStatics> ReivewerXiShu = new Dictionary<int, NanduStatics>();
|
|
IDictionary<int, NanduStatics> ReivewerXiShu = new Dictionary<int, NanduStatics>();
|
|
|
foreach (StaffStatistics ss in retList)
|
|
foreach (StaffStatistics ss in retList)
|
|
|
{
|
|
{
|
|
|
-
|
|
|
|
|
- if (ss.jxType == "新申请处理" || ss.jxType == "专案处理")
|
|
|
|
|
|
|
+ if (ss.jxType == "新申请处理") // || ss.jxType == "专案处理")
|
|
|
{
|
|
{
|
|
|
- if(ss.StaffId == 222)
|
|
|
|
|
- {
|
|
|
|
|
- System.Diagnostics.Debug.WriteLine("");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
#region 新申请处理+专案处理
|
|
#region 新申请处理+专案处理
|
|
|
if (!staffXiShu.ContainsKey(ss.StaffId))
|
|
if (!staffXiShu.ContainsKey(ss.StaffId))
|
|
|
{
|
|
{
|
|
@@ -2342,23 +2334,64 @@ namespace wispro.sp.api.Controllers
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- ss.FinianlPoint = ss.totalActuallyPoint;
|
|
|
|
|
- spDb.SaveChanges();
|
|
|
|
|
|
|
+ if (ss.jxType == "专案处理")
|
|
|
|
|
+ {
|
|
|
|
|
+ switch (ss.Item.CaseCoefficient)
|
|
|
|
|
+ {
|
|
|
|
|
+ case "S":
|
|
|
|
|
+ ss.FinianlPoint = ss.totalActuallyPoint * 2.5;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "A":
|
|
|
|
|
+ ss.FinianlPoint = ss.totalActuallyPoint * 1.5;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "B":
|
|
|
|
|
+ ss.FinianlPoint = ss.totalActuallyPoint;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "C":
|
|
|
|
|
+ ss.FinianlPoint = ss.totalActuallyPoint * 0.7;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "D":
|
|
|
|
|
+ ss.FinianlPoint = ss.totalActuallyPoint * 0.4;
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ ss.FinianlPoint = ss.totalActuallyPoint;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ ss.NanduXS = null;
|
|
|
|
|
+ ss.S = null;
|
|
|
|
|
+ ss.A = null;
|
|
|
|
|
+ ss.B = null;
|
|
|
|
|
+ ss.C = null;
|
|
|
|
|
+ ss.D = null;
|
|
|
|
|
+ spDb.SaveChanges();
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ ss.FinianlPoint = ss.totalActuallyPoint;
|
|
|
|
|
+ ss.NanduXS = null;
|
|
|
|
|
+ ss.S = null;
|
|
|
|
|
+ ss.A = null;
|
|
|
|
|
+ ss.B = null;
|
|
|
|
|
+ ss.C = null;
|
|
|
|
|
+ ss.D = null;
|
|
|
|
|
+ spDb.SaveChanges();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- var xsqList = retList.Where(ss => ss.jxType == "新申请处理" || ss.jxType == "专案处理").ToList();
|
|
|
|
|
|
|
+ var xsqList = retList.Where(ss => ss.jxType == "新申请处理").ToList();// || ss.jxType == "专案处理").ToList();
|
|
|
var totalFPBLPoint = xsqList.Sum(p=>p.FinianlPoint); //新申请处理+专案 分配比率总点数
|
|
var totalFPBLPoint = xsqList.Sum(p=>p.FinianlPoint); //新申请处理+专案 分配比率总点数
|
|
|
var totalActionPoint = xsqList.Sum(p=>p.totalActuallyPoint); //新申请处理+专案 原始总点数
|
|
var totalActionPoint = xsqList.Sum(p=>p.totalActuallyPoint); //新申请处理+专案 原始总点数
|
|
|
|
|
|
|
|
foreach (StaffStatistics ss in xsqList)
|
|
foreach (StaffStatistics ss in xsqList)
|
|
|
{
|
|
{
|
|
|
- if(totalFPBLPoint * (totalActionPoint + jlPoint) == 0)
|
|
|
|
|
- {
|
|
|
|
|
- Console.WriteLine("");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //if(totalFPBLPoint * (totalActionPoint + jlPoint) == 0)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // Console.WriteLine("");
|
|
|
|
|
+ //}
|
|
|
ss.FinianlPoint = ss.FinianlPoint / totalFPBLPoint * (totalActionPoint + jlPoint);
|
|
ss.FinianlPoint = ss.FinianlPoint / totalFPBLPoint * (totalActionPoint + jlPoint);
|
|
|
spDb.SaveChanges();
|
|
spDb.SaveChanges();
|
|
|
|
|
|
|
@@ -2473,6 +2506,15 @@ namespace wispro.sp.api.Controllers
|
|
|
if (calMonth != null || calMonth.Status !=4)
|
|
if (calMonth != null || calMonth.Status !=4)
|
|
|
{
|
|
{
|
|
|
spDbContext spDb = new spDbContext();
|
|
spDbContext spDb = new spDbContext();
|
|
|
|
|
+
|
|
|
|
|
+ #region 删除垃圾数据
|
|
|
|
|
+ var delEntity = spDb.StaffStatistics.Where(x => x.Item == null && x.CalMonthId == calMonth.Id).ToArray();
|
|
|
|
|
+ if(delEntity.Length > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ spDb.StaffStatistics.RemoveRange(delEntity);
|
|
|
|
|
+ }
|
|
|
|
|
+ #endregion
|
|
|
|
|
+
|
|
|
calMonth = spDb.CalMonths.FirstOrDefault(c=>c.Id == calMonth.Id);
|
|
calMonth = spDb.CalMonths.FirstOrDefault(c=>c.Id == calMonth.Id);
|
|
|
using (var t = spDb.Database.BeginTransaction())
|
|
using (var t = spDb.Database.BeginTransaction())
|
|
|
{
|
|
{
|
|
@@ -2694,6 +2736,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));
|
|
|
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));
|
|
@@ -2745,16 +2788,26 @@ namespace wispro.sp.api.Controllers
|
|
|
|
|
|
|
|
string strISLevels = "";
|
|
string strISLevels = "";
|
|
|
string strISNames = "";
|
|
string strISNames = "";
|
|
|
|
|
+ string strISDeps = "";
|
|
|
|
|
|
|
|
foreach (var istaff in item.ItemStaffs)
|
|
foreach (var istaff in item.ItemStaffs)
|
|
|
{
|
|
{
|
|
|
strISLevels = string.IsNullOrEmpty(strISLevels)?istaff.DoPerson.StaffGrade?.Grade : $"{strISLevels},{istaff.DoPerson.StaffGrade?.Grade}";
|
|
strISLevels = string.IsNullOrEmpty(strISLevels)?istaff.DoPerson.StaffGrade?.Grade : $"{strISLevels},{istaff.DoPerson.StaffGrade?.Grade}";
|
|
|
strISNames = string.IsNullOrEmpty(strISNames)?istaff.DoPerson.Name : $"{strISNames},{istaff.DoPerson.Name}";
|
|
strISNames = string.IsNullOrEmpty(strISNames)?istaff.DoPerson.Name : $"{strISNames},{istaff.DoPerson.Name}";
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ var dp = new spDbContext().DepartmentPositions.Where(x => x.StaffId == istaff.DoPersonId).Include(d=>d.department).FirstOrDefault();
|
|
|
|
|
+ if(dp != null )
|
|
|
|
|
+ {
|
|
|
|
|
+ strISDeps = string.IsNullOrEmpty(strISDeps) ? dp.department.Name : $"{strISDeps},{dp.department.Name}";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
row["处理人等级"] = strISLevels;
|
|
row["处理人等级"] = strISLevels;
|
|
|
row["基本点数"] = item.BasePoint;
|
|
row["基本点数"] = item.BasePoint;
|
|
|
row["处理人"] = strISNames;
|
|
row["处理人"] = strISNames;
|
|
|
|
|
+ row["处理人部门"] = strISDeps;
|
|
|
row["核稿人"] = item.Reviewer?.Name;
|
|
row["核稿人"] = item.Reviewer?.Name;
|
|
|
|
|
|
|
|
if (item.ReviewerId != null && item.BasePoint.HasValue)
|
|
if (item.ReviewerId != null && item.BasePoint.HasValue)
|
|
@@ -3548,11 +3601,6 @@ namespace wispro.sp.api.Controllers
|
|
|
|
|
|
|
|
temObj.GradeId = h.Staff.StaffGradeId.Value ;
|
|
temObj.GradeId = h.Staff.StaffGradeId.Value ;
|
|
|
|
|
|
|
|
- if(temObj.GradeId == 0)
|
|
|
|
|
- {
|
|
|
|
|
- System.Diagnostics.Debug.WriteLine("");
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
temObj.CalMonthId = p.CalMonthId;
|
|
temObj.CalMonthId = p.CalMonthId;
|
|
|
temObj.Type = "新申请";
|
|
temObj.Type = "新申请";
|
|
|
retlist.Add(temObj);
|
|
retlist.Add(temObj);
|
|
@@ -3628,10 +3676,7 @@ namespace wispro.sp.api.Controllers
|
|
|
temObj.StaffId = reviewer.StaffId;
|
|
temObj.StaffId = reviewer.StaffId;
|
|
|
temObj.GradeId = reviewer.Staff.StaffGradeId.Value;
|
|
temObj.GradeId = reviewer.Staff.StaffGradeId.Value;
|
|
|
|
|
|
|
|
- if (temObj.GradeId == 0)
|
|
|
|
|
- {
|
|
|
|
|
- System.Diagnostics.Debug.WriteLine("");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
temObj.CalMonthId = p.CalMonthId;
|
|
temObj.CalMonthId = p.CalMonthId;
|
|
|
temObj.Type = "新申请";
|
|
temObj.Type = "新申请";
|
|
|
temObj.isReview = true;
|
|
temObj.isReview = true;
|
|
@@ -3683,10 +3728,7 @@ namespace wispro.sp.api.Controllers
|
|
|
temObj = new StaffStatisticsforLevel();
|
|
temObj = new StaffStatisticsforLevel();
|
|
|
temObj.StaffId = h.StaffId;
|
|
temObj.StaffId = h.StaffId;
|
|
|
temObj.GradeId = h.Staff.StaffGradeId.Value ;
|
|
temObj.GradeId = h.Staff.StaffGradeId.Value ;
|
|
|
- if (temObj.GradeId == 0)
|
|
|
|
|
- {
|
|
|
|
|
- System.Diagnostics.Debug.WriteLine("");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
temObj.CalMonthId = p.CalMonthId;
|
|
temObj.CalMonthId = p.CalMonthId;
|
|
|
temObj.Type = "国内OA";
|
|
temObj.Type = "国内OA";
|
|
|
retlist.Add(temObj);
|
|
retlist.Add(temObj);
|
|
@@ -3728,10 +3770,7 @@ namespace wispro.sp.api.Controllers
|
|
|
temObj = new StaffStatisticsforLevel();
|
|
temObj = new StaffStatisticsforLevel();
|
|
|
temObj.StaffId = reviewer.StaffId;
|
|
temObj.StaffId = reviewer.StaffId;
|
|
|
temObj.GradeId = reviewer.Staff.StaffGradeId.Value;
|
|
temObj.GradeId = reviewer.Staff.StaffGradeId.Value;
|
|
|
- if (temObj.GradeId == 0)
|
|
|
|
|
- {
|
|
|
|
|
- System.Diagnostics.Debug.WriteLine("");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
temObj.CalMonthId = p.CalMonthId;
|
|
temObj.CalMonthId = p.CalMonthId;
|
|
|
temObj.Type = "国内OA";
|
|
temObj.Type = "国内OA";
|
|
|
temObj.isReview = true;
|
|
temObj.isReview = true;
|
|
@@ -3781,10 +3820,7 @@ namespace wispro.sp.api.Controllers
|
|
|
temObj = new StaffStatisticsforLevel();
|
|
temObj = new StaffStatisticsforLevel();
|
|
|
temObj.StaffId = h.StaffId;
|
|
temObj.StaffId = h.StaffId;
|
|
|
temObj.GradeId = h.Staff.StaffGradeId.Value;
|
|
temObj.GradeId = h.Staff.StaffGradeId.Value;
|
|
|
- if (temObj.GradeId == 0)
|
|
|
|
|
- {
|
|
|
|
|
- System.Diagnostics.Debug.WriteLine("");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
temObj.CalMonthId = p.CalMonthId;
|
|
temObj.CalMonthId = p.CalMonthId;
|
|
|
temObj.Type = "涉外OA";
|
|
temObj.Type = "涉外OA";
|
|
|
retlist.Add(temObj);
|
|
retlist.Add(temObj);
|
|
@@ -3826,10 +3862,7 @@ namespace wispro.sp.api.Controllers
|
|
|
temObj = new StaffStatisticsforLevel();
|
|
temObj = new StaffStatisticsforLevel();
|
|
|
temObj.StaffId = reviewer.StaffId;
|
|
temObj.StaffId = reviewer.StaffId;
|
|
|
temObj.GradeId = reviewer.Staff.StaffGradeId.Value;
|
|
temObj.GradeId = reviewer.Staff.StaffGradeId.Value;
|
|
|
- if (temObj.GradeId == 0)
|
|
|
|
|
- {
|
|
|
|
|
- System.Diagnostics.Debug.WriteLine("");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
temObj.CalMonthId = calMonthId;
|
|
temObj.CalMonthId = calMonthId;
|
|
|
temObj.Type = "涉外OA";
|
|
temObj.Type = "涉外OA";
|
|
|
temObj.isReview = true;
|
|
temObj.isReview = true;
|