移交管理优化:子项完成状态判断逻辑调整;
This commit is contained in:
@@ -183,6 +183,187 @@ where f.ProjectId = @ProjectId";
|
||||
DataTable tb = DataSql();
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
// 添加管道焊接信息
|
||||
DataColumn StrTotalFactor = new DataColumn("StrTotalFactor", typeof(string));
|
||||
DataColumn StrCompleteFactor = new DataColumn("StrCompleteFactor", typeof(string));
|
||||
DataColumn StrCompleteProportion = new DataColumn("StrCompleteProportion", typeof(string));
|
||||
table.Columns.Add(StrTotalFactor);
|
||||
table.Columns.Add(StrCompleteFactor);
|
||||
table.Columns.Add(StrCompleteProportion);
|
||||
// 添加管道试压包
|
||||
DataColumn StrPipingCount = new DataColumn("StrPipingCount", typeof(string));
|
||||
DataColumn StrPipingScount = new DataColumn("StrPipingScount", typeof(string));
|
||||
DataColumn StrPipingPercent = new DataColumn("StrPipingPercent", typeof(string));
|
||||
table.Columns.Add(StrPipingCount);
|
||||
table.Columns.Add(StrPipingScount);
|
||||
table.Columns.Add(StrPipingPercent);
|
||||
// 管道冲洗吹扫&复位信息
|
||||
DataColumn StrReinstateCount = new DataColumn("StrReinstateCount", typeof(string));
|
||||
DataColumn StrReinstateScount = new DataColumn("StrReinstateScount", typeof(string));
|
||||
DataColumn StrReinstatePercent = new DataColumn("StrReinstatePercent", typeof(string));
|
||||
table.Columns.Add(StrReinstateCount);
|
||||
table.Columns.Add(StrReinstateScount);
|
||||
table.Columns.Add(StrReinstatePercent);
|
||||
// 设备测试包
|
||||
DataColumn StrEqCount = new DataColumn("StrEqCount", typeof(string));
|
||||
DataColumn StrEqSCount = new DataColumn("StrEqSCount", typeof(string));
|
||||
DataColumn StrEqPercent = new DataColumn("StrEqPercent", typeof(string));
|
||||
table.Columns.Add(StrEqCount);
|
||||
table.Columns.Add(StrEqSCount);
|
||||
table.Columns.Add(StrEqPercent);
|
||||
// 电气测试包
|
||||
DataColumn StrTeCount = new DataColumn("StrTeCount", typeof(string));
|
||||
DataColumn StrTeScount = new DataColumn("StrTeScount", typeof(string));
|
||||
DataColumn StrTePercent = new DataColumn("StrTePercent", typeof(string));
|
||||
table.Columns.Add(StrTeCount);
|
||||
table.Columns.Add(StrTeScount);
|
||||
table.Columns.Add(StrTePercent);
|
||||
// 仪表测试包
|
||||
DataColumn StrTiCount = new DataColumn("StrTiCount", typeof(string));
|
||||
DataColumn StrTiScount = new DataColumn("StrTiScount", typeof(string));
|
||||
DataColumn StrTiPercent = new DataColumn("StrTiPercent", typeof(string));
|
||||
table.Columns.Add(StrTiCount);
|
||||
table.Columns.Add(StrTiScount);
|
||||
table.Columns.Add(StrTiPercent);
|
||||
// 土建/建筑/结构测试包
|
||||
DataColumn StrTcsCount = new DataColumn("StrTcsCount", typeof(string));
|
||||
DataColumn StrTcsScount = new DataColumn("StrTcsScount", typeof(string));
|
||||
DataColumn StrTcsPercent = new DataColumn("StrTcsPercent", typeof(string));
|
||||
table.Columns.Add(StrTcsCount);
|
||||
table.Columns.Add(StrTcsScount);
|
||||
table.Columns.Add(StrTcsPercent);
|
||||
// 电信测试包
|
||||
DataColumn StrTtCount = new DataColumn("StrTtCount", typeof(string));
|
||||
DataColumn StrTtScount = new DataColumn("StrTtScount", typeof(string));
|
||||
DataColumn StrTtPercent = new DataColumn("StrTtPercent", typeof(string));
|
||||
table.Columns.Add(StrTtCount);
|
||||
table.Columns.Add(StrTtScount);
|
||||
table.Columns.Add(StrTtPercent);
|
||||
|
||||
// 遍历所有行
|
||||
foreach (DataRow row in table.Rows)
|
||||
{
|
||||
//管道焊接信息-总达因数
|
||||
//string TotalFactor = row["TotalFactor"].ToString();
|
||||
//if (string.IsNullOrWhiteSpace(TotalFactor) || TotalFactor == "0.0" || TotalFactor == "0")
|
||||
if (string.IsNullOrWhiteSpace(row["TotalFactor"].ToString()) || (decimal)row["TotalFactor"] == 0)
|
||||
{
|
||||
row["StrTotalFactor"] = "NA";
|
||||
row["StrCompleteFactor"] = "NA";
|
||||
row["StrCompleteProportion"] = "NA";
|
||||
}
|
||||
else
|
||||
{
|
||||
row["StrTotalFactor"] = row["TotalFactor"].ToString();
|
||||
row["StrCompleteFactor"] = row["CompleteFactor"].ToString();
|
||||
row["StrCompleteProportion"] = row["CompleteProportion"].ToString();
|
||||
}
|
||||
//管道试压包
|
||||
//string PipingCount = row["PipingCount"].ToString();
|
||||
//if (string.IsNullOrWhiteSpace(PipingCount) || PipingCount == "0.0" || PipingCount == "0")
|
||||
if (string.IsNullOrWhiteSpace(row["PipingCount"].ToString()) || (int)row["PipingCount"] == 0)
|
||||
{
|
||||
row["StrPipingCount"] = "NA";
|
||||
row["StrPipingScount"] = "NA";
|
||||
row["StrPipingPercent"] = "NA";
|
||||
}
|
||||
else
|
||||
{
|
||||
row["StrPipingCount"] = row["PipingCount"].ToString();
|
||||
row["StrPipingScount"] = row["PipingScount"].ToString();
|
||||
row["StrPipingPercent"] = row["PipingPercent"].ToString();
|
||||
}
|
||||
//管道冲洗吹扫&复位信息
|
||||
//string ReinstateCount = row["ReinstateCount"].ToString();
|
||||
//if (string.IsNullOrWhiteSpace(ReinstateCount) || ReinstateCount == "0.0" || ReinstateCount == "0")
|
||||
if (string.IsNullOrWhiteSpace(row["ReinstateCount"].ToString()) || (int)row["ReinstateCount"] == 0)
|
||||
{
|
||||
row["StrReinstateCount"] = "NA";
|
||||
row["StrReinstateScount"] = "NA";
|
||||
row["StrReinstatePercent"] = "NA";
|
||||
}
|
||||
else
|
||||
{
|
||||
row["StrReinstateCount"] = row["ReinstateCount"].ToString();
|
||||
row["StrReinstateScount"] = row["ReinstateScount"].ToString();
|
||||
row["StrReinstatePercent"] = row["ReinstatePercent"].ToString();
|
||||
}
|
||||
//设备测试包
|
||||
//string EqCount = row["EqCount"].ToString();
|
||||
//if (string.IsNullOrWhiteSpace(EqCount) || EqCount == "0.0" || EqCount == "0")
|
||||
if (string.IsNullOrWhiteSpace(row["EqCount"].ToString()) || (int)row["EqCount"] == 0)
|
||||
{
|
||||
row["StrEqCount"] = "NA";
|
||||
row["StrEqSCount"] = "NA";
|
||||
row["StrEqPercent"] = "NA";
|
||||
}
|
||||
else
|
||||
{
|
||||
row["StrEqCount"] = row["EqCount"].ToString();
|
||||
row["StrEqSCount"] = row["EqSCount"].ToString();
|
||||
row["StrEqPercent"] = row["EqPercent"].ToString();
|
||||
}
|
||||
//电气测试包
|
||||
//string TeCount = row["TeCount"].ToString();
|
||||
//if (string.IsNullOrWhiteSpace(TeCount) || TeCount == "0.0" || TeCount == "0")
|
||||
if (string.IsNullOrWhiteSpace(row["TeCount"].ToString()) || (int)row["TeCount"] == 0)
|
||||
{
|
||||
row["StrTeCount"] = "NA";
|
||||
row["StrTeScount"] = "NA";
|
||||
row["StrTePercent"] = "NA";
|
||||
}
|
||||
else
|
||||
{
|
||||
row["StrTeCount"] = row["TeCount"].ToString();
|
||||
row["StrTeScount"] = row["TeScount"].ToString();
|
||||
row["StrTePercent"] = row["TePercent"].ToString();
|
||||
}
|
||||
//仪表测试包
|
||||
//string TiCount = row["TiCount"].ToString();
|
||||
//if (string.IsNullOrWhiteSpace(TiCount) || TiCount == "0.0" || TiCount == "0")
|
||||
if (string.IsNullOrWhiteSpace(row["TiCount"].ToString()) || (int)row["TiCount"] == 0)
|
||||
{
|
||||
row["StrTiCount"] = "NA";
|
||||
row["StrTiScount"] = "NA";
|
||||
row["StrTiPercent"] = "NA";
|
||||
}
|
||||
else
|
||||
{
|
||||
row["StrTiCount"] = row["TiCount"].ToString();
|
||||
row["StrTiScount"] = row["TiScount"].ToString();
|
||||
row["StrTiPercent"] = row["TiPercent"].ToString();
|
||||
}
|
||||
//土建/建筑/结构测试包
|
||||
//string TcsCount = row["TcsCount"].ToString();
|
||||
//if (string.IsNullOrWhiteSpace(TcsCount) || TcsCount == "0.0" || TcsCount == "0")
|
||||
if (string.IsNullOrWhiteSpace(row["TcsCount"].ToString()) || (int)row["TcsCount"] == 0)
|
||||
{
|
||||
row["StrTcsCount"] = "NA";
|
||||
row["StrTcsScount"] = "NA";
|
||||
row["StrTcsPercent"] = "NA";
|
||||
}
|
||||
else
|
||||
{
|
||||
row["StrTcsCount"] = row["TcsCount"].ToString();
|
||||
row["StrTcsScount"] = row["TcsScount"].ToString();
|
||||
row["StrTcsPercent"] = row["TcsPercent"].ToString();
|
||||
}
|
||||
//电信测试包
|
||||
//string TtCount = row["TtCount"].ToString();
|
||||
//if (string.IsNullOrWhiteSpace(TtCount) || TtCount == "0.0" || TtCount == "0")
|
||||
if (string.IsNullOrWhiteSpace(row["TtCount"].ToString()) || (int)row["TtCount"] == 0)
|
||||
{
|
||||
row["StrTtCount"] = "NA";
|
||||
row["StrTtScount"] = "NA";
|
||||
row["StrTtPercent"] = "NA";
|
||||
}
|
||||
else
|
||||
{
|
||||
row["StrTtCount"] = row["TtCount"].ToString();
|
||||
row["StrTtScount"] = row["TtScount"].ToString();
|
||||
row["StrTtPercent"] = row["TtPercent"].ToString();
|
||||
}
|
||||
}
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
@@ -260,7 +441,7 @@ where f.ProjectId = @ProjectId";
|
||||
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
string SystemNo = Grid1.SelectedRowID;
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SystemstatusEdit.aspx?SystemNo={0}", SystemNo, "编辑 - ")));
|
||||
}
|
||||
@@ -284,27 +465,42 @@ where f.ProjectId = @ProjectId";
|
||||
var scode = systemNo.ToString();
|
||||
//根据systemNo和projectid获取所有数据 和完成的数据
|
||||
#region 九个表的数据
|
||||
var list1 = Funs.DB.Transfer_Piping.Where(x => x.ProjectId == pid && x.SYSTEM == scode).ToList();
|
||||
var list2 = Funs.DB.Transfer_StaticEquipment.Where(x => x.ProjectId == pid && x.SYSTEM == scode).ToList();
|
||||
var list3 = Funs.DB.Transfer_RotatingEquipment.Where(x => x.ProjectId == pid && x.SYSTEM == scode).ToList();
|
||||
var list4 = Funs.DB.Transfer_Instrumentation.Where(x => x.ProjectId == pid && x.SystemName == scode).ToList();
|
||||
var list5 = Funs.DB.Transfer_Electrical.Where(x => x.ProjectId == pid && x.SystemName == scode).ToList();
|
||||
var list6 = Funs.DB.Transfer_Civil_Structure.Where(x => x.ProjectId == pid && x.SystemName == scode).ToList();
|
||||
//var list7 = Funs.DB.Transfer_Firefighting.Where(x => x.ProjectId == pid && x.SystemName == scode).ToList();
|
||||
var list8 = Funs.DB.Transfer_Telecom.Where(x => x.ProjectId == pid && x.SystemName == scode).ToList();
|
||||
var list1 = Funs.DB.Transfer_Piping.Where(x => x.ProjectId == pid && x.TestPackage == scode).ToList();
|
||||
var list2 = Funs.DB.Transfer_StaticEquipment.Where(x => x.ProjectId == pid && x.TestPackage == scode).ToList();
|
||||
var list3 = Funs.DB.Transfer_RotatingEquipment.Where(x => x.ProjectId == pid && x.TestPackage == scode).ToList();
|
||||
var list4 = Funs.DB.Transfer_Instrumentation.Where(x => x.ProjectId == pid && x.Test_Package == scode).ToList();
|
||||
var list5 = Funs.DB.Transfer_Electrical.Where(x => x.ProjectId == pid && x.Test_Package == scode).ToList();
|
||||
var list6 = Funs.DB.Transfer_Civil_Structure.Where(x => x.ProjectId == pid && x.Test_Package == scode).ToList();
|
||||
//var list7 = Funs.DB.Transfer_Firefighting.Where(x => x.ProjectId == pid && x.Test_Package == scode).ToList();
|
||||
var list8 = Funs.DB.Transfer_Telecom.Where(x => x.ProjectId == pid && x.Test_Package == scode).ToList();
|
||||
#endregion
|
||||
|
||||
float allcount = (list1.Count + list2.Count + list3.Count + list4.Count +
|
||||
list5.Count + list6.Count + list8.Count);//list7.Count +
|
||||
//float allcount = (list1.Count + list2.Count + list3.Count + list4.Count +
|
||||
// list5.Count + list6.Count + list8.Count);//list7.Count +
|
||||
|
||||
float allScount = (list1.Where(x => x.FINALStatus == "Completed").ToList().Count + list2.Where(x => x.MechanicalFINALStatus == "Completed").ToList().Count
|
||||
+ list3.Where(x => x.MechanicalFINALStatus == "Completed").ToList().Count + list4.Where(x => x.FINAL_Status == "Completed").ToList().Count +
|
||||
list5.Where(x => x.FINAL_Status == "Completed").ToList().Count + list6.Where(x => x.FINAL_Status == "Completed").ToList().Count
|
||||
//float allScount = (list1.Where(x => x.FINALStatus == "Completed").ToList().Count + list2.Where(x => x.MechanicalFINALStatus == "Completed").ToList().Count
|
||||
// + list3.Where(x => x.MechanicalFINALStatus == "Completed").ToList().Count + list4.Where(x => x.FINAL_Status == "Completed").ToList().Count +
|
||||
// list5.Where(x => x.FINAL_Status == "Completed").ToList().Count + list6.Where(x => x.FINAL_Status == "Completed").ToList().Count
|
||||
// //+ list7.Where(x => x.FINAL_Status == "Completed").ToList().Count
|
||||
// + list8.Where(x => x.FINAL_Status == "Completed").ToList().Count
|
||||
// );
|
||||
|
||||
//Piping管道试压包和复位都要统计
|
||||
float allcount = (list1.Count + list1.Count + list2.Count + list3.Count + list4.Count +
|
||||
list5.Count + list6.Count + list8.Count);//list7.Count +
|
||||
|
||||
float allScount = (list1.Where(x => x.FINALStatus == "Completed").ToList().Count
|
||||
+ list1.Where(x => x.Reduction == "Completed").ToList().Count
|
||||
+ list2.Where(x => x.MechanicalFINALStatus == "Completed").ToList().Count
|
||||
+ list3.Where(x => x.MechanicalFINALStatus == "Completed").ToList().Count
|
||||
+ list4.Where(x => x.FINAL_Status == "Completed").ToList().Count +
|
||||
list5.Where(x => x.FINAL_Status == "Completed").ToList().Count
|
||||
+ list6.Where(x => x.FINAL_Status == "Completed").ToList().Count
|
||||
//+ list7.Where(x => x.FINAL_Status == "Completed").ToList().Count
|
||||
+ list8.Where(x => x.FINAL_Status == "Completed").ToList().Count
|
||||
);
|
||||
|
||||
if (Convert.ToInt32(allcount)==0)
|
||||
if (Convert.ToInt32(allcount) == 0)
|
||||
{
|
||||
return "0";
|
||||
}
|
||||
@@ -388,7 +584,7 @@ where f.ProjectId = @ProjectId";
|
||||
// {
|
||||
// html = (row.FindControl("lblPageIndex") as AspNet.Label).Text;
|
||||
// }
|
||||
|
||||
|
||||
// else if (column.ColumnID == "Count4")
|
||||
// {
|
||||
// html = (row.FindControl("Label5") as AspNet.Label).Text;
|
||||
@@ -400,7 +596,7 @@ where f.ProjectId = @ProjectId";
|
||||
// //}
|
||||
// sb.Append("</tr>");
|
||||
// }
|
||||
|
||||
|
||||
// sb.Append("</table>");
|
||||
|
||||
// return sb.ToString();
|
||||
|
||||
Reference in New Issue
Block a user