From 0352efa74665af17a7902f29b542ab4e00c81658 Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Wed, 18 Oct 2023 09:40:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DataBase/版本日志/SGGLDB_V2023-10-17.sql | 14 ++ .../1-6合同管理(Menu_PHTGL).sql | 17 +- .../PhtglContracttrackService .cs | 221 ++++++++++++++++++ SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 16 ++ .../ConstructionLog.aspx.cs | 2 +- .../ConstructionLogFileCabinet.aspx.cs | 2 +- .../DayConstructionLogWorkEfficiency.aspx | 80 +++++++ .../DayConstructionLogWorkEfficiency.aspx.cs | 196 ++++++++++++++++ ...tructionLogWorkEfficiency.aspx.designer.cs | 78 +++++++ ...MonthConstructionLogWorkEfficiencySum.aspx | 80 +++++++ ...thConstructionLogWorkEfficiencySum.aspx.cs | 198 ++++++++++++++++ ...ctionLogWorkEfficiencySum.aspx.designer.cs | 78 +++++++ .../ProjectConstructionLog.aspx.cs | 3 +- SGGL/FineUIPro.Web/common/Menu_DigData.xml | 4 +- SGGL/FineUIPro.Web/common/Menu_PHTGL.xml | 4 + SGGL/FineUIPro.Web/common/Menu_ZHGL.xml | 25 +- 16 files changed, 997 insertions(+), 21 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_V2023-10-17.sql create mode 100644 SGGL/FineUIPro.Web/PZHGL/InformationProject/DayConstructionLogWorkEfficiency.aspx create mode 100644 SGGL/FineUIPro.Web/PZHGL/InformationProject/DayConstructionLogWorkEfficiency.aspx.cs create mode 100644 SGGL/FineUIPro.Web/PZHGL/InformationProject/DayConstructionLogWorkEfficiency.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/PZHGL/InformationProject/MonthConstructionLogWorkEfficiencySum.aspx create mode 100644 SGGL/FineUIPro.Web/PZHGL/InformationProject/MonthConstructionLogWorkEfficiencySum.aspx.cs create mode 100644 SGGL/FineUIPro.Web/PZHGL/InformationProject/MonthConstructionLogWorkEfficiencySum.aspx.designer.cs diff --git a/DataBase/版本日志/SGGLDB_V2023-10-17.sql b/DataBase/版本日志/SGGLDB_V2023-10-17.sql new file mode 100644 index 00000000..9f6f55a8 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-10-17.sql @@ -0,0 +1,14 @@ +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) +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) + Go + + INSERT [Sys_Menu] ([MenuId],[MenuName],[Url],[SortIndex],[SuperMenu],[MenuType],[IsOffice],[IsEnd],[IsUsed]) + VALUES ( N'4EDB3CB9-9FB6-4D63-802F-83C3FB3CA6B1',N'ƽЧͳ',N'PZHGL/InformationProject/MonthConstructionLogWorkEfficiencySum.aspx',20,N'A9BBF623-83AC-4353-A010-07A5D4CEB7D1',N'Menu_PHTGL',0,1,1) + Go + + INSERT [Sys_Menu] ([MenuId],[MenuName],[Url],[SortIndex],[SuperMenu],[MenuType],[IsOffice],[IsEnd],[IsUsed]) + VALUES ( N'D791C4E1-7CF1-4F4E-9457-0CF91ACDB987',N'ĿƽЧͳ',N'PZHGL/InformationProject/ProjectConstructionLogWorkEfficiencySum.aspx',30,N'A9BBF623-83AC-4353-A010-07A5D4CEB7D1',N'Menu_PHTGL',0,1,1) + Go \ No newline at end of file diff --git a/DataBase/菜单初始化脚本/1-6合同管理(Menu_PHTGL).sql b/DataBase/菜单初始化脚本/1-6合同管理(Menu_PHTGL).sql index ef9d7f04..6333b302 100644 --- a/DataBase/菜单初始化脚本/1-6合同管理(Menu_PHTGL).sql +++ b/DataBase/菜单初始化脚本/1-6合同管理(Menu_PHTGL).sql @@ -201,4 +201,19 @@ INSERT [Sys_Menu] ([MenuId],[MenuName],[Url],[SortIndex],[SuperMenu],[MenuType], VALUES ( N'DD9A3A8A-8DD9-4B24-B51D-C3EB530B60F2',N'D9BAB30E-3255-4EA0-8631-EF15C9203EFD',N'',4) INSERT [Sys_ButtonToMenu] ([ButtonToMenuId],[MenuId],[ButtonName],[SortIndex]) VALUES ( N'C1708178-C52B-4D32-9849-C69622D96105',N'D9BAB30E-3255-4EA0-8631-EF15C9203EFD',N'',1) - GO \ No newline at end of file + 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) +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) + Go + + INSERT [Sys_Menu] ([MenuId],[MenuName],[Url],[SortIndex],[SuperMenu],[MenuType],[IsOffice],[IsEnd],[IsUsed]) + VALUES ( N'4EDB3CB9-9FB6-4D63-802F-83C3FB3CA6B1',N'ƽЧͳ',N'PZHGL/InformationProject/MonthConstructionLogWorkEfficiencySum.aspx',20,N'A9BBF623-83AC-4353-A010-07A5D4CEB7D1',N'Menu_PHTGL',0,1,1) + Go + + INSERT [Sys_Menu] ([MenuId],[MenuName],[Url],[SortIndex],[SuperMenu],[MenuType],[IsOffice],[IsEnd],[IsUsed]) + VALUES ( N'D791C4E1-7CF1-4F4E-9457-0CF91ACDB987',N'ĿƽЧͳ',N'PZHGL/InformationProject/ProjectConstructionLogWorkEfficiencySum.aspx',30,N'A9BBF623-83AC-4353-A010-07A5D4CEB7D1',N'Menu_PHTGL',0,1,1) + Go \ No newline at end of file diff --git a/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs b/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs index 1b19456b..cf08d95d 100644 --- a/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs +++ b/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs @@ -483,6 +483,7 @@ namespace BLL proNames.Add(pro.Value); } } + proNames = proNames.Distinct().ToList(); 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 @@ -682,6 +683,226 @@ namespace BLL return table; } } + + /// + /// 获取模拟树表格 + /// + /// + public static DataTable GetMonthProjectAllTreeDataTable(string projectId, string IsOut, List contractNoList, List professionalList, List workPostIds, List machineIds, DateTime startDate, DateTime endDate) + { + 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); + } + } + proNames = proNames.Distinct().ToList(); + 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; + var personLogIds = (from x in db.ZHGL_ConstructionLog + where x.ProjectId == projectId && x.CompileDate >= startDate && x.CompileDate < endDate + 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 cdd83097..27ee9d06 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -1329,6 +1329,8 @@ + + @@ -12870,6 +12872,20 @@ ConstructionReportView.aspx + + DayConstructionLogWorkEfficiency.aspx + ASPXCodeBehind + + + DayConstructionLogWorkEfficiency.aspx + + + MonthConstructionLogWorkEfficiencySum.aspx + ASPXCodeBehind + + + MonthConstructionLogWorkEfficiencySum.aspx + Picture.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx.cs b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx.cs index 69dc3c8a..8c107946 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx.cs +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLog.aspx.cs @@ -205,7 +205,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject { this.btnMenuAdd.Hidden = true; this.btnMenuEdit.Hidden = false; - this.btnMenuDown.Hidden = false; + //this.btnMenuDown.Hidden = false; this.btnMenuDelete.Hidden = false; } } diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogFileCabinet.aspx.cs b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogFileCabinet.aspx.cs index 5e807360..0bce8cac 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogFileCabinet.aspx.cs +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogFileCabinet.aspx.cs @@ -211,7 +211,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject { if (this.GetButtonPower(BLL.Const.BtnModify)) { - this.btnMenuDown.Hidden = false; + //this.btnMenuDown.Hidden = false; } } this.ConstructionLogId = this.tvControlItem.SelectedNodeID; diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/DayConstructionLogWorkEfficiency.aspx b/SGGL/FineUIPro.Web/PZHGL/InformationProject/DayConstructionLogWorkEfficiency.aspx new file mode 100644 index 00000000..734901a9 --- /dev/null +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/DayConstructionLogWorkEfficiency.aspx @@ -0,0 +1,80 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DayConstructionLogWorkEfficiency.aspx.cs" Inherits="FineUIPro.Web.PZHGL.InformationProject.DayConstructionLogWorkEfficiency" %> + + + + + + 工效录入 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/DayConstructionLogWorkEfficiency.aspx.cs b/SGGL/FineUIPro.Web/PZHGL/InformationProject/DayConstructionLogWorkEfficiency.aspx.cs new file mode 100644 index 00000000..86fef980 --- /dev/null +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/DayConstructionLogWorkEfficiency.aspx.cs @@ -0,0 +1,196 @@ +using BLL; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.PZHGL.InformationProject +{ + public partial class DayConstructionLogWorkEfficiency : PageBase + { + /// + /// 加载表头 + /// + protected void Page_Init(object sender, EventArgs e) + { + InitGrid(); + } + + #region 表头 + /// + /// 表头 + /// + private void InitGrid() + { + Model.SGGLDB db = Funs.DB; + var workEfficiencys = from x in db.ZHGL_ConstructionLogWorkEfficiency + join y in db.ZHGL_ConstructionLog on x.ConstructionLogId equals y.ConstructionLogId + where y.ProjectId == this.CurrUser.LoginProjectId + select x; + List workPostIds = (from x in workEfficiencys + where x.Type == "Person" + select x.TypeId).Distinct().ToList(); + List machineIds = (from x in workEfficiencys + where x.Type == "Machine" + select x.TypeId).Distinct().ToList(); + GroupField gf1 = new GroupField(); + gf1.ColumnID = "Person"; + gf1.HeaderText = "人工消耗(工·h)"; + gf1.HeaderTextAlign = TextAlign.Center; + for (int i = 0; i < workPostIds.Count; i++) + { + GroupField gf = new GroupField(); + gf.ColumnID = "Person" + i.ToString(); + gf.HeaderText = BLL.WorkPostService.getWorkPostNameById(workPostIds[i]); + gf.HeaderTextAlign = TextAlign.Center; + RenderField rd1 = new RenderField(); + rd1.ColumnID = "PersonConsumeHours" + i.ToString(); + rd1.Width = Unit.Pixel(100); + rd1.DataField = "PersonConsumeHours" + i.ToString(); + rd1.FieldType = FieldType.Double; + rd1.HeaderText = "消耗工时"; + rd1.HeaderTextAlign = TextAlign.Center; + gf.Columns.Add(rd1); + RenderField rd2 = new RenderField(); + rd2.ColumnID = "PersonWorkEfficiency" + i.ToString(); + rd2.Width = Unit.Pixel(100); + rd2.DataField = "PersonWorkEfficiency" + i.ToString(); + rd2.FieldType = FieldType.Double; + rd2.HeaderText = "工效"; + rd2.HeaderTextAlign = TextAlign.Center; + gf.Columns.Add(rd2); + gf1.Columns.Add(gf); + } + Grid1.Columns.Add(gf1); + GroupField gf2 = new GroupField(); + gf2.ColumnID = "Machine"; + gf2.HeaderText = "机械消耗(台·h)"; + gf2.HeaderTextAlign = TextAlign.Center; + for (int i = 0; i < machineIds.Count; i++) + { + GroupField gf = new GroupField(); + gf.ColumnID = "Machine" + i.ToString(); + gf.HeaderText = BLL.SpecialEquipmentService.GetSpecialEquipmentNameById(machineIds[i]); + gf.HeaderTextAlign = TextAlign.Center; + RenderField rd1 = new RenderField(); + rd1.ColumnID = "MachineConsumeHours" + i.ToString(); + rd1.Width = Unit.Pixel(100); + rd1.DataField = "MachineConsumeHours" + i.ToString(); + rd1.FieldType = FieldType.Double; + rd1.HeaderText = "消耗台时"; + rd1.HeaderTextAlign = TextAlign.Center; + gf.Columns.Add(rd1); + RenderField rd2 = new RenderField(); + rd2.ColumnID = "MachineWorkEfficiency" + i.ToString(); + rd2.Width = Unit.Pixel(100); + rd2.DataField = "MachineWorkEfficiency" + i.ToString(); + rd2.FieldType = FieldType.Double; + rd2.HeaderText = "工效"; + rd2.HeaderTextAlign = TextAlign.Center; + gf.Columns.Add(rd2); + gf2.Columns.Add(gf); + } + Grid1.Columns.Add(gf2); + } + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); + GetData(); + } + } + #endregion + + private void GetData() + { + Model.SGGLDB db = Funs.DB; + string contractNo = string.Empty, professional = string.Empty; + var personLogs = from x in db.ZHGL_ConstructionLog + where x.ProjectId == this.CurrUser.LoginProjectId && x.CompileDate == Funs.GetNewDateTime(this.txtCompileDate.Text.Trim()) + orderby x.CompileDate descending + select x; + if (personLogs.Count() > 0) + { + foreach (var personLog in personLogs) + { + if (!string.IsNullOrEmpty(personLog.ContractNo)) + { + contractNo += "," + personLog.ContractNo; + } + if (!string.IsNullOrEmpty(personLog.Professional)) + { + professional += "," + personLog.Professional; + } + } + } + List contractNoList = Funs.GetStrListByStr(contractNo, ','); + List professionalList = Funs.GetStrListByStr(professional, ','); + var workEfficiencys = from x in db.ZHGL_ConstructionLogWorkEfficiency + join y in db.ZHGL_ConstructionLog on x.ConstructionLogId equals y.ConstructionLogId + where y.ProjectId == this.CurrUser.LoginProjectId + select x; + List workPostIds = (from x in workEfficiencys + where x.Type == "Person" + select x.TypeId).Distinct().ToList(); + List machineIds = (from x in workEfficiencys + where x.Type == "Machine" + select x.TypeId).Distinct().ToList(); + DataTable table = BLL.PhtglContractTrackService.GetProjectAllTreeDataTable(this.CurrUser.LoginProjectId, string.Empty, contractNoList, professionalList, workPostIds, machineIds, this.txtCompileDate.Text.Trim()); + Grid1.DataSource = table; + Grid1.DataBind(); + for (int i = 0; i < this.Grid1.Rows.Count; i++) + { + if (string.IsNullOrEmpty(this.Grid1.Rows[i].DataKeys[2].ToString())) + { + foreach (GridColumn column in Grid1.Columns) + { + if (column.ColumnIndex != 0 && column.ColumnIndex != 1 && column.ColumnIndex != 2) + { + if (column.ColumnIndex > 5) + { + GroupField gf1 = column as GroupField; + foreach (var column1 in gf1.Columns) + { + GroupField gf2 = column1 as GroupField; + foreach (var column2 in gf2.Columns) + { + this.Grid1.Rows[i].CellCssClasses[column2.ColumnIndex] = "f-grid-cell-uneditable"; + } + } + } + else + { + this.Grid1.Rows[i].CellCssClasses[column.ColumnIndex] = "f-grid-cell-uneditable"; + } + } + } + } + } + } + + protected void txtCompileDate_TextChanged(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(this.txtCompileDate.Text.Trim())) + { + GetData(); + } + else + { + Grid1.DataSource = null; + Grid1.DataBind(); + Alert.ShowInTop("请选择日期!", MessageBoxIcon.Warning); + } + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/DayConstructionLogWorkEfficiency.aspx.designer.cs b/SGGL/FineUIPro.Web/PZHGL/InformationProject/DayConstructionLogWorkEfficiency.aspx.designer.cs new file mode 100644 index 00000000..68913b12 --- /dev/null +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/DayConstructionLogWorkEfficiency.aspx.designer.cs @@ -0,0 +1,78 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.PZHGL.InformationProject { + + + public partial class DayConstructionLogWorkEfficiency { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// txtCompileDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtCompileDate; + + /// + /// hdId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox hdId; + } +} diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/MonthConstructionLogWorkEfficiencySum.aspx b/SGGL/FineUIPro.Web/PZHGL/InformationProject/MonthConstructionLogWorkEfficiencySum.aspx new file mode 100644 index 00000000..0026bdea --- /dev/null +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/MonthConstructionLogWorkEfficiencySum.aspx @@ -0,0 +1,80 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MonthConstructionLogWorkEfficiencySum.aspx.cs" Inherits="FineUIPro.Web.PZHGL.InformationProject.MonthConstructionLogWorkEfficiencySum" %> + + + + + + 工效录入 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/MonthConstructionLogWorkEfficiencySum.aspx.cs b/SGGL/FineUIPro.Web/PZHGL/InformationProject/MonthConstructionLogWorkEfficiencySum.aspx.cs new file mode 100644 index 00000000..6ac0fce6 --- /dev/null +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/MonthConstructionLogWorkEfficiencySum.aspx.cs @@ -0,0 +1,198 @@ +using BLL; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.PZHGL.InformationProject +{ + public partial class MonthConstructionLogWorkEfficiencySum : PageBase + { + /// + /// 加载表头 + /// + protected void Page_Init(object sender, EventArgs e) + { + InitGrid(); + } + + #region 表头 + /// + /// 表头 + /// + private void InitGrid() + { + Model.SGGLDB db = Funs.DB; + var workEfficiencys = from x in db.ZHGL_ConstructionLogWorkEfficiency + join y in db.ZHGL_ConstructionLog on x.ConstructionLogId equals y.ConstructionLogId + where y.ProjectId == this.CurrUser.LoginProjectId + select x; + List workPostIds = (from x in workEfficiencys + where x.Type == "Person" + select x.TypeId).Distinct().ToList(); + List machineIds = (from x in workEfficiencys + where x.Type == "Machine" + select x.TypeId).Distinct().ToList(); + GroupField gf1 = new GroupField(); + gf1.ColumnID = "Person"; + gf1.HeaderText = "人工消耗(工·h)"; + gf1.HeaderTextAlign = TextAlign.Center; + for (int i = 0; i < workPostIds.Count; i++) + { + GroupField gf = new GroupField(); + gf.ColumnID = "Person" + i.ToString(); + gf.HeaderText = BLL.WorkPostService.getWorkPostNameById(workPostIds[i]); + gf.HeaderTextAlign = TextAlign.Center; + RenderField rd1 = new RenderField(); + rd1.ColumnID = "PersonConsumeHours" + i.ToString(); + rd1.Width = Unit.Pixel(100); + rd1.DataField = "PersonConsumeHours" + i.ToString(); + rd1.FieldType = FieldType.Double; + rd1.HeaderText = "消耗工时"; + rd1.HeaderTextAlign = TextAlign.Center; + gf.Columns.Add(rd1); + RenderField rd2 = new RenderField(); + rd2.ColumnID = "PersonWorkEfficiency" + i.ToString(); + rd2.Width = Unit.Pixel(100); + rd2.DataField = "PersonWorkEfficiency" + i.ToString(); + rd2.FieldType = FieldType.Double; + rd2.HeaderText = "工效"; + rd2.HeaderTextAlign = TextAlign.Center; + gf.Columns.Add(rd2); + gf1.Columns.Add(gf); + } + Grid1.Columns.Add(gf1); + GroupField gf2 = new GroupField(); + gf2.ColumnID = "Machine"; + gf2.HeaderText = "机械消耗(台·h)"; + gf2.HeaderTextAlign = TextAlign.Center; + for (int i = 0; i < machineIds.Count; i++) + { + GroupField gf = new GroupField(); + gf.ColumnID = "Machine" + i.ToString(); + gf.HeaderText = BLL.SpecialEquipmentService.GetSpecialEquipmentNameById(machineIds[i]); + gf.HeaderTextAlign = TextAlign.Center; + RenderField rd1 = new RenderField(); + rd1.ColumnID = "MachineConsumeHours" + i.ToString(); + rd1.Width = Unit.Pixel(100); + rd1.DataField = "MachineConsumeHours" + i.ToString(); + rd1.FieldType = FieldType.Double; + rd1.HeaderText = "消耗台时"; + rd1.HeaderTextAlign = TextAlign.Center; + gf.Columns.Add(rd1); + RenderField rd2 = new RenderField(); + rd2.ColumnID = "MachineWorkEfficiency" + i.ToString(); + rd2.Width = Unit.Pixel(100); + rd2.DataField = "MachineWorkEfficiency" + i.ToString(); + rd2.FieldType = FieldType.Double; + rd2.HeaderText = "工效"; + rd2.HeaderTextAlign = TextAlign.Center; + gf.Columns.Add(rd2); + gf2.Columns.Add(gf); + } + Grid1.Columns.Add(gf2); + } + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.txtMonth.Text = string.Format("{0:yyyy-MM}", DateTime.Now); + GetData(); + } + } + #endregion + + private void GetData() + { + Model.SGGLDB db = Funs.DB; + DateTime startDate = Funs.GetNewDateTimeOrNow(this.txtMonth.Text.Trim() + "-01"); + DateTime endDate = startDate.AddMonths(1); + string contractNo = string.Empty, professional = string.Empty; + var personLogs = from x in db.ZHGL_ConstructionLog + where x.ProjectId == this.CurrUser.LoginProjectId && x.CompileDate >= startDate && x.CompileDate < endDate + orderby x.CompileDate descending + select x; + if (personLogs.Count() > 0) + { + foreach (var personLog in personLogs) + { + if (!string.IsNullOrEmpty(personLog.ContractNo)) + { + contractNo += "," + personLog.ContractNo; + } + if (!string.IsNullOrEmpty(personLog.Professional)) + { + professional += "," + personLog.Professional; + } + } + } + List contractNoList = Funs.GetStrListByStr(contractNo, ','); + List professionalList = Funs.GetStrListByStr(professional, ','); + var workEfficiencys = from x in db.ZHGL_ConstructionLogWorkEfficiency + join y in db.ZHGL_ConstructionLog on x.ConstructionLogId equals y.ConstructionLogId + where y.ProjectId == this.CurrUser.LoginProjectId + select x; + List workPostIds = (from x in workEfficiencys + where x.Type == "Person" + select x.TypeId).Distinct().ToList(); + List machineIds = (from x in workEfficiencys + where x.Type == "Machine" + select x.TypeId).Distinct().ToList(); + DataTable table = BLL.PhtglContractTrackService.GetMonthProjectAllTreeDataTable(this.CurrUser.LoginProjectId, string.Empty, contractNoList, professionalList, workPostIds, machineIds, startDate, endDate); + Grid1.DataSource = table; + Grid1.DataBind(); + for (int i = 0; i < this.Grid1.Rows.Count; i++) + { + if (string.IsNullOrEmpty(this.Grid1.Rows[i].DataKeys[2].ToString())) + { + foreach (GridColumn column in Grid1.Columns) + { + if (column.ColumnIndex != 0 && column.ColumnIndex != 1 && column.ColumnIndex != 2) + { + if (column.ColumnIndex > 5) + { + GroupField gf1 = column as GroupField; + foreach (var column1 in gf1.Columns) + { + GroupField gf2 = column1 as GroupField; + foreach (var column2 in gf2.Columns) + { + this.Grid1.Rows[i].CellCssClasses[column2.ColumnIndex] = "f-grid-cell-uneditable"; + } + } + } + else + { + this.Grid1.Rows[i].CellCssClasses[column.ColumnIndex] = "f-grid-cell-uneditable"; + } + } + } + } + } + } + + protected void txtMonth_TextChanged(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(this.txtMonth.Text.Trim())) + { + GetData(); + } + else + { + Grid1.DataSource = null; + Grid1.DataBind(); + Alert.ShowInTop("请选择月份!", MessageBoxIcon.Warning); + } + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/MonthConstructionLogWorkEfficiencySum.aspx.designer.cs b/SGGL/FineUIPro.Web/PZHGL/InformationProject/MonthConstructionLogWorkEfficiencySum.aspx.designer.cs new file mode 100644 index 00000000..6a7d9127 --- /dev/null +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/MonthConstructionLogWorkEfficiencySum.aspx.designer.cs @@ -0,0 +1,78 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.PZHGL.InformationProject { + + + public partial class MonthConstructionLogWorkEfficiencySum { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// txtMonth 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtMonth; + + /// + /// hdId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox hdId; + } +} diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLog.aspx.cs b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLog.aspx.cs index e6c0b450..55ce0406 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLog.aspx.cs +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLog.aspx.cs @@ -237,7 +237,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject { this.btnMenuAdd.Hidden = true; this.btnMenuEdit.Hidden = false; - this.btnMenuDown.Hidden = false; + //this.btnMenuDown.Hidden = false; this.btnMenuDelete.Hidden = false; } } @@ -333,6 +333,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject this.GridCQMSTomorrowPlan.DataSource = cqmss; this.GridCQMSTomorrowPlan.DataBind(); } + ChangeText(); } } diff --git a/SGGL/FineUIPro.Web/common/Menu_DigData.xml b/SGGL/FineUIPro.Web/common/Menu_DigData.xml index b3d0385c..b532a9bb 100644 --- a/SGGL/FineUIPro.Web/common/Menu_DigData.xml +++ b/SGGL/FineUIPro.Web/common/Menu_DigData.xml @@ -3,7 +3,7 @@ - + @@ -12,7 +12,7 @@ - + diff --git a/SGGL/FineUIPro.Web/common/Menu_PHTGL.xml b/SGGL/FineUIPro.Web/common/Menu_PHTGL.xml index 997760f7..4e56de27 100644 --- a/SGGL/FineUIPro.Web/common/Menu_PHTGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_PHTGL.xml @@ -36,4 +36,8 @@ + + + + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml index 342d91b8..03eb9188 100644 --- a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml @@ -48,22 +48,12 @@ - - - - - - - - + + + - - - - - - + @@ -89,7 +79,12 @@ - + + + + + +