2023-11-11

This commit is contained in:
2023-11-11 16:02:42 +08:00
parent b2ffd4b8d0
commit 48dd589a7f
66 changed files with 2334 additions and 1232 deletions
@@ -1,5 +1,6 @@
using BLL;
using FineUIPro.Web.BaseInfo;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
@@ -25,7 +26,10 @@ namespace FineUIPro.Web.DataShow
BLL.ProjectService.InitProjectDropDownList(this.drpProject, true);
// 绑定表格t
BindGrid();
this.Panel1.Title = "质量验收数据(" + BLL.UnitService.GetUnitNameByUnitId(BLL.Const.UnitId_CD) + "";
// 合计
this.Panel1.Title = "质量验收数据(" + BLL.UnitService.GetUnitNameByUnitId(BLL.CommonService.GetThisUnitId()) + "";
}
}
#endregion
@@ -65,6 +69,7 @@ namespace FineUIPro.Web.DataShow
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
OutputSummaryData();
}
#region
@@ -128,6 +133,7 @@ namespace FineUIPro.Web.DataShow
private static IQueryable<Model.QualityAcceptanceItem> getDataItemLists = from x in Funs.DB.ProcessControl_InspectionManagementDetail
join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
join z in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals z.BreakdownProjectId
where x.CreateDate > Funs.minSysDate
select new Model.QualityAcceptanceItem
{
InspectionDetailId = x.InspectionDetailId,
@@ -204,5 +210,51 @@ namespace FineUIPro.Web.DataShow
}
return rate;
}
#region
private void OutputSummaryData()
{
string strSql = @"select a.ProjectId,a.ProjectCode, a.ProjectName,a.UnitId,isnull(Count1,0) as Count1,
isnull(Count2,0) as Count2
from Base_Project a
left join (select count(*) as Count1,z.ProjectId From ProcessControl_InspectionManagementDetail x
left join ProcessControl_InspectionManagement y on x.InspectionId=y.InspectionId
left join WBS_BreakdownProject z on x.ControlPointType=z.BreakdownProjectId group by z.ProjectId) as b
on a.ProjectId= b.ProjectId
left join (select count(*) as Count2,z.ProjectId,IsOnceQualified From ProcessControl_InspectionManagementDetail x
left join ProcessControl_InspectionManagement y on x.InspectionId=y.InspectionId
left join WBS_BreakdownProject z on x.ControlPointType=z.BreakdownProjectId
group by z.ProjectId,y.IsOnceQualified) as c
on a.ProjectId= c.ProjectId and IsOnceQualified=1
where ProjectState =1 and (ProjectState2 is null or ProjectState2 !=9) ";
List<SqlParameter> listStr = new List<SqlParameter>();
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
int Count1 = 0, Count2 = 0;
foreach (DataRow row in tb.Rows)
{
Count1 += Convert.ToInt32(row["Count1"]);
Count2 += Convert.ToInt32(row["Count2"]);
}
JObject summary = new JObject();
summary.Add("ProjectName", "合计:");
summary.Add("Count1", Count1.ToString());
summary.Add("Count2", Count2.ToString());
summary.Add("Count3", (Count1- Count2).ToString());
if (Count1 > 0)
{
summary.Add("Count4", Math.Round(Count2 * 1.0 / Count1 * 100, 2).ToString());
}
else
{
summary.Add("Count4", "0");
}
Grid1.SummaryData = summary;
}
#endregion
}
}