diff --git a/DataBase/菜单初始化脚本/1-6合同管理(Menu_PHTGL).sql b/DataBase/菜单初始化脚本/1-6合同管理(Menu_PHTGL).sql index d3683fea..f472e1fd 100644 --- a/DataBase/菜单初始化脚本/1-6合同管理(Menu_PHTGL).sql +++ b/DataBase/菜单初始化脚本/1-6合同管理(Menu_PHTGL).sql @@ -242,7 +242,7 @@ INSERT [Sys_Menu] ([MenuId],[MenuName],[Url],[SortIndex],[SuperMenu],[MenuType], GO INSERT [Sys_Menu] ([MenuId],[MenuName],[SortIndex],[SuperMenu],[MenuType],[IsOffice],[IsEnd],[IsUsed]) -VALUES ( N'A9BBF623-83AC-4353-A010-07A5D4CEB7D1',N'Чͳ',50,N'0',N'Menu_PHTGL',0,0,1) +VALUES ( N'A9BBF623-83AC-4353-A010-07A5D4CEB7D1',N'Чͳ',80,N'0',N'Menu_PHTGL',0,0,1) Go INSERT [Sys_Menu] ([MenuId],[MenuName],[Url],[SortIndex],[SuperMenu],[MenuType],[IsOffice],[IsEnd],[IsUsed]) VALUES ( N'118B3E91-073B-468C-BDE3-DD6DCF6034C6',N'չЧͳ',N'PZHGL/InformationProject/DayConstructionLogWorkEfficiency.aspx',10,N'A9BBF623-83AC-4353-A010-07A5D4CEB7D1',N'Menu_PHTGL',0,1,1) diff --git a/SGGL/BLL/PHTGL/BillOfQuantities/PhtglQuantityService.cs b/SGGL/BLL/PHTGL/BillOfQuantities/PhtglQuantityService.cs index ee9616c6..a98e41a3 100644 --- a/SGGL/BLL/PHTGL/BillOfQuantities/PhtglQuantityService.cs +++ b/SGGL/BLL/PHTGL/BillOfQuantities/PhtglQuantityService.cs @@ -320,6 +320,25 @@ namespace BLL return list; } + public static ListItem[] GetMajorItems2() + { + var list = new ListItem[12]; + list[0] = new ListItem("Z01", "土建工程"); + list[1] = new ListItem("Z02", "钢结构预制工程"); + list[2] = new ListItem("Z03", "工艺管道安装工程"); + list[3] = new ListItem("Z04", "工艺设备安装工程"); + list[4] = new ListItem("Z05", "非标设备现场制作安装工程"); + list[5] = new ListItem("Z06.1", "电气工程"); + list[6] = new ListItem("Z06.2", "仪表工程"); + list[7] = new ListItem("Z06.3", "电信工程"); + list[8] = new ListItem("Z07", "水暖安装工程"); + list[9] = new ListItem("Z08", "防腐绝热工程"); + list[10] = new ListItem("Z09", "无损检测工程"); + list[11] = new ListItem("Z10", "消防工程"); + + return list; + } + #region 获取列表 /// diff --git a/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs b/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs index 10fd5af5..6cc640e3 100644 --- a/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs +++ b/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs @@ -219,17 +219,17 @@ namespace BLL /// /// /// - public static void CheckContractWeightByContractId(string contractid ,string projectid) + public static void CheckContractWeightByContractId(string contractid, string projectid) { Model.PHTGL_ContractTrack table = new Model.PHTGL_ContractTrack(); table.ProjectId = projectid; table.ContractId = contractid; - var list= GetPHTGL_ContractTrackByModle(table); + var list = GetPHTGL_ContractTrackByModle(table); foreach (var item in list) { - item .ContractWeight = GetContractWeightById(item.Id); + item.ContractWeight = GetContractWeightById(item.Id); UpdatePHTGL_ContractTrack(item); - + } } /// @@ -237,7 +237,7 @@ namespace BLL /// /// /// - public static string GetContractWeightById(string id ) + public static string GetContractWeightById(string id) { string ContractWeight = "0"; var model = GetPHTGL_ContractTrackById(id); @@ -256,11 +256,11 @@ namespace BLL /// public static decimal GetSumSettledAmountByContractId(string contractid, string projectid) { - decimal SumSettledAmount = 0; + decimal SumSettledAmount = 0; SumSettledAmount = (from x in Funs.DB.PHTGL_ContractTrack - where x.ProjectId == projectid && x.ContractId == contractid - select x.SettledAmount ?? 0).ToList().Sum(); + where x.ProjectId == projectid && x.ContractId == contractid + select x.SettledAmount ?? 0).ToList().Sum(); return SumSettledAmount; } @@ -302,7 +302,7 @@ namespace BLL if (string.IsNullOrEmpty(item.ProjectCode)) continue; var resultModel = GetPHTGL_ContractTrackByModle(phtglContractTrack); item.ContractNum = ContractService.GetContractById(contractid)?.ContractNum; - if (!string .IsNullOrEmpty(item.ProjectCode)&& !item.ProjectCode.Contains("-")) + if (!string.IsNullOrEmpty(item.ProjectCode) && !item.ProjectCode.Contains("-")) { item.ProjectCode = item.MainItemCode + "-" + item.ProjectCode; @@ -331,7 +331,7 @@ namespace BLL { using (var db = new Model.SGGLDB(Funs.ConnString)) { - var pros = BLL.PHTGL_QuantityService.GetMajorItems(); + var pros = BLL.PHTGL_QuantityService.GetMajorItems2(); List proNames = new List(); foreach (var item in professionalList) { @@ -349,11 +349,15 @@ namespace BLL where x.ConstructionLogId == 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))); @@ -447,7 +451,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; @@ -457,60 +461,138 @@ 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); + 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 workEfficiency = workEfficiencys.FirstOrDefault(x => x.Type == "Person" && x.TypeId == workPostIds[i] && x.ContractTrackId == item.Id); - if (workEfficiency != null) + var we = workEfficiencys.FirstOrDefault(x => x.ContractTrackId == item.Id); + if (we != null) { - if (workEfficiency.ConsumeHours != null) + row[9] = we.PhysicalCompletionQuantity; + row[10] = we.MaterialConsumption; + } + for (int i = 0; i < workPostIds.Count; i++) + { + var workEfficiency = workEfficiencys.FirstOrDefault(x => x.Type == "Person" && x.TypeId == workPostIds[i] && x.ContractTrackId == item.Id); + if (workEfficiency != null) { - row[8 + i * 2] = decimal.Round(Convert.ToDecimal(workEfficiency.ConsumeHours), 2); - if (we.PhysicalCompletionQuantity != null && we.PhysicalCompletionQuantity > 0) + if (workEfficiency.ConsumeHours != null) { - row[9 + i * 2] = decimal.Round(Convert.ToDecimal(we.PhysicalCompletionQuantity / workEfficiency.ConsumeHours), 2); - } - } - } - } - for (int i = 0; i < machineIds.Count; i++) - { - var workEfficiency = workEfficiencys.FirstOrDefault(x => x.Type == "Machine" && x.TypeId == machineIds[i] && x.ContractTrackId == item.Id); - if (workEfficiency != null) - { - if (workEfficiency.ConsumeHours != null) - { - row[48 + i * 2] = decimal.Round(Convert.ToDecimal(workEfficiency.ConsumeHours), 2); - if (we.PhysicalCompletionQuantity != null && we.PhysicalCompletionQuantity > 0) - { - row[49 + i * 2] = decimal.Round(Convert.ToDecimal(we.PhysicalCompletionQuantity / workEfficiency.ConsumeHours), 2); + row[12 + i * 2] = decimal.Round(Convert.ToDecimal(workEfficiency.ConsumeHours), 2); + if (we.PhysicalCompletionQuantity != null && we.PhysicalCompletionQuantity > 0) + { + row[13 + i * 2] = decimal.Round(Convert.ToDecimal(we.PhysicalCompletionQuantity / workEfficiency.ConsumeHours), 2); + } + } + } + } + for (int i = 0; i < machineIds.Count; i++) + { + var workEfficiency = workEfficiencys.FirstOrDefault(x => x.Type == "Machine" && x.TypeId == machineIds[i] && x.ContractTrackId == item.Id); + if (workEfficiency != null) + { + if (workEfficiency.ConsumeHours != null) + { + row[52 + i * 2] = decimal.Round(Convert.ToDecimal(workEfficiency.ConsumeHours), 2); + if (we.PhysicalCompletionQuantity != null && we.PhysicalCompletionQuantity > 0) + { + row[53 + i * 2] = decimal.Round(Convert.ToDecimal(we.PhysicalCompletionQuantity / workEfficiency.ConsumeHours), 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 d = 1; + var contractTracks = getContractTracks.Where(x => x.MainItemCode == unitWork.MainItemCode && x.MajorName == proName && x.SubProject == subProject); + foreach (Model.PHTGL_ContractTrack item in contractTracks) + { + row = table.NewRow(); + row[0] = item.Id; + row[1] = a + "." + b + "." + c + "." + d; + 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 workEfficiency = workEfficiencys.FirstOrDefault(x => x.Type == "Person" && x.TypeId == workPostIds[i] && x.ContractTrackId == item.Id); + if (workEfficiency != null) + { + if (workEfficiency.ConsumeHours != null) + { + row[12 + i * 2] = decimal.Round(Convert.ToDecimal(workEfficiency.ConsumeHours), 2); + if (we.PhysicalCompletionQuantity != null && we.PhysicalCompletionQuantity > 0) + { + row[13 + i * 2] = decimal.Round(Convert.ToDecimal(we.PhysicalCompletionQuantity / workEfficiency.ConsumeHours), 2); + } + } + } + } + for (int i = 0; i < machineIds.Count; i++) + { + var workEfficiency = workEfficiencys.FirstOrDefault(x => x.Type == "Machine" && x.TypeId == machineIds[i] && x.ContractTrackId == item.Id); + if (workEfficiency != null) + { + if (workEfficiency.ConsumeHours != null) + { + row[52 + i * 2] = decimal.Round(Convert.ToDecimal(workEfficiency.ConsumeHours), 2); + if (we.PhysicalCompletionQuantity != null && we.PhysicalCompletionQuantity > 0) + { + row[53 + i * 2] = decimal.Round(Convert.ToDecimal(we.PhysicalCompletionQuantity / workEfficiency.ConsumeHours), 2); + } + } + } + } + } + table.Rows.Add(row); + d++; + } + c++; } - table.Rows.Add(row); - c++; } b++; } @@ -528,7 +610,7 @@ namespace BLL { using (var db = new Model.SGGLDB(Funs.ConnString)) { - var pros = BLL.PHTGL_QuantityService.GetMajorItems(); + var pros = BLL.PHTGL_QuantityService.GetMajorItems2(); List proNames = new List(); foreach (var item in professionalList) { @@ -747,7 +829,7 @@ namespace BLL { using (var db = new Model.SGGLDB(Funs.ConnString)) { - var pros = BLL.PHTGL_QuantityService.GetMajorItems(); + var pros = BLL.PHTGL_QuantityService.GetMajorItems2(); List proNames = new List(); foreach (var item in professionalList) { diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx.cs b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx.cs index cd1d07ea..20aeef6a 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx.cs +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx.cs @@ -115,7 +115,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject UnitWorkService.InitUnitWorkDownList(drpUnitWork, this.CurrUser.LoginProjectId, true); this.drpProfessional.DataTextField = "Value"; this.drpProfessional.DataValueField = "Text"; - this.drpProfessional.DataSource = BLL.PHTGL_QuantityService.GetMajorItems(); + this.drpProfessional.DataSource = BLL.PHTGL_QuantityService.GetMajorItems2(); this.drpProfessional.DataBind(); Funs.FineUIPleaseSelect(this.drpProfessional); //合同编号 diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogFileCabinet.aspx.cs b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogFileCabinet.aspx.cs index e63fab34..c6ed8ae6 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogFileCabinet.aspx.cs +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogFileCabinet.aspx.cs @@ -118,7 +118,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject UnitWorkService.InitUnitWorkDownList(drpUnitWork, this.CurrUser.LoginProjectId, true); this.drpProfessional.DataTextField = "Value"; this.drpProfessional.DataValueField = "Text"; - this.drpProfessional.DataSource = BLL.PHTGL_QuantityService.GetMajorItems(); + this.drpProfessional.DataSource = BLL.PHTGL_QuantityService.GetMajorItems2(); this.drpProfessional.DataBind(); Funs.FineUIPleaseSelect(this.drpProfessional); //合同编号 diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogWorkEfficiency.aspx b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogWorkEfficiency.aspx index 2d32fd97..e44234cc 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogWorkEfficiency.aspx +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogWorkEfficiency.aspx @@ -37,9 +37,21 @@ - + + + + + + + + diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogWorkEfficiency.aspx.cs b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogWorkEfficiency.aspx.cs index dbc75e9a..fbea2170 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogWorkEfficiency.aspx.cs +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogWorkEfficiency.aspx.cs @@ -143,9 +143,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/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLog.aspx.cs b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLog.aspx.cs index 17cd80c9..6845bf99 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLog.aspx.cs +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLog.aspx.cs @@ -147,7 +147,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject UnitWorkService.InitUnitWorkDownList(drpUnitWork, this.CurrUser.LoginProjectId, true); this.drpProfessional.DataTextField = "Value"; this.drpProfessional.DataValueField = "Text"; - this.drpProfessional.DataSource = BLL.PHTGL_QuantityService.GetMajorItems(); + this.drpProfessional.DataSource = BLL.PHTGL_QuantityService.GetMajorItems2(); this.drpProfessional.DataBind(); Funs.FineUIPleaseSelect(this.drpProfessional); //合同编号