|
@@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.StaticFiles;
|
|
using Microsoft.AspNetCore.StaticFiles;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
+using Microsoft.Extensions.Caching.Memory;
|
|
using Microsoft.Extensions.Hosting;
|
|
using Microsoft.Extensions.Hosting;
|
|
using System;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
@@ -28,6 +29,8 @@ namespace wispro.sp.api.Controllers
|
|
{
|
|
{
|
|
spDbContext Context;
|
|
spDbContext Context;
|
|
IFileTaskService fileTaskService;
|
|
IFileTaskService fileTaskService;
|
|
|
|
+
|
|
|
|
+
|
|
public PerformanceItemController(spDbContext context, IFileTaskService _fileTaskService)
|
|
public PerformanceItemController(spDbContext context, IFileTaskService _fileTaskService)
|
|
{
|
|
{
|
|
Context = context;
|
|
Context = context;
|
|
@@ -187,7 +190,7 @@ namespace wispro.sp.api.Controllers
|
|
ApiSaveResponse ret = new ApiSaveResponse();
|
|
ApiSaveResponse ret = new ApiSaveResponse();
|
|
ret.Success = true;
|
|
ret.Success = true;
|
|
|
|
|
|
- var item = Context.PerformanceItems.FirstOrDefault<PerformanceItem>(p => p.Id == id);
|
|
|
|
|
|
+ var item = Context.PerformanceItems.Include(p=>p.Customer).FirstOrDefault<PerformanceItem>(p => p.Id == id);
|
|
|
|
|
|
if (item == null)
|
|
if (item == null)
|
|
{
|
|
{
|
|
@@ -397,84 +400,104 @@ namespace wispro.sp.api.Controllers
|
|
|
|
|
|
public double DegreeOfDifficulty(int year,int month, int? userId = null)
|
|
public double DegreeOfDifficulty(int year,int month, int? userId = null)
|
|
{
|
|
{
|
|
- IDictionary<string, double> CaseXiShu = new Dictionary<string, double>();
|
|
|
|
- var list = Context.CaseCeoffcients;
|
|
|
|
-
|
|
|
|
- foreach(var cx in list.ToList<CaseCeoffcient>())
|
|
|
|
|
|
+ string strKey = $"DegreeOfDifficulty:{year}-{month}-{userId}";
|
|
|
|
+ object cacheEntry;
|
|
|
|
+ if (!MyMemoryCache.TryGetValue(strKey, out cacheEntry))
|
|
{
|
|
{
|
|
- CaseXiShu.Add(cx.Ceoffcient, cx.Value);
|
|
|
|
- }
|
|
|
|
|
|
|
|
- var results = Context.PerformanceItems.Where<PerformanceItem>(p => p.CalMonth.Year == year && p.CalMonth.Month == month && ((p.Type == "新申请" && p.BasePoint > 0) || p.Type == "专案") && p.BasePoint > 0.0);
|
|
|
|
|
|
+ IDictionary<string, double> CaseXiShu = new Dictionary<string, double>();
|
|
|
|
+ var list = Context.CaseCeoffcients;
|
|
|
|
|
|
- if(userId != null)
|
|
|
|
- {
|
|
|
|
- results = Context.PerformanceItems.Where<PerformanceItem>(p =>
|
|
|
|
- p.CalMonth.Year == year && p.CalMonth.Month == month && ((p.Type == "新申请" && p.BasePoint >0) || p.Type == "专案") &&
|
|
|
|
- (p.ItemStaffs.Where<ItemStaff>(s=>s.DoPerson.Id == userId).Count ()>0 ) && p.BasePoint >0.0);
|
|
|
|
- }
|
|
|
|
|
|
+ foreach (var cx in list.ToList<CaseCeoffcient>())
|
|
|
|
+ {
|
|
|
|
+ CaseXiShu.Add(cx.Ceoffcient, cx.Value);
|
|
|
|
+ }
|
|
|
|
|
|
- #region 循环计算
|
|
|
|
- int iCount = 0;
|
|
|
|
- double d = 0.0;
|
|
|
|
- var retList = results.ToList();
|
|
|
|
|
|
+ var results = Context.PerformanceItems.Where<PerformanceItem>(p => p.CalMonth.Year == year && p.CalMonth.Month == month && ((p.Type == "新申请" && p.BasePoint > 0) || p.Type == "专案") && p.BasePoint > 0.0);
|
|
|
|
|
|
- foreach(var item in retList)
|
|
|
|
- {
|
|
|
|
- string strCaseCeoffcient = item.CaseCoefficient;
|
|
|
|
|
|
+ if (userId != null)
|
|
|
|
+ {
|
|
|
|
+ results = Context.PerformanceItems.Where<PerformanceItem>(p =>
|
|
|
|
+ p.CalMonth.Year == year && p.CalMonth.Month == month && ((p.Type == "新申请" && p.BasePoint > 0) || p.Type == "专案") &&
|
|
|
|
+ (p.ItemStaffs.Where<ItemStaff>(s => s.DoPerson.Id == userId).Count() > 0 || p.ReviewerId == userId ) && p.BasePoint > 0.0);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ #region 循环计算
|
|
|
|
+ int iCount = 0;
|
|
|
|
+ double d = 0.0;
|
|
|
|
+ var retList = results.ToList();
|
|
|
|
|
|
- if(item.isDanger() && string.IsNullOrEmpty(item.OverDueMemo))
|
|
|
|
|
|
+ foreach (var item in retList)
|
|
{
|
|
{
|
|
- switch (item.CaseCoefficient)
|
|
|
|
|
|
+ string strCaseCeoffcient = item.CaseCoefficient;
|
|
|
|
+
|
|
|
|
+ #region 严重延期降系数
|
|
|
|
+ if (item.isDanger() && string.IsNullOrEmpty(item.OverDueMemo))
|
|
{
|
|
{
|
|
- case "S":
|
|
|
|
- strCaseCeoffcient = "A";
|
|
|
|
- break;
|
|
|
|
- case "A":
|
|
|
|
- strCaseCeoffcient = "B";
|
|
|
|
- break;
|
|
|
|
- case "B":
|
|
|
|
- strCaseCeoffcient = "C";
|
|
|
|
- break;
|
|
|
|
- case "C":
|
|
|
|
- strCaseCeoffcient = "D";
|
|
|
|
- break;
|
|
|
|
|
|
+ switch (item.CaseCoefficient)
|
|
|
|
+ {
|
|
|
|
+ case "S":
|
|
|
|
+ strCaseCeoffcient = "A";
|
|
|
|
+ break;
|
|
|
|
+ case "A":
|
|
|
|
+ strCaseCeoffcient = "B";
|
|
|
|
+ break;
|
|
|
|
+ case "B":
|
|
|
|
+ strCaseCeoffcient = "C";
|
|
|
|
+ break;
|
|
|
|
+ case "C":
|
|
|
|
+ strCaseCeoffcient = "D";
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ #endregion
|
|
|
|
+
|
|
|
|
+ if (CaseXiShu.ContainsKey(strCaseCeoffcient))
|
|
|
|
+ {
|
|
|
|
+ d += CaseXiShu[strCaseCeoffcient];
|
|
|
|
+ iCount += 1;
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
|
|
- if (CaseXiShu.ContainsKey(strCaseCeoffcient))
|
|
|
|
- {
|
|
|
|
- d += CaseXiShu[strCaseCeoffcient];
|
|
|
|
- iCount += 1;
|
|
|
|
}
|
|
}
|
|
|
|
+ #endregion
|
|
|
|
|
|
- }
|
|
|
|
- #endregion
|
|
|
|
|
|
+ #region 统计计算
|
|
|
|
+ //var groupResult = results.GroupBy(x => x.CaseCoefficient).Select(g=> new {
|
|
|
|
+ // CaseCeoffcient = g.Key,
|
|
|
|
+ // count = g.Count()
|
|
|
|
+ //});
|
|
|
|
|
|
- #region 统计计算
|
|
|
|
- //var groupResult = results.GroupBy(x => x.CaseCoefficient).Select(g=> new {
|
|
|
|
- // CaseCeoffcient = g.Key,
|
|
|
|
- // count = g.Count()
|
|
|
|
- //});
|
|
|
|
|
|
+ //int iCount = 0;
|
|
|
|
+ //double d = 0.0;
|
|
|
|
+ //foreach(var g in groupResult)
|
|
|
|
+ //{
|
|
|
|
+ // if (!string.IsNullOrEmpty(g.CaseCeoffcient))
|
|
|
|
+ // {
|
|
|
|
|
|
- //int iCount = 0;
|
|
|
|
- //double d = 0.0;
|
|
|
|
- //foreach(var g in groupResult)
|
|
|
|
- //{
|
|
|
|
- // if (!string.IsNullOrEmpty(g.CaseCeoffcient))
|
|
|
|
- // {
|
|
|
|
|
|
|
|
|
|
+ // if (CaseXiShu.ContainsKey(g.CaseCeoffcient))
|
|
|
|
+ // {
|
|
|
|
+ // d += g.count * CaseXiShu[g.CaseCeoffcient];
|
|
|
|
+ // iCount += g.count;
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
|
|
+ #endregion
|
|
|
|
+
|
|
|
|
+ cacheEntry = d / (double)iCount;
|
|
|
|
|
|
- // if (CaseXiShu.ContainsKey(g.CaseCeoffcient))
|
|
|
|
- // {
|
|
|
|
- // d += g.count * CaseXiShu[g.CaseCeoffcient];
|
|
|
|
- // iCount += g.count;
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- //}
|
|
|
|
- #endregion
|
|
|
|
|
|
+ // Set cache options.
|
|
|
|
+
|
|
|
|
+ // Save data in cache.
|
|
|
|
+ MyMemoryCache.SetValue(strKey, cacheEntry);
|
|
|
|
|
|
- return d /(double)iCount;
|
|
|
|
|
|
+
|
|
|
|
+ return (double)cacheEntry;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ return (double)cacheEntry;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public List<string> GetFeedbackString(int itemId)
|
|
public List<string> GetFeedbackString(int itemId)
|
|
@@ -491,6 +514,7 @@ namespace wispro.sp.api.Controllers
|
|
private List<StaffStatistics> _CalMyStatistics(CalMonth calMonth, int? userid = null)
|
|
private List<StaffStatistics> _CalMyStatistics(CalMonth calMonth, int? userid = null)
|
|
{
|
|
{
|
|
|
|
|
|
|
|
+
|
|
double gspjXS = DegreeOfDifficulty(calMonth.Year, calMonth.Month);
|
|
double gspjXS = DegreeOfDifficulty(calMonth.Year, calMonth.Month);
|
|
|
|
|
|
//未归档,从绩效记录中统计数据
|
|
//未归档,从绩效记录中统计数据
|
|
@@ -621,7 +645,7 @@ namespace wispro.sp.api.Controllers
|
|
|
|
|
|
public ApiSaveResponse RefreshFromIPEasyById(int itemId)
|
|
public ApiSaveResponse RefreshFromIPEasyById(int itemId)
|
|
{
|
|
{
|
|
- var Item = Context.PerformanceItems.FirstOrDefault(p => p.Id == itemId);
|
|
|
|
|
|
+ var Item = Context.PerformanceItems.Include(p=>p.Customer).FirstOrDefault(p => p.Id == itemId);
|
|
if (Item != null)
|
|
if (Item != null)
|
|
{
|
|
{
|
|
new Job.UpdateJXDataFromIPEasyJob().UpdateFromIPEasy(Item, Context);
|
|
new Job.UpdateJXDataFromIPEasyJob().UpdateFromIPEasy(Item, Context);
|
|
@@ -632,9 +656,20 @@ namespace wispro.sp.api.Controllers
|
|
Success = true
|
|
Success = true
|
|
};
|
|
};
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public ApiSaveResponse RefreshFromIPEasy_Batch(int type)
|
|
|
|
+ {
|
|
|
|
+ new Job.UpdateJXDataFromIPEasyJob().RefreshFromIPEasy(type);
|
|
|
|
+
|
|
|
|
+ return new ApiSaveResponse()
|
|
|
|
+ {
|
|
|
|
+ Success = true
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+
|
|
public ApiSaveResponse RefreshFromIPEasy(string CaseNo,string DoItem,string caseStage)
|
|
public ApiSaveResponse RefreshFromIPEasy(string CaseNo,string DoItem,string caseStage)
|
|
{
|
|
{
|
|
- var Item = Context.PerformanceItems.FirstOrDefault(p=>p.CaseNo == CaseNo && p.DoItem == DoItem && p.CaseStage == caseStage);
|
|
|
|
|
|
+ var Item = Context.PerformanceItems.Include(p=>p.Customer).FirstOrDefault(p=>p.CaseNo == CaseNo && p.DoItem == DoItem && p.CaseStage == caseStage);
|
|
if(Item != null)
|
|
if(Item != null)
|
|
{
|
|
{
|
|
new Job.UpdateJXDataFromIPEasyJob().UpdateFromIPEasy(Item,Context);
|
|
new Job.UpdateJXDataFromIPEasyJob().UpdateFromIPEasy(Item,Context);
|
|
@@ -646,8 +681,501 @@ namespace wispro.sp.api.Controllers
|
|
};
|
|
};
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public ApiSaveResponse CompareExcel2DB()
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ System.Threading.Thread t = new Thread(new ThreadStart(_CompareExcel2DB));
|
|
|
|
+ t.Start();
|
|
|
|
+
|
|
|
|
+ return new ApiSaveResponse()
|
|
|
|
+ {
|
|
|
|
+ Success = true
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ private void _CompareExcel2DB()
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ DataTable excelDT = NPOIExcel.ExcelToDataTable("c:\\temp\\220112-工程师绩效总表-12月-v2F.xlsx", true, true, 0,2);
|
|
|
|
+ DataTable retTable = new DataTable();
|
|
|
|
+ retTable.Columns.Add("我方文号");
|
|
|
|
+ retTable.Columns.Add("申请类型");
|
|
|
|
+ retTable.Columns.Add("业务类型");
|
|
|
|
+ retTable.Columns.Add("备注(填表注意事项)");
|
|
|
|
+ retTable.Columns.Add("备注(填表注意事项)【系统】");
|
|
|
|
+ retTable.Columns.Add("处理事项");
|
|
|
|
+ retTable.Columns.Add("处理事项【系统】");
|
|
|
|
+ retTable.Columns.Add("案件阶段");
|
|
|
|
+ retTable.Columns.Add("案件阶段【系统】");
|
|
|
|
+ retTable.Columns.Add("案件系数");
|
|
|
|
+ retTable.Columns.Add("案件系数【系统】");
|
|
|
|
+ retTable.Columns.Add("处理事项系数");
|
|
|
|
+ retTable.Columns.Add("处理事项系数【系统】");
|
|
|
|
+ retTable.Columns.Add("处理人等级");
|
|
|
|
+ retTable.Columns.Add("处理人等级【系统】");
|
|
|
|
+ retTable.Columns.Add("处理人系数");
|
|
|
|
+ retTable.Columns.Add("处理人系数【系统】");
|
|
|
|
+ retTable.Columns.Add("基本点数");
|
|
|
|
+ retTable.Columns.Add("基本点数【系统】");
|
|
|
|
+ retTable.Columns.Add("核稿系数");
|
|
|
|
+ retTable.Columns.Add("核稿系数【系统】");
|
|
|
|
+ retTable.Columns.Add("核稿绩效");
|
|
|
|
+ retTable.Columns.Add("核稿绩效【系统】");
|
|
|
|
+ retTable.Columns.Add("处理人");
|
|
|
|
+ retTable.Columns.Add("处理人【系统】");
|
|
|
|
+ retTable.Columns.Add("核稿人");
|
|
|
|
+ retTable.Columns.Add("核稿人【系统】");
|
|
|
|
+ retTable.Columns.Add("严重超期备注原因");
|
|
|
|
+ retTable.Columns.Add("严重超期备注原因【系统】");
|
|
|
|
+
|
|
|
|
+ retTable.Columns.Add("是否一致");
|
|
|
|
+ retTable.Columns.Add("不一致原因");
|
|
|
|
+
|
|
|
|
+ spDbContext spDb = new spDbContext();
|
|
|
|
+ List<PerformanceItem> items = spDb.PerformanceItems
|
|
|
|
+ .Include(p=>p.Reviewer).ThenInclude(p=>p.StaffGrade)
|
|
|
|
+ .Include(p=>p.Customer)
|
|
|
|
+ .Include(p=>p.ItemStaffs).ThenInclude(s=>s.DoPerson).ThenInclude(s=>s.StaffGrade)
|
|
|
|
+ .Where(p=>p.CalMonth.Status ==0 && !p.CaseNo.StartsWith("J")).OrderBy(p=>p.CaseNo).ThenBy(p=>p.DoItem).ToList();
|
|
|
|
+
|
|
|
|
+ excelDT.DefaultView.Sort = "我方文号,处理事项";
|
|
|
|
+ DataTable temDt = excelDT.DefaultView.ToTable();
|
|
|
|
+
|
|
|
|
+ int iTable = 0;
|
|
|
|
+ int iList = 0;
|
|
|
|
+
|
|
|
|
+ CalMonth calMonth = spDb.CalMonths.FirstOrDefault(p=>p.Status ==0);
|
|
|
|
+ var verifyCoefficients = spDb.VerifyCoefficients.ToList();
|
|
|
|
+ var Rules = spDb.BasePointRules.ToList();
|
|
|
|
+ while (iTable < temDt.Rows.Count && iList < items.Count)
|
|
|
|
+ {
|
|
|
|
+ System.Diagnostics.Debug.WriteLine($"Excel:{iTable}/{temDt.Rows.Count}\t{iList}/{items.Count}");
|
|
|
|
+
|
|
|
|
+ DataRow row = temDt.Rows[iTable];
|
|
|
|
+ PerformanceItem item = items[iList];
|
|
|
|
+
|
|
|
|
+ if(row["我方文号"].ToString() == item.CaseNo && (row["处理事项"].ToString() == item.DoItem || (row["备注(填表注意事项)"].ToString()== "发明一次OA授权" && item.DoItem == "发明一次OA授权")))
|
|
|
|
+ {
|
|
|
|
+ var temRow = retTable.NewRow();
|
|
|
|
+
|
|
|
|
+ int iBegin = iTable;
|
|
|
|
+ int iEnd = iTable;
|
|
|
|
+
|
|
|
|
+ #region 判断是否有重复记录,并将Excel表中的记录生成临时表中的一行记录
|
|
|
|
+ if (iEnd < temDt.Rows.Count - 1)
|
|
|
|
+ {
|
|
|
|
+ while (temDt.Rows[iEnd]["我方文号"].ToString() == temDt.Rows[iEnd + 1]["我方文号"].ToString() &&
|
|
|
|
+ temDt.Rows[iEnd]["处理事项"].ToString() == temDt.Rows[iEnd + 1]["处理事项"].ToString())
|
|
|
|
+ {
|
|
|
|
+ iEnd++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ temRow["我方文号"] = temDt.Rows[iTable]["我方文号"];
|
|
|
|
+ temRow["处理事项"] = temDt.Rows[iTable]["处理事项"];
|
|
|
|
+ temRow["申请类型"] = temDt.Rows[iTable]["申请类型"];
|
|
|
|
+ temRow["业务类型"] = temDt.Rows[iTable]["业务类型"];
|
|
|
|
+ temRow["案件阶段"] = temDt.Rows[iTable]["案件阶段"];
|
|
|
|
+ temRow["案件系数"] = temDt.Rows[iTable]["案件系数"];
|
|
|
|
+ temRow["处理事项系数"] = temDt.Rows[iTable]["处理事项系数"];
|
|
|
|
+ temRow["核稿人"] = temDt.Rows[iTable]["核稿人"];
|
|
|
|
+ temRow["备注(填表注意事项)"] = temDt.Rows[iTable]["备注(填表注意事项)"];
|
|
|
|
+
|
|
|
|
+ temRow["处理人等级"] = temDt.Rows[iTable]["处理人等级"];
|
|
|
|
+ temRow["基本点数"] = temDt.Rows[iTable]["基本点数"];
|
|
|
|
+ temRow["核稿系数"] = temDt.Rows[iTable]["核稿系数"];
|
|
|
|
+ temRow["处理人"] = temDt.Rows[iTable]["处理人"];
|
|
|
|
+
|
|
|
|
+ temRow["严重超期备注原因"] = temDt.Rows[iTable]["备注(发文严重超期是否属客观原因,若为否,请填写原因)"];
|
|
|
|
+
|
|
|
|
+ for (int i = iBegin; i <= iEnd; i++)
|
|
|
|
+ {
|
|
|
|
+ temRow["备注(填表注意事项)"] =string.IsNullOrEmpty(temRow["备注(填表注意事项)"].ToString()) ?temDt.Rows[i]["备注(填表注意事项)"] :$"{temRow["备注(填表注意事项)"]}{temDt.Rows[i]["备注(填表注意事项)"]}";
|
|
|
|
+
|
|
|
|
+ //temRow["基本点数"] = string.IsNullOrEmpty(temRow["基本点数"].ToString()) ? temDt.Rows[i]["基本点数"] : $"{temRow["基本点数"]},{temDt.Rows[i]["基本点数"]}";
|
|
|
|
+ temRow["核稿系数"] = string.IsNullOrEmpty(temRow["核稿系数"].ToString()) ? temDt.Rows[i]["核稿系数"] : $"{temRow["核稿系数"]},{temDt.Rows[i]["核稿系数"]}";
|
|
|
|
+ if (!temRow["处理人"].ToString().Contains(temDt.Rows[i]["处理人"].ToString()))
|
|
|
|
+ {
|
|
|
|
+ temRow["处理人"] = string.IsNullOrEmpty(temRow["处理人"].ToString()) ? temDt.Rows[i]["处理人"] : $"{temRow["处理人"]},{temDt.Rows[i]["处理人"]}";
|
|
|
|
+ temRow["处理人等级"] = string.IsNullOrEmpty(temRow["处理人等级"].ToString()) ? temDt.Rows[i]["处理人等级"] : $"{temRow["处理人等级"]},{temDt.Rows[i]["处理人等级"]}";
|
|
|
|
+ }
|
|
|
|
+ temRow["严重超期备注原因"] = string.IsNullOrEmpty(temRow["严重超期备注原因"].ToString()) ? temDt.Rows[i]["备注(发文严重超期是否属客观原因,若为否,请填写原因)"] : $"{temRow["严重超期备注原因"]}{temDt.Rows[i]["备注(发文严重超期是否属客观原因,若为否,请填写原因)"]}";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ iTable = iEnd;
|
|
|
|
+ #endregion
|
|
|
|
+
|
|
|
|
+ Utility.Utility.CalBasePoint(item, Rules);
|
|
|
|
+
|
|
|
|
+ List<StaffStatistics> retPoints = new List<StaffStatistics>();
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ retPoints = _calItemJX(calMonth, verifyCoefficients, item, spDb);
|
|
|
|
+ }
|
|
|
|
+ catch { }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ temRow["案件阶段【系统】"] = item.CaseStage;
|
|
|
|
+ temRow["案件系数【系统】"] = item.CaseCoefficient;
|
|
|
|
+ temRow["处理事项系数【系统】"] = item.DoItemCoefficient;
|
|
|
|
+ temRow["核稿人【系统】"] = item.Reviewer?.Name;
|
|
|
|
+ temRow["备注(填表注意事项)【系统】"] = item.AgentFeedbackMemo;
|
|
|
|
+ temRow["基本点数【系统】"] = item.BasePoint?.ToString();
|
|
|
|
+ temRow["严重超期备注原因"] = item.OverDueMemo;
|
|
|
|
+
|
|
|
|
+ if (retPoints != null && retPoints.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ temRow["核稿绩效【系统】"] = retPoints.FirstOrDefault(p => p.StaffId == item.ReviewerId && p.jxType.Contains("审核"))?.totalBasePoint;
|
|
|
|
+
|
|
|
|
+ foreach (var itemStaff in item.ItemStaffs)
|
|
|
|
+ {
|
|
|
|
+ //temRow["基本点数【系统】"] = string.IsNullOrEmpty(temRow["基本点数【系统】"].ToString()) ? retPoints.FirstOrDefault(p => p.StaffId == itemStaff.DoPersonId)?.totalBasePoint.ToString() : $"{temRow["基本点数【系统】"]},{retPoints.FirstOrDefault(p => p.StaffId == itemStaff.DoPersonId)?.totalBasePoint}";
|
|
|
|
+
|
|
|
|
+ temRow["处理人等级【系统】"] = string.IsNullOrEmpty(temRow["处理人等级【系统】"].ToString()) ? itemStaff.DoPerson.StaffGrade?.Grade : $"{temRow["处理人等级【系统】"]},{itemStaff.DoPerson.StaffGrade?.Grade }";
|
|
|
|
+ temRow["处理人【系统】"] = string.IsNullOrEmpty(temRow["处理人【系统】"].ToString()) ? itemStaff.DoPerson.Name : $"{temRow["处理人【系统】"]},{itemStaff.DoPerson.Name}";
|
|
|
|
+
|
|
|
|
+ if (item.ReviewerId != null)
|
|
|
|
+ {
|
|
|
|
+ #region 取审核人等级审核等级系数
|
|
|
|
+ VerifyCoefficient vcoefficient
|
|
|
|
+ = verifyCoefficients.Where<VerifyCoefficient>(v =>
|
|
|
|
+ v.CheckerId == item.Reviewer.StaffGradeId
|
|
|
|
+ && v.DoPersonId == itemStaff.DoPerson.StaffGradeId)
|
|
|
|
+ .FirstOrDefault<VerifyCoefficient>();
|
|
|
|
+ #endregion
|
|
|
|
+
|
|
|
|
+ if (vcoefficient != null)
|
|
|
|
+ {
|
|
|
|
+ temRow["核稿系数【系统】"] = string.IsNullOrEmpty(temRow["核稿系数【系统】"].ToString()) ? vcoefficient.Coefficient.ToString() : $"{temRow["核稿系数【系统】"]},{vcoefficient.Coefficient}";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ temRow["是否一致"] = "";
|
|
|
|
+ temRow["不一致原因"] = "";
|
|
|
|
+
|
|
|
|
+ if(temRow["案件阶段【系统】"].ToString().Trim() != temRow["案件阶段"].ToString().Trim())
|
|
|
|
+ {
|
|
|
|
+ temRow["不一致原因"] = string.IsNullOrEmpty(temRow["不一致原因"].ToString()) ? "案件阶段" : $"{temRow["不一致原因"]},案件阶段";
|
|
|
|
+ }
|
|
|
|
+ if (temRow["案件系数【系统】"].ToString().Trim() != temRow["案件系数"].ToString().Trim())
|
|
|
|
+ {
|
|
|
|
+ temRow["不一致原因"] = string.IsNullOrEmpty(temRow["不一致原因"].ToString()) ? "案件系数" : $"{temRow["不一致原因"]},案件系数";
|
|
|
|
+ }
|
|
|
|
+ if (temRow["处理事项系数【系统】"].ToString().Trim() != temRow["处理事项系数"].ToString().Trim())
|
|
|
|
+ {
|
|
|
|
+ temRow["不一致原因"] = string.IsNullOrEmpty(temRow["不一致原因"].ToString()) ? "处理事项系数" : $"{temRow["不一致原因"]},处理事项系数";
|
|
|
|
+ }
|
|
|
|
+ if (temRow["核稿人【系统】"].ToString().Trim() != temRow["核稿人"].ToString().Trim())
|
|
|
|
+ {
|
|
|
|
+ temRow["不一致原因"] = string.IsNullOrEmpty(temRow["不一致原因"].ToString()) ? "核稿人" : $"{temRow["不一致原因"]},核稿人";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (temRow["基本点数【系统】"].ToString().Trim() != temRow["基本点数"].ToString().Trim())
|
|
|
|
+ {
|
|
|
|
+ temRow["不一致原因"] = string.IsNullOrEmpty(temRow["不一致原因"].ToString()) ? "基本点数" : $"{temRow["不一致原因"]},基本点数";
|
|
|
|
+ }
|
|
|
|
+ if (temRow["严重超期备注原因【系统】"].ToString().Trim() != temRow["严重超期备注原因"].ToString().Trim())
|
|
|
|
+ {
|
|
|
|
+ temRow["不一致原因"] = string.IsNullOrEmpty(temRow["不一致原因"].ToString()) ? "严重超期备注原因" : $"{temRow["不一致原因"]},严重超期备注原因";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!string.IsNullOrEmpty(temRow["不一致原因"].ToString()))
|
|
|
|
+ {
|
|
|
|
+ temRow["是否一致"] = "不一致";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ retTable.Rows.Add(temRow);
|
|
|
|
+
|
|
|
|
+ iTable++;
|
|
|
|
+ iList++;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ string strDT = $"{row["我方文号"]}-{row["处理事项"]}";
|
|
|
|
+ string strList = $"{item.CaseNo}-{item.DoItem}";
|
|
|
|
+
|
|
|
|
+ if (strDT.CompareTo(strList) > 0)
|
|
|
|
+ {
|
|
|
|
+ var temRow = retTable.NewRow();
|
|
|
|
+
|
|
|
|
+ Utility.Utility.CalBasePoint(item, Rules);
|
|
|
|
+
|
|
|
|
+ List<StaffStatistics> retPoints = new List<StaffStatistics>();
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ retPoints = _calItemJX(calMonth, verifyCoefficients, item, spDb);
|
|
|
|
+ }
|
|
|
|
+ catch { }
|
|
|
|
+
|
|
|
|
+ temRow["我方文号"] = item.CaseNo;
|
|
|
|
+ temRow["处理事项"] = item.DoItem;
|
|
|
|
+ temRow["申请类型"] = item.ApplicationType;
|
|
|
|
+ temRow["业务类型"] = item.BusinessType;
|
|
|
|
+ temRow["案件阶段【系统】"] = item.CaseStage;
|
|
|
|
+ temRow["案件系数【系统】"] = item.CaseCoefficient;
|
|
|
|
+ temRow["处理事项系数【系统】"] = item.DoItemCoefficient;
|
|
|
|
+ temRow["核稿人【系统】"] = item.Reviewer?.Name;
|
|
|
|
+ temRow["备注(填表注意事项)【系统】"] = item.AgentFeedbackMemo;
|
|
|
|
+ temRow["基本点数【系统】"] = item.BasePoint?.ToString();
|
|
|
|
+ temRow["严重超期备注原因"] = item.OverDueMemo;
|
|
|
|
+
|
|
|
|
+ if (item.ReviewerId != null)
|
|
|
|
+ {
|
|
|
|
+ temRow["核稿绩效【系统】"] = retPoints.FirstOrDefault(p => p.StaffId == item.ReviewerId)?.totalBasePoint;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ foreach (var itemStaff in item.ItemStaffs)
|
|
|
|
+ {
|
|
|
|
+ //if (itemStaff.DoPerson.Status != "试用期")
|
|
|
|
+ //{
|
|
|
|
+ // if (retPoints != null && retPoints.Count > 0)
|
|
|
|
+ // {
|
|
|
|
+ // temRow["基本点数【系统】"] = string.IsNullOrEmpty(temRow["基本点数【系统】"].ToString()) ? retPoints.FirstOrDefault(p => p.StaffId == itemStaff.DoPersonId)?.totalBasePoint.ToString() : $"{temRow["基本点数【系统】"]},{retPoints.FirstOrDefault(p => p.StaffId == itemStaff.DoPersonId)?.totalBasePoint}";
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ temRow["处理人等级【系统】"] = string.IsNullOrEmpty(temRow["处理人等级【系统】"].ToString()) ? itemStaff.DoPerson.StaffGrade?.Grade : $"{temRow["处理人等级【系统】"]},{itemStaff.DoPerson.StaffGrade?.Grade }";
|
|
|
|
+ temRow["处理人系数【系统】"] = string.IsNullOrEmpty(temRow["处理人系数【系统】"].ToString()) ? itemStaff.DoPerson.StaffGrade?.Coefficient : $"{temRow["处理人系数【系统】"]},{itemStaff.DoPerson.StaffGrade?.Coefficient}";
|
|
|
|
+ temRow["处理人【系统】"] = string.IsNullOrEmpty(temRow["处理人【系统】"].ToString()) ? itemStaff.DoPerson.Name : $"{temRow["处理人【系统】"]},{itemStaff.DoPerson.Name}";
|
|
|
|
+
|
|
|
|
+ if (item.ReviewerId != null)
|
|
|
|
+ {
|
|
|
|
+ #region 取审核人等级审核等级系数
|
|
|
|
+ VerifyCoefficient vcoefficient
|
|
|
|
+ = verifyCoefficients.Where<VerifyCoefficient>(v =>
|
|
|
|
+ v.CheckerId == item.Reviewer.StaffGradeId
|
|
|
|
+ && v.DoPersonId == itemStaff.DoPerson.StaffGradeId)
|
|
|
|
+ .FirstOrDefault<VerifyCoefficient>();
|
|
|
|
+ #endregion
|
|
|
|
+
|
|
|
|
+ if (vcoefficient != null)
|
|
|
|
+ {
|
|
|
|
+ temRow["核稿系数【系统】"] = string.IsNullOrEmpty(temRow["核稿系数【系统】"].ToString()) ? vcoefficient.Coefficient.ToString() : $"{temRow["核稿系数【系统】"]},{vcoefficient.Coefficient}";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ temRow["是否一致"] = "不一致";
|
|
|
|
+ temRow["不一致原因"] = "Excel中没有,系统中有";
|
|
|
|
+
|
|
|
|
+ retTable.Rows.Add(temRow);
|
|
|
|
+
|
|
|
|
+ iList++;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ var temRow = retTable.NewRow();
|
|
|
|
+
|
|
|
|
+ int iBegin = iTable;
|
|
|
|
+ int iEnd = iTable;
|
|
|
|
+
|
|
|
|
+ #region 判断是否有重复记录,并将Excel表中的记录生成临时表中的一行记录
|
|
|
|
+ if (iEnd < temDt.Rows.Count - 1)
|
|
|
|
+ {
|
|
|
|
+ while (temDt.Rows[iEnd]["我方文号"].ToString() == temDt.Rows[iEnd + 1]["我方文号"].ToString() &&
|
|
|
|
+ temDt.Rows[iEnd]["处理事项"].ToString() == temDt.Rows[iEnd + 1]["处理事项"].ToString())
|
|
|
|
+ {
|
|
|
|
+ iEnd++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ temRow["我方文号"] = temDt.Rows[iTable]["我方文号"];
|
|
|
|
+ temRow["处理事项"] = temDt.Rows[iTable]["处理事项"];
|
|
|
|
+ temRow["申请类型"] = temDt.Rows[iTable]["申请类型"];
|
|
|
|
+ temRow["业务类型"] = temDt.Rows[iTable]["业务类型"];
|
|
|
|
+ temRow["案件阶段"] = temDt.Rows[iTable]["案件阶段"];
|
|
|
|
+ temRow["案件系数"] = temDt.Rows[iTable]["案件系数"];
|
|
|
|
+ temRow["处理事项系数"] = temDt.Rows[iTable]["处理事项系数"];
|
|
|
|
+ temRow["核稿人"] = temDt.Rows[iTable]["核稿人"];
|
|
|
|
+ temRow["备注(填表注意事项)"] = temDt.Rows[iTable]["备注(填表注意事项)"];
|
|
|
|
+
|
|
|
|
+ temRow["处理人等级"] = temDt.Rows[iTable]["处理人等级"];
|
|
|
|
+ temRow["基本点数"] = temDt.Rows[iTable]["基本点数"];
|
|
|
|
+ temRow["核稿系数"] = temDt.Rows[iTable]["核稿系数"];
|
|
|
|
+ temRow["核稿绩效"] = temDt.Rows[iTable]["核稿绩效"];
|
|
|
|
+ temRow["处理人"] = temDt.Rows[iTable]["处理人"];
|
|
|
|
+
|
|
|
|
+ temRow["严重超期备注原因"] = temDt.Rows[iTable]["备注(发文严重超期是否属客观原因,若为否,请填写原因)"];
|
|
|
|
+
|
|
|
|
+ for (int i = iBegin+1; i <= iEnd; i++)
|
|
|
|
+ {
|
|
|
|
+ temRow["备注(填表注意事项)"] = string.IsNullOrEmpty(temRow["备注(填表注意事项)"].ToString()) ? temDt.Rows[i]["备注(填表注意事项)"] : $"{temRow["备注(填表注意事项)"]}{temDt.Rows[i]["备注(填表注意事项)"]}";
|
|
|
|
+
|
|
|
|
+ //temRow["基本点数"] = string.IsNullOrEmpty(temRow["基本点数"].ToString()) ? temDt.Rows[i]["基本点数"] : $"{temRow["基本点数"]},{temDt.Rows[i]["基本点数"]}";
|
|
|
|
+
|
|
|
|
+ temRow["核稿绩效"] = string.IsNullOrEmpty(temRow["核稿绩效"].ToString()) ? temDt.Rows[i]["核稿绩效"] : $"{temRow["核稿绩效"]},{temDt.Rows[i]["核稿绩效"]}";
|
|
|
|
+ if (!temRow["处理人"].ToString().Contains(temDt.Rows[i]["处理人"].ToString()))
|
|
|
|
+ {
|
|
|
|
+ temRow["处理人"] = string.IsNullOrEmpty(temRow["处理人"].ToString()) ? temDt.Rows[i]["处理人"] : $"{temRow["处理人"]},{temDt.Rows[i]["处理人"]}";
|
|
|
|
+ temRow["处理人等级"] = string.IsNullOrEmpty(temRow["处理人等级"].ToString()) ? temDt.Rows[i]["处理人等级"] : $"{temRow["处理人等级"]},{temDt.Rows[i]["处理人等级"]}";
|
|
|
|
+ }
|
|
|
|
+ temRow["严重超期备注原因"] = string.IsNullOrEmpty(temRow["严重超期备注原因"].ToString()) ? temDt.Rows[i]["备注(发文严重超期是否属客观原因,若为否,请填写原因)"] : $"{temRow["严重超期备注原因"]}{temDt.Rows[i]["备注(发文严重超期是否属客观原因,若为否,请填写原因)"]}";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ iTable = iEnd;
|
|
|
|
+ #endregion
|
|
|
|
+
|
|
|
|
+ temRow["是否一致"] = "不一致";
|
|
|
|
+ temRow["不一致原因"] = "系统中没有,Excel中有";
|
|
|
|
+ retTable.Rows.Add(temRow);
|
|
|
|
+ iTable++;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (iList <=items.Count)
|
|
|
|
+ {
|
|
|
|
+ while(iList <items.Count){
|
|
|
|
+ var item = items[iList];
|
|
|
|
+ var temRow = retTable.NewRow();
|
|
|
|
+
|
|
|
|
+ Utility.Utility.CalBasePoint(item, Rules);
|
|
|
|
+
|
|
|
|
+ List<StaffStatistics> retPoints = new List<StaffStatistics>();
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ retPoints = _calItemJX(calMonth, verifyCoefficients, item, spDb);
|
|
|
|
+ }
|
|
|
|
+ catch { }
|
|
|
|
+
|
|
|
|
+ temRow["我方文号"] = item.CaseNo;
|
|
|
|
+ temRow["处理事项"] = item.DoItem;
|
|
|
|
+ temRow["申请类型"] = item.ApplicationType;
|
|
|
|
+ temRow["业务类型"] = item.BusinessType;
|
|
|
|
+ temRow["案件阶段【系统】"] = item.CaseStage;
|
|
|
|
+ temRow["案件系数【系统】"] = item.CaseCoefficient;
|
|
|
|
+ temRow["处理事项系数【系统】"] = item.DoItemCoefficient;
|
|
|
|
+ temRow["核稿人【系统】"] = item.Reviewer?.Name;
|
|
|
|
+ temRow["备注(填表注意事项)【系统】"] = item.AgentFeedbackMemo;
|
|
|
|
+ temRow["基本点数【系统】"] = "";// item.BasePoint?.ToString();
|
|
|
|
+ temRow["严重超期备注原因"] = item.OverDueMemo;
|
|
|
|
+
|
|
|
|
+ if (item.ReviewerId != null)
|
|
|
|
+ {
|
|
|
|
+ temRow["核稿绩效【系统】"] = retPoints.FirstOrDefault(p => p.StaffId == item.ReviewerId)?.totalBasePoint;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ foreach (var itemStaff in item.ItemStaffs)
|
|
|
|
+ {
|
|
|
|
+ //if (itemStaff.DoPerson.Status != "试用期")
|
|
|
|
+ //{
|
|
|
|
+ // if (retPoints != null && retPoints.Count > 0)
|
|
|
|
+ // {
|
|
|
|
+ // temRow["基本点数【系统】"] = string.IsNullOrEmpty(temRow["基本点数【系统】"].ToString()) ? retPoints.FirstOrDefault(p => p.StaffId == itemStaff.DoPersonId)?.totalBasePoint.ToString() : $"{temRow["基本点数【系统】"]},{retPoints.FirstOrDefault(p => p.StaffId == itemStaff.DoPersonId)?.totalBasePoint}";
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ temRow["处理人等级【系统】"] = string.IsNullOrEmpty(temRow["处理人等级【系统】"].ToString()) ? itemStaff.DoPerson.StaffGrade?.Grade : $"{temRow["处理人等级【系统】"]},{itemStaff.DoPerson.StaffGrade?.Grade }";
|
|
|
|
+ temRow["处理人系数【系统】"] = string.IsNullOrEmpty(temRow["处理人系数【系统】"].ToString()) ? itemStaff.DoPerson.StaffGrade?.Coefficient : $"{temRow["处理人系数【系统】"]},{itemStaff.DoPerson.StaffGrade?.Coefficient}";
|
|
|
|
+ temRow["处理人【系统】"] = string.IsNullOrEmpty(temRow["处理人【系统】"].ToString()) ? itemStaff.DoPerson.Name : $"{temRow["处理人【系统】"]},{itemStaff.DoPerson.Name}";
|
|
|
|
+
|
|
|
|
+ if (item.ReviewerId != null)
|
|
|
|
+ {
|
|
|
|
+ #region 取审核人等级审核等级系数
|
|
|
|
+ VerifyCoefficient vcoefficient
|
|
|
|
+ = verifyCoefficients.Where<VerifyCoefficient>(v =>
|
|
|
|
+ v.CheckerId == item.Reviewer.StaffGradeId
|
|
|
|
+ && v.DoPersonId == itemStaff.DoPerson.StaffGradeId)
|
|
|
|
+ .FirstOrDefault<VerifyCoefficient>();
|
|
|
|
+ #endregion
|
|
|
|
+
|
|
|
|
+ if (vcoefficient != null)
|
|
|
|
+ {
|
|
|
|
+ temRow["核稿系数【系统】"] = string.IsNullOrEmpty(temRow["核稿系数【系统】"].ToString()) ? vcoefficient.Coefficient.ToString() : $"{temRow["核稿系数【系统】"]},{vcoefficient.Coefficient}";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ temRow["是否一致"] = "不一致";
|
|
|
|
+ temRow["不一致原因"] = "Excel中没有,系统中有";
|
|
|
|
+
|
|
|
|
+ iList++;
|
|
|
|
+ retTable.Rows.Add(temRow);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ while (iTable < temDt.Rows.Count)
|
|
|
|
+ {
|
|
|
|
+ var temRow = retTable.NewRow();
|
|
|
|
+
|
|
|
|
+ int iBegin = iTable;
|
|
|
|
+ int iEnd = iTable;
|
|
|
|
+
|
|
|
|
+ #region 判断是否有重复记录,并将Excel表中的记录生成临时表中的一行记录
|
|
|
|
+ while (temDt.Rows[iTable]["我方文号"].ToString() == temDt.Rows[iTable + 1]["我方文号"].ToString() &&
|
|
|
|
+ temDt.Rows[iTable]["处理事项"].ToString() == temDt.Rows[iTable + 1]["处理事项"].ToString())
|
|
|
|
+ {
|
|
|
|
+ iEnd++;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ temRow["我方文号"] = temDt.Rows[iTable]["我方文号"];
|
|
|
|
+ temRow["处理事项"] = temDt.Rows[iTable]["处理事项"];
|
|
|
|
+ temRow["申请类型"] = temDt.Rows[iTable]["申请类型"];
|
|
|
|
+ temRow["业务类型"] = temDt.Rows[iTable]["业务类型"];
|
|
|
|
+ temRow["案件阶段"] = temDt.Rows[iTable]["案件阶段"];
|
|
|
|
+ temRow["案件系数"] = temDt.Rows[iTable]["案件系数"];
|
|
|
|
+ temRow["处理事项系数"] = temDt.Rows[iTable]["处理事项系数"];
|
|
|
|
+ temRow["核稿人"] = temDt.Rows[iTable]["核稿人"];
|
|
|
|
+ temRow["备注(填表注意事项)"] = temDt.Rows[iTable]["备注(填表注意事项)"];
|
|
|
|
+
|
|
|
|
+ temRow["处理人等级"] = temDt.Rows[iTable]["处理人等级"];
|
|
|
|
+ temRow["基本点数"] = temDt.Rows[iTable]["基本点数"];
|
|
|
|
+ temRow["核稿系数"] = temDt.Rows[iTable]["核稿系数"];
|
|
|
|
+ temRow["核稿绩效"] = temDt.Rows[iTable]["核稿绩效"];
|
|
|
|
+ temRow["处理人"] = temDt.Rows[iTable]["处理人"];
|
|
|
|
+
|
|
|
|
+ temRow["严重超期备注原因"] = temDt.Rows[iTable]["备注(发文严重超期是否属客观原因,若为否,请填写原因)"];
|
|
|
|
+
|
|
|
|
+ for (int i = iBegin + 1; i <= iEnd; i++)
|
|
|
|
+ {
|
|
|
|
+ temRow["备注(填表注意事项)"] = string.IsNullOrEmpty(temRow["备注(填表注意事项)"].ToString()) ? temDt.Rows[i]["备注(填表注意事项)"] : $"{temRow["备注(填表注意事项)"]}{temDt.Rows[i]["备注(填表注意事项)"]}";
|
|
|
|
+
|
|
|
|
+ //temRow["基本点数"] = string.IsNullOrEmpty(temRow["基本点数"].ToString()) ? temDt.Rows[i]["基本点数"] : $"{temRow["基本点数"]},{temDt.Rows[i]["基本点数"]}";
|
|
|
|
+
|
|
|
|
+ temRow["核稿绩效"] = string.IsNullOrEmpty(temRow["核稿绩效"].ToString()) ? temDt.Rows[i]["核稿绩效"] : $"{temRow["核稿绩效"]},{temDt.Rows[i]["核稿绩效"]}";
|
|
|
|
+
|
|
|
|
+ if (!temRow["处理人"].ToString().Contains(temDt.Rows[i]["处理人"].ToString()))
|
|
|
|
+ {
|
|
|
|
+ temRow["处理人"] = string.IsNullOrEmpty(temRow["处理人"].ToString()) ? temDt.Rows[i]["处理人"] : $"{temRow["处理人"]},{temDt.Rows[i]["处理人"]}";
|
|
|
|
+ temRow["处理人等级"] = string.IsNullOrEmpty(temRow["处理人等级"].ToString()) ? temDt.Rows[i]["处理人等级"] : $"{temRow["处理人等级"]},{temDt.Rows[i]["处理人等级"]}";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ temRow["严重超期备注原因"] = string.IsNullOrEmpty(temRow["严重超期备注原因"].ToString()) ? temDt.Rows[i]["严重超期备注原因"] : $"{temRow["严重超期备注原因"]}{temDt.Rows[i]["严重超期备注原因"]}";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ iTable = iEnd;
|
|
|
|
+ #endregion
|
|
|
|
+
|
|
|
|
+ temRow["是否一致"] = "不一致";
|
|
|
|
+ temRow["不一致原因"] = "系统中没有,Excel中有";
|
|
|
|
+ retTable.Rows.Add(temRow);
|
|
|
|
+ iTable++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ NPOIExcel.DataTableToExcel(retTable, "c:\\temp\\202112-系统线下绩效记录对比.xlsx");
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
private List<StaffStatistics> _calItemJX(CalMonth calMonth, List<VerifyCoefficient> verifyCoefficients, PerformanceItem item,spDbContext spDb)
|
|
private List<StaffStatistics> _calItemJX(CalMonth calMonth, List<VerifyCoefficient> verifyCoefficients, PerformanceItem item,spDbContext spDb)
|
|
{
|
|
{
|
|
|
|
+ //if(item.CaseNo == "PACN2116373")
|
|
|
|
+ //{
|
|
|
|
+ // System.Diagnostics.Debug.WriteLine("");
|
|
|
|
+ //}
|
|
System.Collections.Hashtable doPersonsBL = new System.Collections.Hashtable();
|
|
System.Collections.Hashtable doPersonsBL = new System.Collections.Hashtable();
|
|
|
|
|
|
bool isPJFP = true;
|
|
bool isPJFP = true;
|
|
@@ -676,7 +1204,7 @@ 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 != "专案")
|
|
|
|
|
|
+ if (item.ReviewerId != null && item.Type != "专案" && item.ItemStaffs.FirstOrDefault(s=>s.DoPersonId == item.ReviewerId) == null)
|
|
{
|
|
{
|
|
|
|
|
|
#region 取审核人等级审核等级系数
|
|
#region 取审核人等级审核等级系数
|
|
@@ -868,31 +1396,52 @@ namespace wispro.sp.api.Controllers
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
public List<StaffStatistics> CalMyStatistics(int year,int month, int? userid=null)
|
|
public List<StaffStatistics> CalMyStatistics(int year,int month, int? userid=null)
|
|
{
|
|
{
|
|
- CalMonth calMonth = Context.CalMonths.Where<CalMonth>(c => c.Month == month && c.Year == year).FirstOrDefault();
|
|
|
|
|
|
+ object retList;
|
|
|
|
+ string strKey = $"CalMyStatistics:{year}-{month}-{userid}";
|
|
|
|
|
|
- if(calMonth == null)
|
|
|
|
- {
|
|
|
|
- return null;
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
|
|
+ if(!MyMemoryCache.TryGetValue(strKey,out retList))
|
|
{
|
|
{
|
|
- if(calMonth.Status == 4)
|
|
|
|
|
|
+ CalMonth calMonth = Context.CalMonths.Where<CalMonth>(c => c.Month == month && c.Year == year).FirstOrDefault();
|
|
|
|
+
|
|
|
|
+ if (calMonth == null)
|
|
|
|
+ {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
{
|
|
{
|
|
- //已归档,归档数据库中直接取出记录
|
|
|
|
- if (userid == null)
|
|
|
|
|
|
+ if (calMonth.Status == 4)
|
|
{
|
|
{
|
|
- return Context.StaffStatistics.Where<StaffStatistics>(s => s.CalMonthId == calMonth.Id).ToList<StaffStatistics>();
|
|
|
|
|
|
+ //已归档,归档数据库中直接取出记录
|
|
|
|
+ if (userid == null)
|
|
|
|
+ {
|
|
|
|
+ retList = Context.StaffStatistics.Where<StaffStatistics>(s => s.CalMonthId == calMonth.Id).ToList<StaffStatistics>();
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ retList = Context.StaffStatistics.Where<StaffStatistics>(s => s.CalMonthId == calMonth.Id && s.StaffId == userid).ToList<StaffStatistics>();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- return Context.StaffStatistics.Where<StaffStatistics>(s => s.CalMonthId == calMonth.Id && s.StaffId == userid).ToList<StaffStatistics>();
|
|
|
|
|
|
+ retList = _CalMyStatistics(calMonth, userid);
|
|
}
|
|
}
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- return _CalMyStatistics(calMonth, userid);
|
|
|
|
|
|
+
|
|
|
|
+ // Set cache options.
|
|
|
|
+ var cacheEntryOptions = new MemoryCacheEntryOptions()
|
|
|
|
+ // Keep in cache for this time, reset time if accessed.
|
|
|
|
+ .SetSlidingExpiration(TimeSpan.FromHours(1));
|
|
|
|
+
|
|
|
|
+ // Save data in cache.
|
|
|
|
+ MyMemoryCache.SetValue(strKey, retList);
|
|
|
|
+
|
|
|
|
+ return (List<StaffStatistics>)retList;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ return (List<StaffStatistics>)retList;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
private string GetExpress(IList<FieldCondition> conditions)
|
|
private string GetExpress(IList<FieldCondition> conditions)
|
|
@@ -1338,7 +1887,7 @@ namespace wispro.sp.api.Controllers
|
|
|
|
|
|
public PerformanceItem GetItemInfoByCaseStage(string CaseNo, string DoItem,string caseStage)
|
|
public PerformanceItem GetItemInfoByCaseStage(string CaseNo, string DoItem,string caseStage)
|
|
{
|
|
{
|
|
- var retObj = Context.PerformanceItems.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)
|