diff --git a/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonService.cs b/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonService.cs index d27aa849..8f453806 100644 --- a/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonService.cs +++ b/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonService.cs @@ -633,7 +633,7 @@ namespace BLL /// public static Model.SitePerson_Person getSitePerson_PersonByRoleId(string projectId, string roleId) { - return Funs.DB.SitePerson_Person.FirstOrDefault(x => x.ProjectId == projectId && x.RoleIds.Contains(roleId)); + return Funs.DB.SitePerson_Person.FirstOrDefault(x => x.ProjectId == projectId && x.RoleIds.Contains(roleId) && x.States == Const.ProjectPersonStates_1); } /// diff --git a/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs b/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs index e7c1eced..1b19456b 100644 --- a/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs +++ b/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs @@ -425,7 +425,7 @@ namespace BLL } for (int i = 0; i < workPostIds.Count; i++) { - var workEfficiency = workEfficiencys.FirstOrDefault(x => x.Type == "Person" && x.TypeId == workPostIds[i] && x.ContractTrackId== item.Id); + var workEfficiency = workEfficiencys.FirstOrDefault(x => x.Type == "Person" && x.TypeId == workPostIds[i] && x.ContractTrackId == item.Id); if (workEfficiency != null) { if (workEfficiency.ConsumeHours != null) @@ -464,6 +464,224 @@ namespace BLL return table; } } + + /// + /// 获取模拟树表格 + /// + /// + public static DataTable GetProjectAllTreeDataTable(string projectId, string IsOut, List contractNoList, List professionalList, List workPostIds, List machineIds, string compileDate) + { + using (var db = new Model.SGGLDB(Funs.ConnString)) + { + var pros = BLL.PHTGL_QuantityService.GetMajorItems(); + List proNames = new List(); + foreach (var item in professionalList) + { + var pro = pros.FirstOrDefault(x => x.Text == item); + if (pro != null) + { + proNames.Add(pro.Value); + } + } + IQueryable getContractTracks = from x in db.PHTGL_ContractTrack + where x.ProjectId == projectId && contractNoList.Contains(x.ContractId) && proNames.Contains(x.MajorName) + orderby x.ProjectCode, x.ProjectName + select x; + DateTime date = Funs.GetNewDateTimeOrNow(compileDate); + var personLogIds = (from x in db.ZHGL_ConstructionLog + where x.ProjectId == projectId && x.CompileDate == date + orderby x.CompileDate descending + select x.ConstructionLogId).ToList(); + IQueryable workEfficiencys = from x in db.ZHGL_ConstructionLogWorkEfficiency + where personLogIds.Contains(x.ConstructionLogId) + select x; + var unitWorks = (from x in getContractTracks + select new { MainItemCode = x.MainItemCode, MainItemName = x.MainItemName }).Distinct().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("ProjectCode", typeof(String))); + table.Columns.Add(new DataColumn("ProjectName", typeof(String))); + table.Columns.Add(new DataColumn("UnitOfMeasurement", typeof(String))); + table.Columns.Add(new DataColumn("PhysicalCompletionQuantity", typeof(String))); + table.Columns.Add(new DataColumn("MaterialConsumption", typeof(String))); + table.Columns.Add(new DataColumn("ShowId", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours0", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency0", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours1", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency1", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours2", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency2", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours3", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency3", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours4", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency4", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours5", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency5", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours6", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency6", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours7", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency7", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours8", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency8", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours9", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency9", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours10", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency10", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours11", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency11", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours12", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency12", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours13", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency13", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours14", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency14", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours15", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency15", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours16", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency16", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours17", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency17", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours18", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency18", typeof(String))); + table.Columns.Add(new DataColumn("PersonConsumeHours19", typeof(String))); + table.Columns.Add(new DataColumn("PersonWorkEfficiency19", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours0", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency0", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours1", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency1", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours2", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency2", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours3", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency3", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours4", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency4", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours5", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency5", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours6", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency6", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours7", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency7", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours8", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency8", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours9", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency9", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours10", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency10", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours11", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency11", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours12", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency12", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours13", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency13", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours14", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency14", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours15", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency15", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours16", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency16", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours17", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency17", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours18", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency18", typeof(String))); + table.Columns.Add(new DataColumn("MachineConsumeHours19", typeof(String))); + table.Columns.Add(new DataColumn("MachineWorkEfficiency19", typeof(String))); + DataRow row; + int a = 1; + foreach (var unitWork in unitWorks) + { + row = table.NewRow(); + row[0] = unitWork.MainItemCode; + row[1] = a; + row[2] = string.Empty; + row[3] = unitWork.MainItemName; + table.Rows.Add(row); + int b = 1; + foreach (var proName in proNames) + { + row = table.NewRow(); + 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 = 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) + { + var we = workEfficiencys.FirstOrDefault(x => x.ContractTrackId == item.Id); + if (we != null) + { + 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) + { + decimal d = 0; + foreach (var workEfficiency in workEfficiencyList) + { + if (workEfficiency.ConsumeHours != null) + { + d += decimal.Round(Convert.ToDecimal(workEfficiency.ConsumeHours), 2); + } + } + if (d > 0) + { + row[8 + i * 2] = decimal.Round(d, 2); + if (we.PhysicalCompletionQuantity != null && we.PhysicalCompletionQuantity > 0) + { + 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); + } + } + } + } + } + table.Rows.Add(row); + c++; + } + b++; + } + a++; + } + return table; + } + } } public class PHTGL_ContractTrackDtoIn { diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index d6fef964..cdd83097 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -1333,6 +1333,7 @@ + @@ -12897,6 +12898,13 @@ ProjectConstructionLog.aspx + + ProjectConstructionLogWorkEfficiency.aspx + ASPXCodeBehind + + + ProjectConstructionLogWorkEfficiency.aspx + ReceiveFileManager.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx index d5e18b1a..00f793ef 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx @@ -374,7 +374,7 @@ - diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx.cs b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx.cs index 7ef3688c..69dc3c8a 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx.cs +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx.cs @@ -677,6 +677,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject /// protected void btnMenuDown_Click(object sender, EventArgs e) { + } #endregion diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogFileCabinet.aspx b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogFileCabinet.aspx index 8f4f0083..4208cc72 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogFileCabinet.aspx +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogFileCabinet.aspx @@ -78,9 +78,11 @@ - + - + + + @@ -306,7 +308,7 @@