|
@@ -213,7 +213,7 @@ namespace wispro.sp.api.Controllers
|
|
string[] values = new string[] { null };
|
|
string[] values = new string[] { null };
|
|
if (!string.IsNullOrEmpty(value))
|
|
if (!string.IsNullOrEmpty(value))
|
|
{
|
|
{
|
|
- values = value.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
|
|
|
|
|
|
+ values = value.Split(new char[] { '|' });
|
|
}
|
|
}
|
|
|
|
|
|
if (fields.Length != values.Length) {
|
|
if (fields.Length != values.Length) {
|
|
@@ -250,9 +250,10 @@ namespace wispro.sp.api.Controllers
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- ret.Success = false;
|
|
|
|
- ret.ErrorMessage = "所给的栏位值不能转换成数字!";
|
|
|
|
- return ret;
|
|
|
|
|
|
+ item.WordCount = null;
|
|
|
|
+ //ret.Success = false;
|
|
|
|
+ //ret.ErrorMessage = "所给的栏位值不能转换成数字!";
|
|
|
|
+ //return ret;
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case "ReturnCasseNo":
|
|
case "ReturnCasseNo":
|
|
@@ -433,6 +434,11 @@ namespace wispro.sp.api.Controllers
|
|
{
|
|
{
|
|
string strCaseCeoffcient = item.CaseCoefficient;
|
|
string strCaseCeoffcient = item.CaseCoefficient;
|
|
|
|
|
|
|
|
+ if (string.IsNullOrEmpty(strCaseCeoffcient))
|
|
|
|
+ {
|
|
|
|
+ strCaseCeoffcient = "B";
|
|
|
|
+ }
|
|
|
|
+
|
|
#region 严重延期降系数
|
|
#region 严重延期降系数
|
|
if (item.isDanger() && string.IsNullOrEmpty(item.OverDueMemo))
|
|
if (item.isDanger() && string.IsNullOrEmpty(item.OverDueMemo))
|
|
{
|
|
{
|
|
@@ -471,6 +477,10 @@ namespace wispro.sp.api.Controllers
|
|
case "D":
|
|
case "D":
|
|
retObj.D += 1;
|
|
retObj.D += 1;
|
|
break;
|
|
break;
|
|
|
|
+ default:
|
|
|
|
+ retObj.B += 1;
|
|
|
|
+ break;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
if (CaseXiShu.ContainsKey(strCaseCeoffcient))
|
|
if (CaseXiShu.ContainsKey(strCaseCeoffcient))
|
|
@@ -657,6 +667,9 @@ namespace wispro.sp.api.Controllers
|
|
new Job.UpdateJXDataFromIPEasyJob().UpdateFromIPEasy(Item, Context);
|
|
new Job.UpdateJXDataFromIPEasyJob().UpdateFromIPEasy(Item, Context);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ Utility.Utility.CalBasePoint(Item, Context.BasePointRules.ToList());
|
|
|
|
+ Context.SaveChanges();
|
|
|
|
+
|
|
return new ApiSaveResponse()
|
|
return new ApiSaveResponse()
|
|
{
|
|
{
|
|
Success = true
|
|
Success = true
|
|
@@ -699,8 +712,40 @@ namespace wispro.sp.api.Controllers
|
|
};
|
|
};
|
|
}
|
|
}
|
|
|
|
|
|
- private void Export2ExcelThread()
|
|
|
|
|
|
+ public FileProcessTask CurrentData2Excel()
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ CalMonth calMonth = Context.CalMonths.FirstOrDefault(c => c.Status == 0);
|
|
|
|
+ if (calMonth != null)
|
|
|
|
+ {
|
|
|
|
+ var filename = $"{DateTime.Now.ToString("yyyyMMddhhmmss")}-{calMonth.Year}{calMonth.Month}线下绩效核算数据.xlsx";
|
|
|
|
+ var attachfileSavePath = utility.ConfigHelper.GetSectionValue("AttachFileSavePath");
|
|
|
|
+ var filePath = Path.Combine(attachfileSavePath, filename);
|
|
|
|
+
|
|
|
|
+ var fileTask = new FileProcessTask()
|
|
|
|
+ {
|
|
|
|
+ Id = Guid.NewGuid().ToString(),
|
|
|
|
+ FileName = filename,
|
|
|
|
+ FilePath = filePath,
|
|
|
|
+ Processed = 0
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ fileTaskService.Add(fileTask);
|
|
|
|
+
|
|
|
|
+ System.Threading.Thread t = new System.Threading.Thread(new ParameterizedThreadStart(Export2ExcelThread));
|
|
|
|
+ t.Start(fileTask);
|
|
|
|
+
|
|
|
|
+ return fileTask;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return null;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void Export2ExcelThread(object attfile)
|
|
{
|
|
{
|
|
|
|
+ FileProcessTask file = (FileProcessTask)attfile;
|
|
|
|
+
|
|
spDbContext spDb = new spDbContext();
|
|
spDbContext spDb = new spDbContext();
|
|
List<PerformanceItem> items = spDb.PerformanceItems
|
|
List<PerformanceItem> items = spDb.PerformanceItems
|
|
.Include(p => p.Reviewer).ThenInclude(p => p.StaffGrade)
|
|
.Include(p => p.Reviewer).ThenInclude(p => p.StaffGrade)
|
|
@@ -754,8 +799,43 @@ namespace wispro.sp.api.Controllers
|
|
var verifyCeoffients = spDb.VerifyCoefficients.ToList();
|
|
var verifyCeoffients = spDb.VerifyCoefficients.ToList();
|
|
var Rules = spDb.BasePointRules.ToList();
|
|
var Rules = spDb.BasePointRules.ToList();
|
|
|
|
|
|
|
|
+ file.Size = items.Count;
|
|
foreach(var p in items)
|
|
foreach(var p in items)
|
|
{
|
|
{
|
|
|
|
+
|
|
|
|
+ System.Diagnostics.Debug.WriteLine(p.CaseNo);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ List<ItemStaff> temItemStaffs = p.ItemStaffs.ToList();
|
|
|
|
+
|
|
|
|
+ string strCaseMemo = "";
|
|
|
|
+ if (p.ItemStaffs.Count > 1)
|
|
|
|
+ {
|
|
|
|
+ temItemStaffs = new List<ItemStaff>();
|
|
|
|
+ foreach (var iStaff in p.ItemStaffs)
|
|
|
|
+ {
|
|
|
|
+ if (iStaff.DoPerson.Status != "试用期")
|
|
|
|
+ {
|
|
|
|
+ temItemStaffs.Add(iStaff);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ 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);
|
|
Utility.Utility.CalBasePoint(p, Rules);
|
|
var jxList = _calItemJX(p.CalMonth, verifyCeoffients, p, spDb);
|
|
var jxList = _calItemJX(p.CalMonth, verifyCeoffients, p, spDb);
|
|
|
|
|
|
@@ -765,33 +845,45 @@ namespace wispro.sp.api.Controllers
|
|
{
|
|
{
|
|
isReviewerInDopersons = (p.ItemStaffs.Where(i => i.DoPersonId == p.ReviewerId).Count() > 0);
|
|
isReviewerInDopersons = (p.ItemStaffs.Where(i => i.DoPersonId == p.ReviewerId).Count() > 0);
|
|
}
|
|
}
|
|
-
|
|
|
|
- double total = p.ItemStaffs.Count();
|
|
|
|
- if (p.ItemStaffs.Where<ItemStaff>(p => p.PerformancePoint != null || p.PerformancePoint == 0).Count() > 0)
|
|
|
|
|
|
+
|
|
|
|
+ double total = temItemStaffs.Count();
|
|
|
|
+ if (temItemStaffs.Where<ItemStaff>(p => p.PerformancePoint != null || p.PerformancePoint == 0).Count() > 0)
|
|
{
|
|
{
|
|
- total = p.ItemStaffs.Select(i => i.PerformancePoint.Value).Sum();
|
|
|
|
|
|
+ total = temItemStaffs.Select(i => i.PerformancePoint.Value).Sum();
|
|
isPJFP = false;
|
|
isPJFP = false;
|
|
}
|
|
}
|
|
|
|
|
|
- foreach (var iStaff in p.ItemStaffs)
|
|
|
|
|
|
+ foreach (var iStaff in temItemStaffs)
|
|
{
|
|
{
|
|
DataRow row = dt.NewRow();
|
|
DataRow row = dt.NewRow();
|
|
row["我方文号"] = p.CaseNo;
|
|
row["我方文号"] = p.CaseNo;
|
|
row["申请类型"] = p.ApplicationType;
|
|
row["申请类型"] = p.ApplicationType;
|
|
|
|
|
|
- if(p.Customer.Name.Contains("OPPO") && p.ApplicationType == "实用新型")
|
|
|
|
|
|
+ if(p.ApplicationName != null && p.ApplicationName.Contains("OPPO") && p.ApplicationType == "实用新型")
|
|
{
|
|
{
|
|
row["申请类型"] = "发明";
|
|
row["申请类型"] = "发明";
|
|
row["案件备注"] = $"{row["案件备注"]}\r\nOPPO案件实用新型修改为发明】";
|
|
row["案件备注"] = $"{row["案件备注"]}\r\nOPPO案件实用新型修改为发明】";
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ row["处理事项"] = p.DoItem;
|
|
row["业务类型"] = p.BusinessType;
|
|
row["业务类型"] = p.BusinessType;
|
|
row["备注(填表注意事项)"] = p.AgentFeedbackMemo;
|
|
row["备注(填表注意事项)"] = p.AgentFeedbackMemo;
|
|
- row["处理事项"] = p.DoItem;
|
|
|
|
|
|
+
|
|
|
|
+ if(p.Type == "专案")
|
|
|
|
+ {
|
|
|
|
+ row["备注(填表注意事项)"] = $"{row["备注(填表注意事项)"]}【主管给定点数】专案";
|
|
|
|
+ row["处理事项"] = "提出报告";
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(temItemStaffs.Count > 1)
|
|
|
|
+ {
|
|
|
|
+ row["备注(填表注意事项)"] = $"{row["备注(填表注意事项)"]},{temDoPerson}合写";
|
|
|
|
+ }
|
|
|
|
+
|
|
row["案件阶段"] = p.CaseStage;
|
|
row["案件阶段"] = p.CaseStage;
|
|
|
|
|
|
row["案件系数"] = p.CaseCoefficient;
|
|
row["案件系数"] = p.CaseCoefficient;
|
|
- if(p.isDanger() && string.IsNullOrEmpty(p.OverDueMemo))
|
|
|
|
|
|
+ if(p.isDanger() && string.IsNullOrEmpty(p.OverDueMemo) && p.Type =="新申请")
|
|
{
|
|
{
|
|
switch (p.CaseCoefficient)
|
|
switch (p.CaseCoefficient)
|
|
{
|
|
{
|
|
@@ -814,53 +906,88 @@ 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;
|
|
|
|
|
|
if(iStaff.DoPerson.Status == "试用期")
|
|
if(iStaff.DoPerson.Status == "试用期")
|
|
{
|
|
{
|
|
row["实际处理人"] = iStaff.DoPerson.Name;
|
|
row["实际处理人"] = iStaff.DoPerson.Name;
|
|
row["案件备注"] = $"{row["案件备注"]}\r\n处理人{iStaff.DoPerson.Name}未转正";
|
|
row["案件备注"] = $"{row["案件备注"]}\r\n处理人{iStaff.DoPerson.Name}未转正";
|
|
- row["处理人"] = p.Reviewer.Name;
|
|
|
|
- row["处理人等级"] = p.Reviewer.StaffGrade.Grade;
|
|
|
|
|
|
+ row["处理人"] = p.Reviewer?.Name;
|
|
|
|
+ row["处理人等级"] = p.Reviewer?.StaffGrade?.Grade;
|
|
row["基本点数"] = (p.BasePoint / total).ToString();
|
|
row["基本点数"] = (p.BasePoint / 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["核稿系数"] = "";
|
|
row["核稿绩效"] = "";
|
|
row["核稿绩效"] = "";
|
|
- row["处理人绩效系数"] = p.Reviewer.StaffGrade.Coefficient;
|
|
|
|
- row["系统核算绩效"] = "";
|
|
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
row["处理人"] = iStaff.DoPerson.Name;
|
|
row["处理人"] = iStaff.DoPerson.Name;
|
|
- row["处理人等级"] = iStaff.DoPerson.StaffGrade.Grade;
|
|
|
|
|
|
+ row["处理人等级"] = iStaff.DoPerson.StaffGrade?.Grade;
|
|
row["基本点数"] = (p.BasePoint / total).ToString();
|
|
row["基本点数"] = (p.BasePoint / total).ToString();
|
|
- row["处理人绩效系数"] = iStaff.DoPerson.StaffGrade.Coefficient;
|
|
|
|
- row["系统核算绩效"] = "";
|
|
|
|
|
|
+ row["处理人绩效系数"] = iStaff.DoPerson.StaffGrade?.Coefficient;
|
|
|
|
+
|
|
|
|
|
|
if (isReviewerInDopersons)
|
|
if (isReviewerInDopersons)
|
|
{
|
|
{
|
|
row["核稿人"] = "";
|
|
row["核稿人"] = "";
|
|
row["核稿系数"] = "";
|
|
row["核稿系数"] = "";
|
|
row["核稿绩效"] = "";
|
|
row["核稿绩效"] = "";
|
|
- row["处理人绩效系数"] = "";
|
|
|
|
- row["系统核算绩效"] = "";
|
|
|
|
|
|
+
|
|
|
|
+
|
|
row["案件备注"] = $"{row["案件备注"]}\r\n核稿人与处理人一致,置空核稿人栏位";
|
|
row["案件备注"] = $"{row["案件备注"]}\r\n核稿人与处理人一致,置空核稿人栏位";
|
|
|
|
+
|
|
|
|
+ var clrJX = jxList.Where(j => j.StaffId == p.ReviewerId && j.jxType.Contains("处理")).FirstOrDefault();
|
|
|
|
+ if (clrJX != null)
|
|
|
|
+ {
|
|
|
|
+ row["系统核算绩效"] = clrJX.totalBasePoint;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- row["核稿人"] = p.Reviewer?.Name;
|
|
|
|
- var vCoefficient = Context.VerifyCoefficients.FirstOrDefault(c => c.CheckerId == p.ReviewerId && c.DoPersonId == iStaff.DoPersonId);
|
|
|
|
- if (vCoefficient != null)
|
|
|
|
|
|
+ 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["核稿系数"] = vCoefficient.Coefficient;
|
|
|
|
- row["核稿绩效"] = (p.BasePoint / total) * vCoefficient.Coefficient;
|
|
|
|
|
|
+ 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");
|
|
row["定稿日"] = p.FinalizationDate?.ToString("yyyy-MM-dd");
|
|
row["定稿日"] = p.FinalizationDate?.ToString("yyyy-MM-dd");
|
|
@@ -876,13 +1003,21 @@ namespace wispro.sp.api.Controllers
|
|
row["初稿日"] = p.FirstDraftDate?.ToString("yyyy-MM-dd");
|
|
row["初稿日"] = p.FirstDraftDate?.ToString("yyyy-MM-dd");
|
|
row["备注(发文严重超期是否属客观原因,若为否,请填写原因"] = p.OverDueMemo;
|
|
row["备注(发文严重超期是否属客观原因,若为否,请填写原因"] = p.OverDueMemo;
|
|
row["绩效类型"] = p.Type;
|
|
row["绩效类型"] = p.Type;
|
|
- row["案件备注"] = p.CaseMemo;
|
|
|
|
|
|
+ row["案件备注"] = $"{p.CaseMemo}\r\n{row["案件备注"]}";
|
|
|
|
+ if(!string.IsNullOrEmpty(strCaseMemo))
|
|
|
|
+ {
|
|
|
|
+ row["案件备注"] = $"{strCaseMemo}\r\n{row["案件备注"]}";
|
|
|
|
+ }
|
|
|
|
|
|
dt.Rows.Add(row);
|
|
dt.Rows.Add(row);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ file.Processed += 1;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
- NPOIExcel.DataTableToExcel(dt,$"c:\\temp\\{DateTime.Now.ToString("yyyyMMddhhmmss")}-线下绩效核算数据.xlsx");
|
|
|
|
|
|
+ NPOIExcel.DataTableToExcel(dt, file.FilePath);
|
|
|
|
+ file.Finished = true;
|
|
}
|
|
}
|
|
|
|
|
|
private void _CompareExcel2DB()
|
|
private void _CompareExcel2DB()
|
|
@@ -1375,13 +1510,7 @@ namespace wispro.sp.api.Controllers
|
|
|
|
|
|
System.Collections.Hashtable doPersonsBL = new System.Collections.Hashtable();
|
|
System.Collections.Hashtable doPersonsBL = new System.Collections.Hashtable();
|
|
|
|
|
|
- bool isPJFP = true;
|
|
|
|
- double total = item.ItemStaffs.Count();
|
|
|
|
- if (item.ItemStaffs.Where<ItemStaff>(p => p.PerformancePoint != null || p.PerformancePoint == 0).Count() > 0)
|
|
|
|
- {
|
|
|
|
- total = item.ItemStaffs.Select(i => i.PerformancePoint.Value).Sum();
|
|
|
|
- isPJFP = false;
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
|
|
List<StaffStatistics> itemStatistics = new List<StaffStatistics>();
|
|
List<StaffStatistics> itemStatistics = new List<StaffStatistics>();
|
|
|
|
|
|
@@ -1391,7 +1520,29 @@ namespace wispro.sp.api.Controllers
|
|
//spDb.Entry(item.Reviewer).Reference(b => b.StaffGrade).Load();
|
|
//spDb.Entry(item.Reviewer).Reference(b => b.StaffGrade).Load();
|
|
}
|
|
}
|
|
|
|
|
|
- foreach (ItemStaff itemStaff in item.ItemStaffs)
|
|
|
|
|
|
+ List<ItemStaff> temIStaffs = new List<ItemStaff>();
|
|
|
|
+ foreach(var itemStaff in item.ItemStaffs)
|
|
|
|
+ {
|
|
|
|
+ if (itemStaff.DoPerson == null)
|
|
|
|
+ {
|
|
|
|
+ itemStaff.DoPerson = spDb.Staffs.Include(s => s.StaffGrade).FirstOrDefault(p => p.Id == itemStaff.DoPersonId);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(itemStaff.DoPerson.Status != "试用期")
|
|
|
|
+ {
|
|
|
|
+ temIStaffs.Add(itemStaff);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ bool isPJFP = true;
|
|
|
|
+ double total = temIStaffs.Count();
|
|
|
|
+ if (temIStaffs.Where<ItemStaff>(p => p.PerformancePoint != null || p.PerformancePoint == 0).Count() > 0)
|
|
|
|
+ {
|
|
|
|
+ total = temIStaffs.Select(i => i.PerformancePoint.Value).Sum();
|
|
|
|
+ isPJFP = false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ foreach (ItemStaff itemStaff in temIStaffs)
|
|
{
|
|
{
|
|
if(itemStaff.DoPerson == null)
|
|
if(itemStaff.DoPerson == null)
|
|
{
|
|
{
|
|
@@ -1473,7 +1624,15 @@ namespace wispro.sp.api.Controllers
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- handlerBasePoint = itemStaff.PerformancePoint.Value;
|
|
|
|
|
|
+ if(item.ItemStaffs.Count ==1 && itemStaff .PerformancePoint == 0)
|
|
|
|
+ {
|
|
|
|
+ handlerBasePoint = item.BasePoint.Value;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ handlerBasePoint = itemStaff.PerformancePoint.Value;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1481,7 +1640,7 @@ namespace wispro.sp.api.Controllers
|
|
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 == calMonth.Id).FirstOrDefault();
|
|
if (temStatic != null)
|
|
if (temStatic != null)
|
|
{
|
|
{
|
|
- if (item.Type != "专案")
|
|
|
|
|
|
+ if (item.Type == "OA" || item.Type =="新申请")
|
|
{
|
|
{
|
|
temStatic.totalBasePoint += handlerBasePoint * itemStaff.DoPerson.StaffGrade.Coefficient;
|
|
temStatic.totalBasePoint += handlerBasePoint * itemStaff.DoPerson.StaffGrade.Coefficient;
|
|
}
|
|
}
|
|
@@ -1494,7 +1653,7 @@ namespace wispro.sp.api.Controllers
|
|
{
|
|
{
|
|
if (itemStaff.DoPerson.StaffGradeId != null && itemStaff.DoPerson.IsOnJob)
|
|
if (itemStaff.DoPerson.StaffGradeId != null && itemStaff.DoPerson.IsOnJob)
|
|
{
|
|
{
|
|
- if (item.Type != "专案")
|
|
|
|
|
|
+ if (item.Type == "OA" || item.Type == "新申请")
|
|
{
|
|
{
|
|
if (itemStaff.DoPerson.Status == "试用期" && item.Reviewer != null)
|
|
if (itemStaff.DoPerson.Status == "试用期" && item.Reviewer != null)
|
|
{
|
|
{
|
|
@@ -2123,19 +2282,178 @@ namespace wispro.sp.api.Controllers
|
|
return retObj;
|
|
return retObj;
|
|
}
|
|
}
|
|
|
|
|
|
- public PerformanceItem GetItemInfoByCaseStage(string CaseNo, string DoItem,string caseStage)
|
|
|
|
|
|
+ public PerformanceItem GetItemInfoByCaseStage(string CaseNo, string DoItem,string caseStage,bool UpdateFromIPEasy=true)
|
|
{
|
|
{
|
|
var retObj = Context.PerformanceItems.Include(p=>p.Customer).FirstOrDefault<PerformanceItem>(p => p.CaseNo == CaseNo.Trim()
|
|
var retObj = Context.PerformanceItems.Include(p=>p.Customer).FirstOrDefault<PerformanceItem>(p => p.CaseNo == CaseNo.Trim()
|
|
&& p.DoItem == DoItem.Trim() && p.CaseStage == caseStage);
|
|
&& p.DoItem == DoItem.Trim() && p.CaseStage == caseStage);
|
|
|
|
|
|
- if (retObj == null)
|
|
|
|
|
|
+ if (retObj == null && UpdateFromIPEasy)
|
|
{
|
|
{
|
|
- retObj = IPEasyUtility.GetPerformanceRecord(CaseNo, DoItem, caseStage);
|
|
|
|
|
|
+ var temObj = IPEasyUtility.GetPerformanceRecord(CaseNo, DoItem, caseStage);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ System.Dynamic.ExpandoObject temExpandoObject = (System.Dynamic.ExpandoObject)temObj;
|
|
|
|
+
|
|
|
|
+ retObj = new PerformanceItem();
|
|
|
|
+ retObj.CaseNo = temObj.CaseNo.ToString();
|
|
|
|
+ retObj.CaseName = temObj.CaseName.ToString();
|
|
|
|
+
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ if (temObj.ApplicationType != null)
|
|
|
|
+ retObj.ApplicationType = temObj.ApplicationType.ToString();
|
|
|
|
+
|
|
|
|
+ if (temObj.CaseMemo != null)
|
|
|
|
+ retObj.CaseMemo = temObj.CaseMemo.ToString();
|
|
|
|
+
|
|
|
|
+ if (temObj.BusinessType != null)
|
|
|
|
+ retObj.BusinessType = temObj.BusinessType.ToString();
|
|
|
|
+
|
|
|
|
+ if (temObj.DoItem != null)
|
|
|
|
+ retObj.DoItem = temObj.DoItem.ToString();
|
|
|
|
+
|
|
|
|
+ if (temObj.CaseStage != null)
|
|
|
|
+ retObj.CaseStage = temObj.CaseStage.ToString();
|
|
|
|
+
|
|
|
|
+ if (temObj.CaseType != null)
|
|
|
|
+ retObj.CaseType = temObj.CaseType.ToString();
|
|
|
|
+
|
|
|
|
+ if (temObj.DoItemState != null)
|
|
|
|
+ retObj.DoItemState = temObj.DoItemState.ToString();
|
|
|
|
+
|
|
|
|
+ if (temObj.DoItemCoefficient != null)
|
|
|
|
+ retObj.DoItemCoefficient = temObj.DoItemCoefficient.ToString();
|
|
|
|
+
|
|
|
|
+ if (temObj.CaseCoefficient != null)
|
|
|
|
+ retObj.CaseCoefficient = temObj.CaseCoefficient.ToString();
|
|
|
|
+
|
|
|
|
+ if (temObj.EntrustingDate != null)
|
|
|
|
+ {
|
|
|
|
+ if (!string.IsNullOrEmpty(temObj.EntrustingDate.ToString()))
|
|
|
|
+ retObj.EntrustingDate = DateTime.Parse(temObj.EntrustingDate.ToString());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if (temObj.InternalDate != null)
|
|
|
|
+ {
|
|
|
|
+ if (!string.IsNullOrEmpty(temObj.InternalDate.ToString()))
|
|
|
|
+ retObj.InternalDate = DateTime.Parse(temObj.InternalDate.ToString());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (temObj.CustomerLimitDate != null)
|
|
|
|
+ {
|
|
|
|
+ if (!string.IsNullOrEmpty(temObj.InternalDate.ToString()))
|
|
|
|
+ retObj.CustomerLimitDate = DateTime.Parse(temObj.InternalDate.ToString());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if (temObj.ReturnDate != null)
|
|
|
|
+ {
|
|
|
|
+ if (!string.IsNullOrEmpty(temObj.ReturnDate.ToString()))
|
|
|
|
+ retObj.ReturnDate = DateTime.Parse(temObj.ReturnDate.ToString());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (temObj.FinalizationDate != null)
|
|
|
|
+ {
|
|
|
|
+ if (!string.IsNullOrEmpty(temObj.FinalizationDate.ToString()))
|
|
|
|
+ retObj.FinalizationDate = DateTime.Parse(temObj.FinalizationDate.ToString());
|
|
|
|
+ }
|
|
|
|
+ if (temObj.FinishedDate != null)
|
|
|
|
+ {
|
|
|
|
+ if (!string.IsNullOrEmpty(temObj.FinishedDate.ToString()))
|
|
|
|
+ retObj.FinishedDate = DateTime.Parse(temObj.FinishedDate.ToString());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ catch { }
|
|
|
|
+
|
|
|
|
+ int temWordCount;
|
|
|
|
+
|
|
|
|
+ if (temObj.WordCount != null)
|
|
|
|
+ {
|
|
|
|
+ if (int.TryParse(temObj.WordCount, out temWordCount))
|
|
|
|
+ {
|
|
|
|
+ retObj.WordCount = temWordCount;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ if (temObj.CustomerName != null)
|
|
|
|
+ {
|
|
|
|
+ string strCustomer = temObj.CustomerName.ToString();
|
|
|
|
+ retObj.Customer = new Customer() { Name = strCustomer };
|
|
|
|
+ var temCustomer = Context.Customers.Where(c => c.Name == strCustomer.Trim()).FirstOrDefault();
|
|
|
|
+ if (temCustomer != null)
|
|
|
|
+ {
|
|
|
|
+ retObj.CustomerId = temCustomer.Id;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ catch { }
|
|
|
|
+
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ if (temObj.Reviewer != null)
|
|
|
|
+ {
|
|
|
|
+ string strReViewer = temObj.Reviewer.ToString();
|
|
|
|
+ var temReviewer = Context.Staffs.Where(s => s.Name == strReViewer.Trim()).FirstOrDefault();
|
|
|
|
+ if (temReviewer != null)
|
|
|
|
+ {
|
|
|
|
+ retObj.ReviewerId = temReviewer.Id;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ catch { }
|
|
|
|
+
|
|
|
|
+ if (temObj.DoPersons != null)
|
|
|
|
+ {
|
|
|
|
+ string DoPersons = temObj.DoPersons.ToString();
|
|
|
|
+
|
|
|
|
+ string[] Persons = DoPersons.Split(new char[] { ',' });
|
|
|
|
+ List<ItemStaff> itemStaffs = new List<ItemStaff>();
|
|
|
|
+ foreach (var doPerson in Persons)
|
|
|
|
+ {
|
|
|
|
+ itemStaffs.Add(new ItemStaff() { DoPerson = new Staff() { Name = doPerson } });
|
|
|
|
+ }
|
|
|
|
+ retObj.ItemStaffs = itemStaffs;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
return retObj;
|
|
return retObj;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public PerformanceItem GetItemInfoByMonthId(string CaseNo, string DoItem, string caseStage,int calMonthId)
|
|
|
|
+ {
|
|
|
|
+ var retObj = Context.PerformanceItems.Include(p => p.Customer).FirstOrDefault<PerformanceItem>(p => p.CaseNo == CaseNo.Trim()
|
|
|
|
+ && p.DoItem == DoItem.Trim() && p.CalMonthId == calMonthId);
|
|
|
|
+
|
|
|
|
+ if(retObj != null)
|
|
|
|
+ {
|
|
|
|
+ if(string.IsNullOrEmpty (retObj.CaseStage) && string.IsNullOrEmpty(caseStage))
|
|
|
|
+ {
|
|
|
|
+ return retObj;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ if(retObj.CaseStage == caseStage)
|
|
|
|
+ {
|
|
|
|
+ return retObj;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
public bool MovePerformance2ProjectInfo()
|
|
public bool MovePerformance2ProjectInfo()
|
|
{
|
|
{
|
|
var response = Context.PerformanceItems.Include(p=>p.ItemStaffs)
|
|
var response = Context.PerformanceItems.Include(p=>p.ItemStaffs)
|