This commit is contained in:
parent
b812e6d931
commit
1ddcd34c8b
|
|
@ -414,49 +414,49 @@ namespace FineUIPro.Web.ZHGL.Information
|
|||
private string AuditData()
|
||||
{
|
||||
string err = string.Empty;
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var reports = from x in db.Information_MillionsMonthlyReport
|
||||
where x.FillingDate < DateTime.Now
|
||||
orderby x.FillingDate descending
|
||||
select x;
|
||||
if (!string.IsNullOrEmpty(this.MillionsMonthlyReportId))
|
||||
{
|
||||
reports = from x in reports
|
||||
where x.MillionsMonthlyReportId != this.MillionsMonthlyReportId
|
||||
orderby x.FillingDate descending
|
||||
select x;
|
||||
}
|
||||
var reportIds = reports.Select(x => x.MillionsMonthlyReportId).Take(3).ToList();
|
||||
//Model.SGGLDB db = Funs.DB;
|
||||
//var reports = from x in db.Information_MillionsMonthlyReport
|
||||
// where x.FillingDate < DateTime.Now
|
||||
// orderby x.FillingDate descending
|
||||
// select x;
|
||||
//if (!string.IsNullOrEmpty(this.MillionsMonthlyReportId))
|
||||
//{
|
||||
// reports = from x in reports
|
||||
// where x.MillionsMonthlyReportId != this.MillionsMonthlyReportId
|
||||
// orderby x.FillingDate descending
|
||||
// select x;
|
||||
//}
|
||||
//var reportIds = reports.Select(x => x.MillionsMonthlyReportId).Take(3).ToList();
|
||||
////var items = from x in db.Information_MillionsMonthlyReportItem
|
||||
//// where reportIds.Contains(x.MillionsMonthlyReportId)
|
||||
//// select new { x.Name, x.TotalWorkNum };
|
||||
//var items = from x in db.Information_MillionsMonthlyReportItem
|
||||
// where reportIds.Contains(x.MillionsMonthlyReportId)
|
||||
// select new { x.Name, x.TotalWorkNum };
|
||||
var items = from x in db.Information_MillionsMonthlyReportItem
|
||||
where reportIds.Contains(x.MillionsMonthlyReportId)
|
||||
select new { x.Name, x.TotalWorkNum };
|
||||
foreach (JObject mergedRow in Grid1.GetMergedData())
|
||||
{
|
||||
JObject values = mergedRow.Value<JObject>("values");
|
||||
if (!string.IsNullOrEmpty(values["Name"].ToString()) && !string.IsNullOrEmpty(values["TotalWorkNum"].ToString()))
|
||||
{
|
||||
string name = values.Value<string>("Name");
|
||||
decimal d = values.Value<decimal>("TotalWorkNum");
|
||||
var list = items.Where(x => x.Name == name);
|
||||
decimal a = 0;
|
||||
if (list.Count() > 0)
|
||||
{
|
||||
foreach (var item in list)
|
||||
{
|
||||
a += item.TotalWorkNum ?? 0;
|
||||
}
|
||||
decimal b = a / list.Count();
|
||||
if (d > b * 5)
|
||||
{
|
||||
err = name + "的总工时数超过前三个月平均值5倍,请核对后重新录入!";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//foreach (JObject mergedRow in Grid1.GetMergedData())
|
||||
//{
|
||||
// JObject values = mergedRow.Value<JObject>("values");
|
||||
// if (!string.IsNullOrEmpty(values["Name"].ToString()) && !string.IsNullOrEmpty(values["TotalWorkNum"].ToString()))
|
||||
// {
|
||||
// string name = values.Value<string>("Name");
|
||||
// decimal d = values.Value<decimal>("TotalWorkNum");
|
||||
// var list = items.Where(x => x.Name == name);
|
||||
// decimal a = 0;
|
||||
// if (list.Count() > 0)
|
||||
// {
|
||||
// foreach (var item in list)
|
||||
// {
|
||||
// a += item.TotalWorkNum ?? 0;
|
||||
// }
|
||||
// decimal b = a / list.Count();
|
||||
// if (d > b * 5)
|
||||
// {
|
||||
// err = name + "的总工时数超过前三个月平均值5倍,请核对后重新录入!";
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
return err;
|
||||
}
|
||||
#endregion
|
||||
|
|
|
|||
Loading…
Reference in New Issue