建筑行业报表

This commit is contained in:
geh
2025-09-02 10:13:15 +08:00
parent 1cce9ee9e2
commit 5c2ca7b809
26 changed files with 1013 additions and 666 deletions
@@ -414,49 +414,52 @@ namespace FineUIPro.Web.ZHGL.Information
private string AuditData()
{
string err = string.Empty;
Model.SUBQHSEDB 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 };
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;
}
}
}
// Model.SUBQHSEDB 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 };
// 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;
// }
// }
// if (list.Count() > 0)
// {
// decimal b = a / list.Count();
// if (d > b * 5)
// {
// err = name + "的总工时数超过前三个月平均值5倍,请核对后重新录入!";
// break;
// }
// }
// }
// }
return err;
}
#endregion