diff --git a/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs b/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs index 32643bc9..85b8475c 100644 --- a/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs +++ b/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs @@ -1100,27 +1100,18 @@ namespace BLL decimal physicalCompletionQuantity = 0, materialConsumption = 0; if (we.Count() > 0) { - foreach (var w in we) - { - physicalCompletionQuantity += w.PhysicalCompletionQuantity ?? 0; - materialConsumption += w.MaterialConsumption ?? 0; - } + physicalCompletionQuantity = we.Sum(x => x.PhysicalCompletionQuantity ?? 0); + materialConsumption = we.Sum(x => x.MaterialConsumption ?? 0); row[9] = physicalCompletionQuantity; row[10] = 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); + var workEfficiencyList = workEfficiencys.Where(x => x.Type == "Person" && x.TypeId == workPostIds[i] && x.ContractTrackId == item.Id && x.ConsumeHours != null); if (workEfficiencyList.Count() > 0) { decimal d = 0; - foreach (var workEfficiency in workEfficiencyList) - { - if (workEfficiency.ConsumeHours != null) - { - d += decimal.Round(Convert.ToDecimal(workEfficiency.ConsumeHours), 2); - } - } + d = workEfficiencyList.Sum(x => x.ConsumeHours ?? 0); if (d > 0) { row[12 + i * 2] = decimal.Round(d, 2); @@ -1133,17 +1124,11 @@ namespace BLL } for (int i = 0; i < machineIds.Count; i++) { - var workEfficiencyList = workEfficiencys.Where(x => x.Type == "Machine" && x.TypeId == machineIds[i] && x.ContractTrackId == item.Id); + var workEfficiencyList = workEfficiencys.Where(x => x.Type == "Machine" && x.TypeId == machineIds[i] && x.ContractTrackId == item.Id && x.ConsumeHours != null); if (workEfficiencyList.Count() > 0) { decimal d = 0; - foreach (var workEfficiency in workEfficiencyList) - { - if (workEfficiency.ConsumeHours != null) - { - d += decimal.Round(Convert.ToDecimal(workEfficiency.ConsumeHours), 2); - } - } + d = workEfficiencyList.Sum(x => x.ConsumeHours ?? 0); if (d > 0) { row[52 + i * 2] = decimal.Round(d, 2); @@ -1188,27 +1173,18 @@ namespace BLL decimal physicalCompletionQuantity = 0, materialConsumption = 0; if (we.Count() > 0) { - foreach (var w in we) - { - physicalCompletionQuantity += w.PhysicalCompletionQuantity ?? 0; - materialConsumption += w.MaterialConsumption ?? 0; - } + physicalCompletionQuantity = we.Sum(x => x.PhysicalCompletionQuantity ?? 0); + materialConsumption = we.Sum(x => x.MaterialConsumption ?? 0); row[9] = physicalCompletionQuantity; row[10] = 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); + var workEfficiencyList = workEfficiencys.Where(x => x.Type == "Person" && x.TypeId == workPostIds[i] && x.ContractTrackId == item.Id && x.ConsumeHours != null); if (workEfficiencyList.Count() > 0) { decimal d = 0; - foreach (var workEfficiency in workEfficiencyList) - { - if (workEfficiency.ConsumeHours != null) - { - d += decimal.Round(Convert.ToDecimal(workEfficiency.ConsumeHours), 2); - } - } + d = workEfficiencyList.Sum(x => x.ConsumeHours ?? 0); if (d > 0) { row[12 + i * 2] = decimal.Round(d, 2); @@ -1221,17 +1197,11 @@ namespace BLL } for (int i = 0; i < machineIds.Count; i++) { - var workEfficiencyList = workEfficiencys.Where(x => x.Type == "Machine" && x.TypeId == machineIds[i] && x.ContractTrackId == item.Id); + var workEfficiencyList = workEfficiencys.Where(x => x.Type == "Machine" && x.TypeId == machineIds[i] && x.ContractTrackId == item.Id && x.ConsumeHours != null); if (workEfficiencyList.Count() > 0) { decimal d = 0; - foreach (var workEfficiency in workEfficiencyList) - { - if (workEfficiency.ConsumeHours != null) - { - d += decimal.Round(Convert.ToDecimal(workEfficiency.ConsumeHours), 2); - } - } + d = workEfficiencyList.Sum(x => x.ConsumeHours ?? 0); if (d > 0) { row[52 + i * 2] = decimal.Round(d, 2); diff --git a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractWBS.aspx.cs b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractWBS.aspx.cs index 64686ba1..19aed1fd 100644 --- a/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractWBS.aspx.cs +++ b/SGGL/FineUIPro.Web/PHTGL/ContractCompile/ContractWBS.aspx.cs @@ -177,7 +177,7 @@ namespace FineUIPro.Web.PHTGL.ContractCompile return; } string ID = Grid1.SelectedRow.DataKeys[0].ToString(); - var model = BLL.PhtglContractTrackService.GetPHTGL_ContractTrackById(ID[0].ToString()); + var model = BLL.PhtglContractTrackService.GetPHTGL_ContractTrackById(ID); if (model != null) ///已上报时不能删除 { PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ContractTrackMatchWBS.aspx?ContractTrackId={0}", ID, "编辑 - "))); @@ -215,8 +215,8 @@ namespace FineUIPro.Web.PHTGL.ContractCompile Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); return; } - object[] ID = Grid1.DataKeys[Grid1.SelectedRowIndex]; - var model = BLL.PhtglContractTrackService.GetPHTGL_ContractTrackById(ID[0].ToString()); + string ID = Grid1.SelectedRow.DataKeys[0].ToString(); + var model = BLL.PhtglContractTrackService.GetPHTGL_ContractTrackById(ID); if (model != null) ///已上报时不能删除 { PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ContractTrackMatchWBS.aspx?ContractTrackId={0}", ID, "编辑 - "))); diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLog.aspx.cs b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLog.aspx.cs index 6845bf99..b88371eb 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLog.aspx.cs +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLog.aspx.cs @@ -303,25 +303,55 @@ namespace FineUIPro.Web.PZHGL.InformationProject { foreach (var personLog in personLogs) { - if (!string.IsNullOrEmpty(personLog.HSETodaySummary) || !string.IsNullOrEmpty(personLog.HSETodaySummaryRemark) || !string.IsNullOrEmpty(personLog.HSETomorrowPlan) || !string.IsNullOrEmpty(personLog.HSETomorrowPlanRemark)) + var projectUser = SitePerson_PersonService.GetSitePersonByProjectIdPersonId(this.CurrUser.LoginProjectId, personLog.CompileMan); + if (projectUser != null) { - Model.ConstructionLogHSE hse = new Model.ConstructionLogHSE(); - hse.ConstructionLogId = personLog.ConstructionLogId; - hse.HSETodaySummary = personLog.HSETodaySummary; - hse.HSETodaySummaryRemark = personLog.HSETodaySummaryRemark; - hse.HSETomorrowPlan = personLog.HSETomorrowPlan; - hse.HSETomorrowPlanRemark = personLog.HSETomorrowPlanRemark; - hses.Add(hse); + if (projectUser.WorkPostId != BLL.Const.WorkPost_ConstructionManager) + { + if (!string.IsNullOrEmpty(personLog.HSETodaySummary) || !string.IsNullOrEmpty(personLog.HSETodaySummaryRemark) || !string.IsNullOrEmpty(personLog.HSETomorrowPlan) || !string.IsNullOrEmpty(personLog.HSETomorrowPlanRemark)) + { + Model.ConstructionLogHSE hse = new Model.ConstructionLogHSE(); + hse.ConstructionLogId = personLog.ConstructionLogId; + hse.HSETodaySummary = personLog.HSETodaySummary; + hse.HSETodaySummaryRemark = personLog.HSETodaySummaryRemark; + hse.HSETomorrowPlan = personLog.HSETomorrowPlan; + hse.HSETomorrowPlanRemark = personLog.HSETomorrowPlanRemark; + hses.Add(hse); + } + if (!string.IsNullOrEmpty(personLog.CQMSTodaySummary) || !string.IsNullOrEmpty(personLog.CQMSTodaySummaryRemark) || !string.IsNullOrEmpty(personLog.CQMSTomorrowPlan) || !string.IsNullOrEmpty(personLog.CQMSTomorrowPlanRemark)) + { + Model.ConstructionLogCQMS cqms = new Model.ConstructionLogCQMS(); + cqms.ConstructionLogId = personLog.ConstructionLogId; + cqms.CQMSTodaySummary = personLog.CQMSTodaySummary; + cqms.CQMSTodaySummaryRemark = personLog.CQMSTodaySummaryRemark; + cqms.CQMSTomorrowPlan = personLog.CQMSTomorrowPlan; + cqms.CQMSTomorrowPlanRemark = personLog.CQMSTomorrowPlanRemark; + cqmss.Add(cqms); + } + } } - if (!string.IsNullOrEmpty(personLog.CQMSTodaySummary) || !string.IsNullOrEmpty(personLog.CQMSTodaySummaryRemark) || !string.IsNullOrEmpty(personLog.CQMSTomorrowPlan) || !string.IsNullOrEmpty(personLog.CQMSTomorrowPlanRemark)) + else { - Model.ConstructionLogCQMS cqms = new Model.ConstructionLogCQMS(); - cqms.ConstructionLogId = personLog.ConstructionLogId; - cqms.CQMSTodaySummary = personLog.CQMSTodaySummary; - cqms.CQMSTodaySummaryRemark = personLog.CQMSTodaySummaryRemark; - cqms.CQMSTomorrowPlan = personLog.CQMSTomorrowPlan; - cqms.CQMSTomorrowPlanRemark = personLog.CQMSTomorrowPlanRemark; - cqmss.Add(cqms); + if (!string.IsNullOrEmpty(personLog.HSETodaySummary) || !string.IsNullOrEmpty(personLog.HSETodaySummaryRemark) || !string.IsNullOrEmpty(personLog.HSETomorrowPlan) || !string.IsNullOrEmpty(personLog.HSETomorrowPlanRemark)) + { + Model.ConstructionLogHSE hse = new Model.ConstructionLogHSE(); + hse.ConstructionLogId = personLog.ConstructionLogId; + hse.HSETodaySummary = personLog.HSETodaySummary; + hse.HSETodaySummaryRemark = personLog.HSETodaySummaryRemark; + hse.HSETomorrowPlan = personLog.HSETomorrowPlan; + hse.HSETomorrowPlanRemark = personLog.HSETomorrowPlanRemark; + hses.Add(hse); + } + if (!string.IsNullOrEmpty(personLog.CQMSTodaySummary) || !string.IsNullOrEmpty(personLog.CQMSTodaySummaryRemark) || !string.IsNullOrEmpty(personLog.CQMSTomorrowPlan) || !string.IsNullOrEmpty(personLog.CQMSTomorrowPlanRemark)) + { + Model.ConstructionLogCQMS cqms = new Model.ConstructionLogCQMS(); + cqms.ConstructionLogId = personLog.ConstructionLogId; + cqms.CQMSTodaySummary = personLog.CQMSTodaySummary; + cqms.CQMSTodaySummaryRemark = personLog.CQMSTodaySummaryRemark; + cqms.CQMSTomorrowPlan = personLog.CQMSTomorrowPlan; + cqms.CQMSTomorrowPlanRemark = personLog.CQMSTomorrowPlanRemark; + cqmss.Add(cqms); + } } } this.GridHSETodaySummary.DataSource = hses; diff --git a/SGGL/FineUIPro.Web/common/Menu_DigData.xml b/SGGL/FineUIPro.Web/common/Menu_DigData.xml index bb7a7a34..b532a9bb 100644 --- a/SGGL/FineUIPro.Web/common/Menu_DigData.xml +++ b/SGGL/FineUIPro.Web/common/Menu_DigData.xml @@ -1,51 +1,9 @@  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + @@ -58,15 +16,12 @@ - - - - - - - - + + + + + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/common/Menu_HTGL.xml b/SGGL/FineUIPro.Web/common/Menu_HTGL.xml index 129ab5fd..c0fc81f0 100644 --- a/SGGL/FineUIPro.Web/common/Menu_HTGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_HTGL.xml @@ -1,14 +1,12 @@  - - - + + + - - @@ -16,10 +14,7 @@ - - - - + diff --git a/SGGL/FineUIPro.Web/common/Menu_JDGL.xml b/SGGL/FineUIPro.Web/common/Menu_JDGL.xml index fd6a0762..8d4aa005 100644 --- a/SGGL/FineUIPro.Web/common/Menu_JDGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_JDGL.xml @@ -1,11 +1,7 @@  - + - - - - \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/common/Menu_PHTGL.xml b/SGGL/FineUIPro.Web/common/Menu_PHTGL.xml index 3ccb32ac..eb672a76 100644 --- a/SGGL/FineUIPro.Web/common/Menu_PHTGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_PHTGL.xml @@ -13,15 +13,7 @@ - - - - - - - - - + @@ -35,8 +27,13 @@ - + + + + + + \ 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 9bc36592..03eb9188 100644 --- a/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml +++ b/SGGL/FineUIPro.Web/common/Menu_ZHGL.xml @@ -48,6 +48,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +