diff --git a/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs b/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs index 971b6d14..7e1a3aa5 100644 --- a/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs +++ b/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs @@ -62,11 +62,11 @@ namespace BLL x.SettledQuantity.Contains(table.SettledQuantity)) && (string.IsNullOrEmpty(table.ContractId) || x.ContractId.Contains(table.ContractId)) - + select x ; var model = q.ToList().OrderBy(x => x.SerialNumber, new CustomComparer()).ToList(); - return model; + return model; } /// @@ -200,7 +200,7 @@ namespace BLL table.SettledAmount = newtable.SettledAmount; table.ContractId = newtable.ContractId; table.ProjectId = newtable.ProjectId; - table.SerialNumber=newtable.SerialNumber; + table.SerialNumber = newtable.SerialNumber; Funs.DB.SubmitChanges(); } } @@ -216,7 +216,7 @@ namespace BLL Funs.DB.PHTGL_ContractTrack.DeleteOnSubmit(table); Funs.DB.SubmitChanges(); } - + } /// @@ -301,7 +301,7 @@ namespace BLL if (string.IsNullOrEmpty(item.ProjectCode)) continue; var phtglContractTrack = new PHTGL_ContractTrack { - MainItemCode=item.MainItemCode, + MainItemCode = item.MainItemCode, ProjectCode = item.ProjectCode, ContractId = contractid, ProjectId = projectid, @@ -481,7 +481,7 @@ namespace BLL if (subProjects.Count == 0) //未填分部工程 { int c = 1; - var contractTracks = getContractTracks.Where(x => x.MainItemCode == unitWork.MainItemCode && x.MajorName == proName); + var contractTracks = getContractTracks.Where(x => x.MainItemCode == unitWork.MainItemCode && x.MajorName == proName).OrderBy(x => x.SerialNumber); foreach (Model.PHTGL_ContractTrack item in contractTracks) { row = table.NewRow(); @@ -545,7 +545,7 @@ namespace BLL row[7] = subProject; table.Rows.Add(row); int d = 1; - var contractTracks = getContractTracks.Where(x => x.MainItemCode == unitWork.MainItemCode && x.MajorName == proName && x.SubProject == subProject); + var contractTracks = getContractTracks.Where(x => x.MainItemCode == unitWork.MainItemCode && x.MajorName == proName && x.SubProject == subProject).OrderBy(x => x.SerialNumber); foreach (Model.PHTGL_ContractTrack item in contractTracks) { row = table.NewRow(); @@ -640,11 +640,15 @@ namespace BLL where personLogIds.Contains(x.ConstructionLogId) select x; var unitWorks = (from x in getContractTracks - select new { MainItemCode = x.MainItemCode, MainItemName = x.MainItemName }).Distinct().ToList(); + select new { MainItemCode = x.MainItemCode, MainItemName = x.MainItemName }).Distinct().OrderBy(x => x.MainItemCode).ToList(); DataTable table = new DataTable(); table.Columns.Add(new DataColumn("Id", typeof(String))); table.Columns.Add(new DataColumn("Code", typeof(String))); + table.Columns.Add(new DataColumn("MainItemCode", typeof(String))); + table.Columns.Add(new DataColumn("MainItemName", typeof(String))); + table.Columns.Add(new DataColumn("MajorCode", typeof(String))); + table.Columns.Add(new DataColumn("MajorName", typeof(String))); table.Columns.Add(new DataColumn("ProjectCode", typeof(String))); table.Columns.Add(new DataColumn("ProjectName", typeof(String))); table.Columns.Add(new DataColumn("UnitOfMeasurement", typeof(String))); @@ -738,7 +742,7 @@ namespace BLL row = table.NewRow(); row[0] = unitWork.MainItemCode; row[1] = a; - row[2] = string.Empty; + row[2] = unitWork.MainItemCode; row[3] = unitWork.MainItemName; table.Rows.Add(row); int b = 1; @@ -748,76 +752,170 @@ namespace BLL row[0] = unitWork.MainItemCode + b.ToString(); row[1] = a + "." + b; row[2] = string.Empty; - row[3] = proName; - table.Rows.Add(row); - int c = 1; - var contractTracks = getContractTracks.Where(x => x.MainItemCode == unitWork.MainItemCode && x.MajorName == proName); - foreach (Model.PHTGL_ContractTrack item in contractTracks) + row[3] = string.Empty; + var pro = pros.FirstOrDefault(x => x.Value == proName); + if (pro != null) { - row = table.NewRow(); - row[0] = item.Id; - row[1] = a + "." + b + "." + c; - row[2] = item.ProjectCode; - row[3] = item.ProjectName; - row[4] = item.UnitOfMeasurement; - row[7] = item.Id; - if (workEfficiencys.Count() > 0) + row[4] = pro.Text; + } + row[5] = proName; + table.Rows.Add(row); + var subProjects = (from x in getContractTracks + where x.MainItemCode == unitWork.MainItemCode && x.MajorName == proName && x.SubProject != null + select x.SubProject).Distinct().ToList(); + if (subProjects.Count == 0) //未填分部工程 + { + int c = 1; + var contractTracks = getContractTracks.Where(x => x.MainItemCode == unitWork.MainItemCode && x.MajorName == proName).OrderBy(x => x.SerialNumber); + foreach (Model.PHTGL_ContractTrack item in contractTracks) { - var we = workEfficiencys.FirstOrDefault(x => x.ContractTrackId == item.Id); - if (we != null) + row = table.NewRow(); + row[0] = item.Id; + row[1] = a + "." + b + "." + c; + row[6] = item.ProjectCode; + row[7] = item.ProjectName; + row[8] = item.UnitOfMeasurement; + row[11] = item.Id; + if (workEfficiencys.Count() > 0) { - row[5] = we.PhysicalCompletionQuantity; - row[6] = we.MaterialConsumption; - } - for (int i = 0; i < workPostIds.Count; i++) - { - var workEfficiencyList = workEfficiencys.Where(x => x.Type == "Person" && x.TypeId == workPostIds[i] && x.ContractTrackId == item.Id); - if (workEfficiencyList.Count() > 0) + var we = workEfficiencys.FirstOrDefault(x => x.ContractTrackId == item.Id); + if (we != null) { - decimal d = 0; - foreach (var workEfficiency in workEfficiencyList) + row[9] = we.PhysicalCompletionQuantity; + row[10] = we.MaterialConsumption; + } + for (int i = 0; i < workPostIds.Count; i++) + { + var workEfficiencyList = workEfficiencys.Where(x => x.Type == "Person" && x.TypeId == workPostIds[i] && x.ContractTrackId == item.Id); + if (workEfficiencyList.Count() > 0) { - if (workEfficiency.ConsumeHours != null) + decimal d = 0; + foreach (var workEfficiency in workEfficiencyList) { - d += decimal.Round(Convert.ToDecimal(workEfficiency.ConsumeHours), 2); + if (workEfficiency.ConsumeHours != null) + { + d += decimal.Round(Convert.ToDecimal(workEfficiency.ConsumeHours), 2); + } + } + if (d > 0) + { + row[12 + i * 2] = decimal.Round(d, 2); + if (we.PhysicalCompletionQuantity != null && we.PhysicalCompletionQuantity > 0) + { + row[13 + i * 2] = decimal.Round(Convert.ToDecimal(we.PhysicalCompletionQuantity / d), 2); + } } } - if (d > 0) + } + for (int i = 0; i < machineIds.Count; i++) + { + var workEfficiencyList = workEfficiencys.Where(x => x.Type == "Machine" && x.TypeId == machineIds[i] && x.ContractTrackId == item.Id); + if (workEfficiencyList.Count() > 0) { - row[8 + i * 2] = decimal.Round(d, 2); - if (we.PhysicalCompletionQuantity != null && we.PhysicalCompletionQuantity > 0) + decimal d = 0; + foreach (var workEfficiency in workEfficiencyList) { - row[9 + i * 2] = decimal.Round(Convert.ToDecimal(we.PhysicalCompletionQuantity / d), 2); - } - } - } - } - for (int i = 0; i < machineIds.Count; i++) - { - var workEfficiencyList = workEfficiencys.Where(x => x.Type == "Machine" && x.TypeId == machineIds[i] && x.ContractTrackId == item.Id); - if (workEfficiencyList.Count() > 0) - { - decimal d = 0; - foreach (var workEfficiency in workEfficiencyList) - { - if (workEfficiency.ConsumeHours != null) - { - d += decimal.Round(Convert.ToDecimal(workEfficiency.ConsumeHours), 2); - } - } - if (d > 0) - { - row[48 + i * 2] = decimal.Round(d, 2); - if (we.PhysicalCompletionQuantity != null && we.PhysicalCompletionQuantity > 0) - { - row[49 + i * 2] = decimal.Round(Convert.ToDecimal(we.PhysicalCompletionQuantity / d), 2); + if (workEfficiency.ConsumeHours != null) + { + d += decimal.Round(Convert.ToDecimal(workEfficiency.ConsumeHours), 2); + } + } + if (d > 0) + { + row[52 + i * 2] = decimal.Round(d, 2); + if (we.PhysicalCompletionQuantity != null && we.PhysicalCompletionQuantity > 0) + { + row[53 + i * 2] = decimal.Round(Convert.ToDecimal(we.PhysicalCompletionQuantity / d), 2); + } } } } } + table.Rows.Add(row); + c++; + } + } + else //存在分部工程 + { + int c = 1; + foreach (var subProject in subProjects) + { + row = table.NewRow(); + row[0] = unitWork.MainItemCode + b.ToString() + c.ToString(); + row[1] = a + "." + b + "." + c; + row[7] = subProject; + table.Rows.Add(row); + int f = 1; + var contractTracks = getContractTracks.Where(x => x.MainItemCode == unitWork.MainItemCode && x.MajorName == proName && x.SubProject == subProject).OrderBy(x => x.SerialNumber); + foreach (Model.PHTGL_ContractTrack item in contractTracks) + { + row = table.NewRow(); + row[0] = item.Id; + row[1] = a + "." + b + "." + c + "." + f; + row[6] = item.ProjectCode; + row[7] = item.ProjectName; + row[8] = item.UnitOfMeasurement; + row[11] = item.Id; + if (workEfficiencys.Count() > 0) + { + var we = workEfficiencys.FirstOrDefault(x => x.ContractTrackId == item.Id); + if (we != null) + { + row[9] = we.PhysicalCompletionQuantity; + row[10] = we.MaterialConsumption; + } + for (int i = 0; i < workPostIds.Count; i++) + { + var workEfficiencyList = workEfficiencys.Where(x => x.Type == "Person" && x.TypeId == workPostIds[i] && x.ContractTrackId == item.Id); + if (workEfficiencyList.Count() > 0) + { + decimal d = 0; + foreach (var workEfficiency in workEfficiencyList) + { + if (workEfficiency.ConsumeHours != null) + { + d += decimal.Round(Convert.ToDecimal(workEfficiency.ConsumeHours), 2); + } + } + if (d > 0) + { + row[12 + i * 2] = decimal.Round(d, 2); + if (we.PhysicalCompletionQuantity != null && we.PhysicalCompletionQuantity > 0) + { + row[13 + i * 2] = decimal.Round(Convert.ToDecimal(we.PhysicalCompletionQuantity / d), 2); + } + } + } + } + for (int i = 0; i < machineIds.Count; i++) + { + var workEfficiencyList = workEfficiencys.Where(x => x.Type == "Machine" && x.TypeId == machineIds[i] && x.ContractTrackId == item.Id); + if (workEfficiencyList.Count() > 0) + { + decimal d = 0; + foreach (var workEfficiency in workEfficiencyList) + { + if (workEfficiency.ConsumeHours != null) + { + d += decimal.Round(Convert.ToDecimal(workEfficiency.ConsumeHours), 2); + } + } + if (d > 0) + { + row[52 + i * 2] = decimal.Round(d, 2); + if (we.PhysicalCompletionQuantity != null && we.PhysicalCompletionQuantity > 0) + { + row[53 + i * 2] = decimal.Round(Convert.ToDecimal(we.PhysicalCompletionQuantity / d), 2); + } + } + } + } + } + table.Rows.Add(row); + f++; + } + c++; } - table.Rows.Add(row); - c++; } b++; } diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLogWorkEfficiency.aspx b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLogWorkEfficiency.aspx index 27241ced..5b63028d 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLogWorkEfficiency.aspx +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLogWorkEfficiency.aspx @@ -34,9 +34,21 @@ - + + + + + + + + diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLogWorkEfficiency.aspx.cs b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLogWorkEfficiency.aspx.cs index 535348e4..eaa3f0e4 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLogWorkEfficiency.aspx.cs +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLogWorkEfficiency.aspx.cs @@ -131,9 +131,9 @@ namespace FineUIPro.Web.PZHGL.InformationProject { foreach (GridColumn column in Grid1.Columns) { - if (column.ColumnIndex != 0 && column.ColumnIndex != 1 && column.ColumnIndex != 2) + if (column.ColumnIndex > 6) { - if (column.ColumnIndex > 5) + if (column.ColumnIndex > 9) { GroupField gf1 = column as GroupField; foreach (var column1 in gf1.Columns) diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 1ffc1b9e..ea19950b 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -11763,7 +11763,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ApproveIdea", DbType="NVarChar(200)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ApproveIdea", DbType="NVarChar(2000)")] public string ApproveIdea { get @@ -151270,7 +151270,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AttentPerson", DbType="NVarChar(500)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AttentPerson", DbType="NVarChar(3000)")] public string AttentPerson { get @@ -182793,7 +182793,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackageEstimate", DbType="Decimal(18,2)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackageEstimate", DbType="Decimal(18,3)")] public System.Nullable WorkPackageEstimate { get @@ -292569,7 +292569,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(81)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(50)")] public string Name { get