|
|
@@ -111,7 +111,8 @@ namespace wispro.sp.api.Controllers
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
- if (caseInfo.DRRAbstract != null) {
|
|
|
+ if (caseInfo.DRRAbstract != null)
|
|
|
+ {
|
|
|
Context.CaseCompareResults.Add(caseInfo.DRRAbstract);
|
|
|
Context.SaveChanges();
|
|
|
caseInfo.DRRAbstractId = caseInfo.DRRAbstract.Id;
|
|
|
@@ -179,7 +180,7 @@ namespace wispro.sp.api.Controllers
|
|
|
ret.ErrorMessage = ex.Message;
|
|
|
Context.Database.RollbackTransaction();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
return ret;
|
|
|
@@ -217,7 +218,7 @@ namespace wispro.sp.api.Controllers
|
|
|
.Include(pi => pi.DRRCalim)
|
|
|
.Include(pi => pi.DRRAbstract)
|
|
|
.Include(pi => pi.DRRFulltext)
|
|
|
- .Include(pi=>pi.DRRAll)
|
|
|
+ .Include(pi => pi.DRRAll)
|
|
|
.Include(pi => pi.RFRCalim)
|
|
|
.Include(pi => pi.RFRAbstract)
|
|
|
.Include(pi => pi.RFRFulltext)
|
|
|
@@ -266,7 +267,7 @@ namespace wispro.sp.api.Controllers
|
|
|
public static (double, double) UpdateStatistics(int n, double mean, double variance, double newValue)
|
|
|
{
|
|
|
double newMean = (n * mean + newValue) / (n + 1);
|
|
|
-
|
|
|
+
|
|
|
double newVariance = Math.Sqrt((n * (mean - newMean) * (mean - newMean) + (newValue - newMean) * (newValue - newMean) + n * variance * variance) / (n + 1));
|
|
|
|
|
|
return (newMean, newVariance);
|
|
|
@@ -278,9 +279,9 @@ namespace wispro.sp.api.Controllers
|
|
|
/// <param name="endDate">结束日期</param>
|
|
|
/// /// <param name="customerName">客户名称,默认不指定,获取所有客户的平均权利要求差异度和标准方差</param>
|
|
|
/// <returns></returns>
|
|
|
- private List<CustomerCompareStatistics> getLaseYearMean_Variance(DateTime endDate,List<CaseInfo> caseList,string customerName=null)
|
|
|
+ private List<CustomerCompareStatistics> getLaseYearMean_Variance(DateTime endDate, List<CaseInfo> caseList, string customerName = null)
|
|
|
{
|
|
|
- if(caseList == null)
|
|
|
+ if (caseList == null)
|
|
|
{
|
|
|
caseList = Context.CaseInfos.Where<CaseInfo>(
|
|
|
p => p.CreateTime >= endDate.AddYears(-1) &&
|
|
|
@@ -303,18 +304,20 @@ namespace wispro.sp.api.Controllers
|
|
|
|
|
|
//IIncludableQueryable<CaseInfo, CompareResult> caseList;
|
|
|
var temcaseList = caseList;
|
|
|
- if (customerName != null) {
|
|
|
- temcaseList = caseList.Where(p=> p.Customer.Name == customerName)
|
|
|
+ if (customerName != null)
|
|
|
+ {
|
|
|
+ temcaseList = caseList.Where(p => p.Customer.Name == customerName)
|
|
|
.ToList();
|
|
|
}
|
|
|
-
|
|
|
|
|
|
- List < CustomerCompareStatistics > retList = new List < CustomerCompareStatistics >();
|
|
|
|
|
|
- foreach ( var item in temcaseList)
|
|
|
+ List<CustomerCompareStatistics> retList = new List<CustomerCompareStatistics>();
|
|
|
+
|
|
|
+ foreach (var item in temcaseList)
|
|
|
{
|
|
|
- var temObj = retList.Where(p=>p.CustomerName == item.Customer.Name).FirstOrDefault<CustomerCompareStatistics>();
|
|
|
- if(temObj == null) {
|
|
|
+ var temObj = retList.Where(p => p.CustomerName == item.Customer.Name).FirstOrDefault<CustomerCompareStatistics>();
|
|
|
+ if (temObj == null)
|
|
|
+ {
|
|
|
temObj = new CustomerCompareStatistics();
|
|
|
temObj.CustomerName = item.Customer.Name;
|
|
|
retList.Add(temObj);
|
|
|
@@ -324,7 +327,8 @@ namespace wispro.sp.api.Controllers
|
|
|
|
|
|
if (item.DRRCalim != null)
|
|
|
{
|
|
|
- if (temObj.Diff_FinalDrafted_Claims_Count > 0) {
|
|
|
+ if (temObj.Diff_FinalDrafted_Claims_Count > 0)
|
|
|
+ {
|
|
|
var retStatistics = UpdateStatistics(temObj.Diff_Drafted_Claims_Count, temObj.Diff_Drafted_Claims_Avg, temObj.Diff_Drafted_Claims_Std, item.DRRCalim.diffRate);
|
|
|
temObj.Diff_Drafted_Claims_Std = retStatistics.Item2;
|
|
|
temObj.Diff_Drafted_Claims_Avg = retStatistics.Item1;
|
|
|
@@ -370,10 +374,11 @@ namespace wispro.sp.api.Controllers
|
|
|
/// 1:内部核稿差异率
|
|
|
/// </param>
|
|
|
/// <returns></returns>
|
|
|
- private List<CaseInfo> getTop10DiffRateCases(DateTime start, DateTime end,string customerName,int type=0,List<CaseInfo> caseList=null)
|
|
|
+ private List<CaseInfo> getTop10DiffRateCases(DateTime start, DateTime end, string customerName, int type = 0, List<CaseInfo> caseList = null)
|
|
|
{
|
|
|
- if (caseList == null) {
|
|
|
-
|
|
|
+ if (caseList == null)
|
|
|
+ {
|
|
|
+
|
|
|
caseList = Context.CaseInfos.Where<CaseInfo>(
|
|
|
p => p.CreateTime >= end.AddYears(-1) &&
|
|
|
p.CreateTime <= end &&
|
|
|
@@ -391,14 +396,15 @@ namespace wispro.sp.api.Controllers
|
|
|
.Include(p => p.RFRFulltext)
|
|
|
.Include(p => p.RFRAll)
|
|
|
.ToList();
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
- if (type == 0) {
|
|
|
+ if (type == 0)
|
|
|
+ {
|
|
|
|
|
|
- var top10Case = caseList.Where<CaseInfo>(p=>p.Customer.Name == customerName)
|
|
|
+ var top10Case = caseList.Where<CaseInfo>(p => p.Customer.Name == customerName)
|
|
|
.OrderByDescending(p => p.RFRCalim?.diffRate).Take(10);
|
|
|
|
|
|
- return top10Case.Where<CaseInfo>(c=>c.CreateTime>=start).ToList();
|
|
|
+ return top10Case.Where<CaseInfo>(c => c.CreateTime >= start).ToList();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -416,19 +422,20 @@ namespace wispro.sp.api.Controllers
|
|
|
/// <param name="end">结束日期</param>
|
|
|
/// <param name="customerName">客户名称</param>
|
|
|
/// <returns></returns>
|
|
|
- private List<CaseInfo> GetAbnormalCases(DateTime start, DateTime end, string customerName,List<CaseInfo> caseList)
|
|
|
+ private List<CaseInfo> GetAbnormalCases(DateTime start, DateTime end, string customerName, List<CaseInfo> caseList)
|
|
|
{
|
|
|
- var customerStatics = getLaseYearMean_Variance(end, caseList,customerName);
|
|
|
+ var customerStatics = getLaseYearMean_Variance(end, caseList, customerName);
|
|
|
var cStatics = customerStatics.Where(s => s.CustomerName == customerName).FirstOrDefault();
|
|
|
- return _GetAbnormalCases(start, end, customerName, cStatics,caseList);
|
|
|
+ return _GetAbnormalCases(start, end, customerName, cStatics, caseList);
|
|
|
|
|
|
}
|
|
|
|
|
|
- private List<CaseInfo> _GetAbnormalCases(DateTime start, DateTime end, string customerName, CustomerCompareStatistics cStatics,List<CaseInfo> caseList)
|
|
|
+ private List<CaseInfo> _GetAbnormalCases(DateTime start, DateTime end, string customerName, CustomerCompareStatistics cStatics, List<CaseInfo> caseList)
|
|
|
{
|
|
|
if (cStatics != null)
|
|
|
{
|
|
|
- if (caseList == null) {
|
|
|
+ if (caseList == null)
|
|
|
+ {
|
|
|
caseList = Context.CaseInfos.Where<CaseInfo>(
|
|
|
p => p.CreateTime >= end.AddYears(-1) &&
|
|
|
p.CreateTime <= end &&
|
|
|
@@ -451,7 +458,7 @@ namespace wispro.sp.api.Controllers
|
|
|
|
|
|
var retList = new List<CaseInfo>();
|
|
|
|
|
|
- var temCaseList = caseList.Where(p=>p.Customer.Name== customerName).ToList();
|
|
|
+ var temCaseList = caseList.Where(p => p.Customer.Name == customerName).ToList();
|
|
|
|
|
|
foreach (var item in temCaseList)
|
|
|
{
|
|
|
@@ -511,7 +518,7 @@ namespace wispro.sp.api.Controllers
|
|
|
|
|
|
public List<CaseInfo> Top10Cases { get; set; } = new List<CaseInfo>();
|
|
|
|
|
|
- public List<CaseInfo> AbnormalCases { get; set; }= new List<CaseInfo>();
|
|
|
+ public List<CaseInfo> AbnormalCases { get; set; } = new List<CaseInfo>();
|
|
|
}
|
|
|
|
|
|
public void getMailCaseInfo(DateTime start, DateTime end)
|
|
|
@@ -533,20 +540,20 @@ namespace wispro.sp.api.Controllers
|
|
|
.Include(p => p.RFRAll)
|
|
|
.ToList();
|
|
|
|
|
|
- List<string> defaultStaffNames = new List<string>() { "罗才洋","李庆波","钟子敏"};
|
|
|
+ List<string> defaultStaffNames = new List<string>() { "罗才洋", "李庆波", "钟子敏" };
|
|
|
var DefaultEmailAccounts = Context.Staffs.Where(p => defaultStaffNames.Contains(p.Name)).ToList();
|
|
|
-
|
|
|
- var customerStatics = getLaseYearMean_Variance(end,caseList);
|
|
|
+
|
|
|
+ var customerStatics = getLaseYearMean_Variance(end, caseList);
|
|
|
Hashtable staffMailInfo = new Hashtable();
|
|
|
foreach (var cStatics in customerStatics)
|
|
|
{
|
|
|
- if(cStatics.CaseCount < 20)
|
|
|
+ if (cStatics.CaseCount < 20)
|
|
|
{
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
//var cStatics = customerStatics.Where(s => s.CustomerName == item.Customer.Name).FirstOrDefault();
|
|
|
- var Top10Cases =getTop10DiffRateCases(start, end, cStatics.CustomerName,0,caseList);
|
|
|
+ var Top10Cases = getTop10DiffRateCases(start, end, cStatics.CustomerName, 0, caseList);
|
|
|
foreach (var caseInfo in Top10Cases)
|
|
|
{
|
|
|
foreach (Staff staff in DefaultEmailAccounts)
|
|
|
@@ -556,7 +563,7 @@ namespace wispro.sp.api.Controllers
|
|
|
|
|
|
if (caseInfo.Reviewer != null)
|
|
|
{
|
|
|
- AddtoHashTable(caseInfo,0, caseInfo.Reviewer,staffMailInfo,cStatics);
|
|
|
+ AddtoHashTable(caseInfo, 0, caseInfo.Reviewer, staffMailInfo, cStatics);
|
|
|
}
|
|
|
|
|
|
if (caseInfo.Customer.ResponseManId != null)
|
|
|
@@ -569,10 +576,10 @@ namespace wispro.sp.api.Controllers
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- var AbnormalCases = _GetAbnormalCases(start,end, cStatics.CustomerName, cStatics,caseList);
|
|
|
+ var AbnormalCases = _GetAbnormalCases(start, end, cStatics.CustomerName, cStatics, caseList);
|
|
|
foreach (var caseInfo in AbnormalCases)
|
|
|
{
|
|
|
- foreach(Staff staff in DefaultEmailAccounts)
|
|
|
+ foreach (Staff staff in DefaultEmailAccounts)
|
|
|
{
|
|
|
AddtoHashTable(caseInfo, 1, staff, staffMailInfo, cStatics);
|
|
|
}
|
|
|
@@ -593,15 +600,16 @@ namespace wispro.sp.api.Controllers
|
|
|
|
|
|
}
|
|
|
|
|
|
- if (staffMailInfo.Count > 0) {
|
|
|
+ if (staffMailInfo.Count > 0)
|
|
|
+ {
|
|
|
foreach (var key in staffMailInfo.Keys)
|
|
|
{
|
|
|
Staff staff = key as Staff;
|
|
|
List<mailCaseInfo> mailCases = (List<mailCaseInfo>)staffMailInfo[key];
|
|
|
|
|
|
-
|
|
|
- string strMessage = string.Empty ;
|
|
|
- foreach(var m in mailCases)
|
|
|
+
|
|
|
+ string strMessage = string.Empty;
|
|
|
+ foreach (var m in mailCases)
|
|
|
{
|
|
|
if ((m.Top10Cases != null && m.Top10Cases.Count > 0) || (m.AbnormalCases != null && m.AbnormalCases.Count > 0))
|
|
|
{
|
|
|
@@ -615,7 +623,7 @@ namespace wispro.sp.api.Controllers
|
|
|
strMessage += "<table border='1'><thead><td>案号</td><td>案件名称</td><td>处理人</td><td>核稿人</td><td>内部核稿修改率(%)</td><td>外部核稿修改率(%)</td></thead><body>";
|
|
|
foreach (var c in m.Top10Cases)
|
|
|
{
|
|
|
- strMessage += $"<tr><td><a href=\"{($"http://1.116.113.26/CompareFile/detail/{c.CaseNo}")}\">{c.CaseNo}</a></td><td>{c.CaseName}</td><td>{c.Handlers}</td><td>{(c.Reviewer == null ? "" : c.Reviewer.Name)}</td><td>{(c.DRRCalim == null ? "" : (c.DRRCalim.diffRate*100).ToString("0.0000"))}</td><td>{(c.RFRCalim == null ? "" : (c.RFRCalim.diffRate * 100).ToString("0.0000"))}</td></tr>";
|
|
|
+ strMessage += $"<tr><td><a href=\"{($"http://1.116.113.26/CompareFile/detail/{c.CaseNo}")}\">{c.CaseNo}</a></td><td>{c.CaseName}</td><td>{c.Handlers}</td><td>{(c.Reviewer == null ? "" : c.Reviewer.Name)}</td><td>{(c.DRRCalim == null ? "" : (c.DRRCalim.diffRate * 100).ToString("0.0000"))}</td><td>{(c.RFRCalim == null ? "" : (c.RFRCalim.diffRate * 100).ToString("0.0000"))}</td></tr>";
|
|
|
}
|
|
|
strMessage += "</body></table>";
|
|
|
}
|
|
|
@@ -626,14 +634,14 @@ namespace wispro.sp.api.Controllers
|
|
|
strMessage += "<table border='1'><thead><td>案号</td><td>案件名称</td><td>处理人</td><td>核稿人</td><td>内部核稿修改率</td><td>外部核稿修改率</td><td>异常说明</td></thead><body>";
|
|
|
foreach (var c in m.AbnormalCases)
|
|
|
{
|
|
|
- strMessage += $"<tr><td><a href=\"{($"http://1.116.113.26/CompareFile/detail/{c.CaseNo}")}\">{c.CaseNo}</a></td><td>{c.CaseName}</td><td>{c.Handlers}</td><td>{(c.Reviewer == null ? "" : c.Reviewer.Name)}</td><td>{(c.DRRCalim == null ? "" : (c.DRRCalim.diffRate*100).ToString("0.0000"))}</td><td>{(c.RFRCalim == null ? "" : (c.RFRCalim.diffRate*100).ToString("0.0000"))}</td><td>{c.AbnormalMessage}</td></tr>";
|
|
|
+ strMessage += $"<tr><td><a href=\"{($"http://1.116.113.26/CompareFile/detail/{c.CaseNo}")}\">{c.CaseNo}</a></td><td>{c.CaseName}</td><td>{c.Handlers}</td><td>{(c.Reviewer == null ? "" : c.Reviewer.Name)}</td><td>{(c.DRRCalim == null ? "" : (c.DRRCalim.diffRate * 100).ToString("0.0000"))}</td><td>{(c.RFRCalim == null ? "" : (c.RFRCalim.diffRate * 100).ToString("0.0000"))}</td><td>{c.AbnormalMessage}</td></tr>";
|
|
|
}
|
|
|
strMessage += "</body></table><br/>";
|
|
|
}
|
|
|
|
|
|
strMessage += "</div>";
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
string strTem = $"如下是{start.ToString("yyyy-MM-dd")}到{end.ToString("yyyy-MM-dd")}国内专利申请案件在客户核稿处于年内修改率前10名的案件和疑似异常案件清单,请关注!";
|
|
|
@@ -645,7 +653,7 @@ namespace wispro.sp.api.Controllers
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void AddtoHashTable(CaseInfo caseInfo, int v, Staff staff, Hashtable staffMailInfo,CustomerCompareStatistics cStatics)
|
|
|
+ private void AddtoHashTable(CaseInfo caseInfo, int v, Staff staff, Hashtable staffMailInfo, CustomerCompareStatistics cStatics)
|
|
|
{
|
|
|
var staffCaseMailInfo = new mailCaseInfo()
|
|
|
{
|
|
|
@@ -659,7 +667,7 @@ namespace wispro.sp.api.Controllers
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- staffMailInfo.Add(staff,staffCaseMailInfos);
|
|
|
+ staffMailInfo.Add(staff, staffCaseMailInfos);
|
|
|
}
|
|
|
|
|
|
var temObj = staffCaseMailInfos.Where(p => p.CustomerCompareStatistics.CustomerName == caseInfo.Customer.Name).FirstOrDefault();
|
|
|
@@ -715,7 +723,7 @@ namespace wispro.sp.api.Controllers
|
|
|
|
|
|
}
|
|
|
|
|
|
- private DataTable CoverttoDatable(List<retObject> ObjList)
|
|
|
+ private DataTable CoverttoDatable(List<retObject> ObjList)
|
|
|
{
|
|
|
System.Data.DataTable dt = new System.Data.DataTable();
|
|
|
dt.Columns.Add("我方文号");
|
|
|
@@ -774,14 +782,14 @@ namespace wispro.sp.api.Controllers
|
|
|
/// 4: 基于权要文字修改差异度计算
|
|
|
/// </param>
|
|
|
/// <returns></returns>
|
|
|
- private IList<retObject> CalCustomer_mean(DateTime start,DateTime end,int type=0)
|
|
|
+ private IList<retObject> CalCustomer_mean(DateTime start, DateTime end, int type = 0)
|
|
|
{
|
|
|
|
|
|
var caseList = Context.CaseInfos.Where<CaseInfo>(
|
|
|
p => p.CreateTime >= start && p.CreateTime < end)
|
|
|
- .Include(p=>p.Customer)
|
|
|
- .Include(p=>p.Reviewer)
|
|
|
- .Include(p=>p.DRRAbstract)
|
|
|
+ .Include(p => p.Customer)
|
|
|
+ .Include(p => p.Reviewer)
|
|
|
+ .Include(p => p.DRRAbstract)
|
|
|
.Include(p => p.DRRAbstract)
|
|
|
.Include(p => p.DRRCalim)
|
|
|
.Include(p => p.DRRFulltext)
|
|
|
@@ -804,11 +812,11 @@ namespace wispro.sp.api.Controllers
|
|
|
iIndex++;
|
|
|
Debug.WriteLine($"{iIndex}/{iTotals}\t{caseInfo.CaseNo}\t{caseInfo.DRRAbstractId},{caseInfo.DRRCalimId},{caseInfo.DRRFulltextId},{caseInfo.DRRAllId},{caseInfo.RFRAbstractId},{caseInfo.RFRCalimId},{caseInfo.RFRFulltextId},{caseInfo.RFRAllId}");
|
|
|
string tmpCustomerName = "未知";
|
|
|
- if(caseInfo.Customer!= null)
|
|
|
+ if (caseInfo.Customer != null)
|
|
|
{
|
|
|
tmpCustomerName = caseInfo.Customer.Name;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
var one = avg_std1.Where<CustomerAvg_Std>(p => p.Name == tmpCustomerName).FirstOrDefault();
|
|
|
if (one == null)
|
|
|
{
|
|
|
@@ -823,7 +831,7 @@ namespace wispro.sp.api.Controllers
|
|
|
}
|
|
|
|
|
|
double? oneTmp = getCalValue(caseInfo, type, 0);
|
|
|
- if(oneTmp != null)
|
|
|
+ if (oneTmp != null)
|
|
|
{
|
|
|
one.Sum += oneTmp.Value;
|
|
|
one.SquareSum += oneTmp.Value * oneTmp.Value;
|
|
|
@@ -850,7 +858,7 @@ namespace wispro.sp.api.Controllers
|
|
|
var one = avg_std1.Where<CustomerAvg_Std>(p => p.Name == tmpCustomerName).FirstOrDefault();
|
|
|
var two = avg_std2.Where<CustomerAvg_Std>(p => p.Name == tmpCustomerName).FirstOrDefault();
|
|
|
|
|
|
- double? oneSim = getCalValue(item,type,0);
|
|
|
+ double? oneSim = getCalValue(item, type, 0);
|
|
|
double? twoSim = getCalValue(item, type, 1);
|
|
|
temObj.FinishedDate = item.CreateTime;
|
|
|
|
|
|
@@ -864,19 +872,19 @@ namespace wispro.sp.api.Controllers
|
|
|
if (oneSim != null)
|
|
|
{
|
|
|
zScoreA = (oneSim - one.Average) / one.Std_Deviation;
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
temObj.InternalScore = zScoreA;
|
|
|
temObj.InternalSim = oneSim;
|
|
|
temObj.InternalAvg = one.Average;
|
|
|
temObj.InternalStd = one.Std_Deviation;
|
|
|
-
|
|
|
+
|
|
|
double? zScoreB = null;
|
|
|
if (twoSim != null)
|
|
|
{
|
|
|
zScoreB = (twoSim - two.Average) / two.Std_Deviation;
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
temObj.CustomerSim = twoSim;
|
|
|
temObj.CustomerAvg = two.Average;
|
|
|
@@ -891,7 +899,7 @@ namespace wispro.sp.api.Controllers
|
|
|
{
|
|
|
var distince = Math.Sqrt(zScoreB.Value * zScoreB.Value + zScoreA.Value * zScoreA.Value);
|
|
|
|
|
|
- if (type == 0 || type == 2 || type==3)
|
|
|
+ if (type == 0 || type == 2 || type == 3)
|
|
|
{
|
|
|
if (distince > 3)
|
|
|
{
|
|
|
@@ -948,12 +956,12 @@ namespace wispro.sp.api.Controllers
|
|
|
retList.Add(temObj);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
//wispro.sp.utility.NPOIExcel.DataTableToExcel(dt,$"c:\\temp\\{DateTime.Now.ToString("yyyyMMdd")}-内部核稿外部核稿情况案件清单_{typeName(type)}.xlsx");
|
|
|
return retList;
|
|
|
}
|
|
|
|
|
|
- public void MonthlyReport(int year,int month)
|
|
|
+ public void MonthlyReport(int year, int month)
|
|
|
{
|
|
|
#region 获取一年的案件清单,并计算个案件的清单
|
|
|
DateTime endDate = new DateTime(year, month + 1, 1);
|
|
|
@@ -1059,12 +1067,12 @@ namespace wispro.sp.api.Controllers
|
|
|
#endregion
|
|
|
}
|
|
|
|
|
|
- SendMail(year, month, reviewerHash,"核稿");
|
|
|
+ SendMail(year, month, reviewerHash, "核稿");
|
|
|
|
|
|
SendMail(year, month, crHash, "对接客户");
|
|
|
|
|
|
SendMail(year, month, dphash, "部门人员处理");
|
|
|
-
|
|
|
+
|
|
|
|
|
|
DataTable dt = CoverttoDatable(top10List);
|
|
|
string top10_filePath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), $"{year}年{month}月客户修改权要排名前10的案件清单.xlsx");
|
|
|
@@ -1089,7 +1097,7 @@ namespace wispro.sp.api.Controllers
|
|
|
.ToList();
|
|
|
DataTable alldt = CoverttoDatable(allItemList);
|
|
|
|
|
|
- string all_filePath = System.IO.Path.Combine(System.IO.Path.GetTempPath(),$"{year}年{month}月案件清单.xlsx");
|
|
|
+ string all_filePath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), $"{year}年{month}月案件清单.xlsx");
|
|
|
utility.NPOIExcel.DataTableToExcel(alldt, all_filePath, true, true, 0, "http://1.116.113.26/CompareFile/detail/{0}");
|
|
|
|
|
|
#endregion
|
|
|
@@ -1102,7 +1110,7 @@ namespace wispro.sp.api.Controllers
|
|
|
#endregion
|
|
|
}
|
|
|
|
|
|
- private void SendMail(int year, int month, Hashtable objHash,string type)
|
|
|
+ private void SendMail(int year, int month, Hashtable objHash, string type)
|
|
|
{
|
|
|
foreach (Staff sf in objHash.Keys)
|
|
|
{
|
|
|
@@ -1111,26 +1119,26 @@ namespace wispro.sp.api.Controllers
|
|
|
string strPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), $"{year}年{month}月客户修改权要排名前10的案件清单({type})_{sf.Name}.xlsx");
|
|
|
utility.NPOIExcel.DataTableToExcel(temdt, strPath, true, true, 0, "http://1.116.113.26/CompareFile/detail/{0}");
|
|
|
string strBody = $"{sf.Name},你好!<br>附件中的案件是{year}年{month}月您{type}的案件,客户权要修改率在前10的案件,请注意!";
|
|
|
-
|
|
|
+
|
|
|
_ = QuartzUtil.AddMailJob($"{year}年{month}月申请文件比较邮件", strBody, sf.Name, sf.Mail, $"{strPath}");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private double? getCalValue(CaseInfo caseInfo,int type,int stage)
|
|
|
+ private double? getCalValue(CaseInfo caseInfo, int type, int stage)
|
|
|
{
|
|
|
double? calValue = null;
|
|
|
switch (type)
|
|
|
{
|
|
|
case 0:
|
|
|
- if(stage == 0)
|
|
|
+ if (stage == 0)
|
|
|
{
|
|
|
- if(caseInfo.DRRFulltext != null && caseInfo.DRRAbstract != null)
|
|
|
+ if (caseInfo.DRRFulltext != null && caseInfo.DRRAbstract != null)
|
|
|
{
|
|
|
calValue = caseInfo.DRRAll.TextSimilarity;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if(caseInfo.DRRCalim != null)
|
|
|
+ if (caseInfo.DRRCalim != null)
|
|
|
{
|
|
|
calValue = caseInfo.DRRCalim.TextSimilarity;
|
|
|
}
|
|
|
@@ -1184,19 +1192,19 @@ namespace wispro.sp.api.Controllers
|
|
|
case 2:
|
|
|
if (stage == 0)
|
|
|
{
|
|
|
- if(caseInfo.DRRFulltext != null && caseInfo.DRRCalim!= null)
|
|
|
+ if (caseInfo.DRRFulltext != null && caseInfo.DRRCalim != null)
|
|
|
{
|
|
|
calValue = caseInfo.DRRCalim.TextSimilarity * 0.7 + caseInfo.DRRFulltext.TextSimilarity * 0.3;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if( caseInfo.DRRCalim != null)
|
|
|
+ if (caseInfo.DRRCalim != null)
|
|
|
{
|
|
|
calValue = caseInfo.DRRCalim.TextSimilarity;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if(caseInfo.DRRAll != null)
|
|
|
+ if (caseInfo.DRRAll != null)
|
|
|
{
|
|
|
calValue = caseInfo.DRRAll.TextSimilarity;
|
|
|
}
|
|
|
@@ -1228,7 +1236,7 @@ namespace wispro.sp.api.Controllers
|
|
|
case 3:
|
|
|
if (stage == 0)
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
if (caseInfo.DRRCalim != null)
|
|
|
{
|
|
|
calValue = caseInfo.DRRCalim.TextSimilarity;
|
|
|
@@ -1283,20 +1291,20 @@ namespace wispro.sp.api.Controllers
|
|
|
}
|
|
|
|
|
|
|
|
|
- public IList<Object> CalMean_Std(DateTime start,DateTime end)
|
|
|
+ public IList<Object> CalMean_Std(DateTime start, DateTime end)
|
|
|
{
|
|
|
double AverageA = Context.CaseInfos.Where<CaseInfo>(
|
|
|
- p => p.FinalVersionDate >= start && p.FinalVersionDate <= end && p.DRRCalim!= null)
|
|
|
- .Average(x=>x.DRRCalim.TextSimilarity);
|
|
|
-
|
|
|
+ p => p.FinalVersionDate >= start && p.FinalVersionDate <= end && p.DRRCalim != null)
|
|
|
+ .Average(x => x.DRRCalim.TextSimilarity);
|
|
|
+
|
|
|
double AverageB = Context.CaseInfos.Where<CaseInfo>(
|
|
|
p => p.FinalVersionDate >= start && p.FinalVersionDate <= end && p.RFRAll != null)
|
|
|
.Average(x => x.RFRAll.TextSimilarity);
|
|
|
|
|
|
- double stdA = Math.Sqrt( Context.CaseInfos.Where<CaseInfo>(
|
|
|
+ double stdA = Math.Sqrt(Context.CaseInfos.Where<CaseInfo>(
|
|
|
p => p.FinalVersionDate >= start && p.FinalVersionDate <= end)
|
|
|
.Average((x => (x.DRRCalim.TextSimilarity - AverageA) * (x.DRRCalim.TextSimilarity - AverageA))));
|
|
|
-
|
|
|
+
|
|
|
|
|
|
double stdB = Math.Sqrt(Context.CaseInfos.Where<CaseInfo>(
|
|
|
p => p.FinalVersionDate >= start && p.FinalVersionDate <= end)
|
|
|
@@ -1304,23 +1312,24 @@ namespace wispro.sp.api.Controllers
|
|
|
|
|
|
var response2 = Context.CaseInfos.Where<CaseInfo>(
|
|
|
p => p.FinalVersionDate >= start && p.FinalVersionDate <= end)
|
|
|
- .Include(p=>p.DRRCalim)
|
|
|
- .Include(p=>p.RFRAll);
|
|
|
-
|
|
|
+ .Include(p => p.DRRCalim)
|
|
|
+ .Include(p => p.RFRAll);
|
|
|
+
|
|
|
IList<Object> results = new List<Object>();
|
|
|
- foreach(var item in response2.ToList())
|
|
|
+ foreach (var item in response2.ToList())
|
|
|
{
|
|
|
results.Add(
|
|
|
- new {
|
|
|
+ new
|
|
|
+ {
|
|
|
Id = item.Id,
|
|
|
CaseNo = item.CaseNo,
|
|
|
CaseName = item.CaseName,
|
|
|
Customer = item.Customer,
|
|
|
Reviewer = item.Reviewer,
|
|
|
Handlers = item.Handlers,
|
|
|
- zScoreA = (item.DRRCalim?.TextSimilarity -AverageA)/stdA,
|
|
|
- zScoreB = (item.RFRAll?.TextSimilarity - AverageB) /stdB
|
|
|
- }
|
|
|
+ zScoreA = (item.DRRCalim?.TextSimilarity - AverageA) / stdA,
|
|
|
+ zScoreB = (item.RFRAll?.TextSimilarity - AverageB) / stdB
|
|
|
+ }
|
|
|
);
|
|
|
}
|
|
|
|
|
|
@@ -1357,7 +1366,7 @@ namespace wispro.sp.api.Controllers
|
|
|
private IQueryable<CaseInfo> NewMethod(QueryFilter queryFilter)
|
|
|
{
|
|
|
string strExpress = "";
|
|
|
-
|
|
|
+
|
|
|
if (queryFilter.ConditionTree != null)
|
|
|
{
|
|
|
strExpress = GetExpress(queryFilter.ConditionTree);
|
|
|
@@ -1366,7 +1375,7 @@ namespace wispro.sp.api.Controllers
|
|
|
var interpreter = new Interpreter();
|
|
|
if (string.IsNullOrEmpty(strExpress))
|
|
|
{
|
|
|
- return new spDbContext().CaseInfos.Where<CaseInfo>(p=>(p.Id>0));
|
|
|
+ return new spDbContext().CaseInfos.Where<CaseInfo>(p => (p.Id > 0));
|
|
|
}
|
|
|
else
|
|
|
{
|