diff --git a/SGGL/BLL/JDGL/WBS/WorkloadStatisticsService.cs b/SGGL/BLL/JDGL/WBS/WorkloadStatisticsService.cs index 55d5be72..b6721cd8 100644 --- a/SGGL/BLL/JDGL/WBS/WorkloadStatisticsService.cs +++ b/SGGL/BLL/JDGL/WBS/WorkloadStatisticsService.cs @@ -46,7 +46,7 @@ namespace BLL var installations = from x in db.Project_Installation where x.ProjectId == projectId select x; CostControlDetailStatisticsList = (from x in db.View_WBS_CostControlDetailStatistics where x.ProjectId == projectId select x).Distinct().ToList(); List newList = new List(); - var installationList = CostControlDetailStatisticsList.Where(x => x.WBSType == "Installation"); + var installationList = CostControlDetailStatisticsList.Where(x => x.WBSType == "Installation" && x.SupId == "0"); foreach (var item in installationList) { newList.Add(item); diff --git a/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadStatistics.aspx b/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadStatistics.aspx index 90601aa8..4a86ab7e 100644 --- a/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadStatistics.aspx +++ b/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadStatistics.aspx @@ -46,6 +46,15 @@ + + + + + + diff --git a/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadStatistics.aspx.cs b/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadStatistics.aspx.cs index e4c40077..fe530916 100644 --- a/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadStatistics.aspx.cs +++ b/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadStatistics.aspx.cs @@ -1,4 +1,5 @@ using BLL; +using Newtonsoft.Json; using System; using System.Data; using System.Linq; @@ -108,6 +109,114 @@ namespace FineUIPro.Web.JDGL.WBS } #endregion + #region 推送数据 + /// + /// 推送数据按钮 + /// + /// + /// + protected void btnSend_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(this.txtMonths.Text.Trim())) + { + DateTime month = Convert.ToDateTime(this.txtMonths.Text.Trim()); + //基准 = 施工所有计划费用 + //本月PV = 本月预算费用 / 基准 + //本月EV = 本月已完成工作的预算费用 / 基准 + //本月AC = 本月实际费用 / 基准 + //累计PV = 累计预算费用 / 基准 + //累计EV = 累计已完成工作的预算费用 / 基准 + //累计AC = 累计实际费用 / 基准 + var totalCostControl = (from x in Funs.DB.WBS_CostControl where x.ProjectId == this.CurrUser.LoginProjectId && x.TotalNum != null select x); + double baseMoney = Convert.ToDouble(totalCostControl.Sum(x => (x.TotalNum ?? 0) * (x.PlanPrice ?? 0))); + Model.Project_Installation installation = BLL.Project_InstallationService.GetProjectInstallationByProjectId(this.CurrUser.LoginProjectId); + if (installation != null) + { + var thisDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailViewByParentIdAndMonths(installation.InstallationId, month); + if (thisDetail != null) + { + var getPro = new + { + projId = 2370, + projName = "", + ppsId = 3, + ppsName = "施工", + performanceDate = this.txtMonths.Text.Trim() + "-25", + pv = Math.Round((thisDetail.ThisPlanValue??0) / baseMoney,4), + ev = Math.Round((thisDetail.ThisPlanCost ?? 0) / baseMoney, 4), + ac = Math.Round((thisDetail.ThisRealCost ?? 0) / baseMoney, 4), + totalPv = Math.Round((thisDetail.TotalPlanValue ?? 0) / baseMoney, 4), + totalEv = Math.Round((thisDetail.TotalPlanCost ?? 0) / baseMoney, 4), + totalAc = Math.Round((thisDetail.TotalRealCost ?? 0) / baseMoney, 4), + remark = "" + }; + string contenttype = "application/json;charset=utf-8"; + string parm = JsonConvert.SerializeObject(getPro); + var returndata = BLL.APIGetHttpService.ControlHttp(Funs.ControlApiUrl + "/Projects/SaveProjConstructionPerformance", "POST", contenttype, null, parm); + } + } + } + else + { + Alert.ShowInTop("请选择月份!", MessageBoxIcon.Warning); + } + } + #endregion + + #region 删除数据 + /// + /// 删除数据按钮 + /// + /// + /// + protected void btnDelete_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(this.txtMonths.Text.Trim())) + { + DateTime month = Convert.ToDateTime(this.txtMonths.Text.Trim()); + var getPro = new + { + id = "9216a478-5f2f-4905-b7a0-08d99532e685" + }; + string contenttype = "application/json;charset=utf-8"; + string parm = JsonConvert.SerializeObject(getPro); + //var returndata = BLL.APIGetHttpService.ControlHttp(Funs.ControlApiUrl + "/Projects/DeleteProjConstructionPerformance", "DELETE", contenttype, null, parm); + var returndata = BLL.APIGetHttpService.ControlHttp(Funs.ControlApiUrl + "/Projects/DeleteProjConstructionPerformance?id=9216a478-5f2f-4905-b7a0-08d99532e685", "DELETE", contenttype, null, null); + } + else + { + Alert.ShowInTop("请选择月份!", MessageBoxIcon.Warning); + } + } + #endregion + + #region 查询数据 + /// + /// 查询数据按钮 + /// + /// + /// + protected void btnCheck_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(this.txtMonths.Text.Trim())) + { + DateTime month = Convert.ToDateTime(this.txtMonths.Text.Trim()); + var getPro = new + { + id = "9216a478-5f2f-4905-b7a0-08d99532e685" + }; + string contenttype = "application/json;charset=utf-8"; + string parm = JsonConvert.SerializeObject(getPro); + //var returndata = BLL.APIGetHttpService.ControlHttp(Funs.ControlApiUrl + "/Projects/DeleteProjConstructionPerformance", "DELETE", contenttype, null, parm); + var returndata = BLL.APIGetHttpService.ControlHttp(Funs.ControlApiUrl + "/Projects/GetProjConstructionPerformanceList?id=793f2e98-32f5-4141-0f91-08d9975cc748", "GET", contenttype, null, null); + } + else + { + Alert.ShowInTop("请选择月份!", MessageBoxIcon.Warning); + } + } + #endregion + #region 统计类型选择事件 /// /// 统计类型选择事件 diff --git a/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadStatistics.aspx.designer.cs b/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadStatistics.aspx.designer.cs index 48ed35cc..a89dba7e 100644 --- a/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadStatistics.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadStatistics.aspx.designer.cs @@ -102,6 +102,33 @@ namespace FineUIPro.Web.JDGL.WBS { /// protected global::FineUIPro.Button btnSearch; + /// + /// btnSend 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSend; + + /// + /// btnDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDelete; + + /// + /// btnCheck 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnCheck; + /// /// btnOut 控件。 /// diff --git a/SGGL/FineUIPro.Web/ProjectData/Installation.aspx.cs b/SGGL/FineUIPro.Web/ProjectData/Installation.aspx.cs index e12deaca..484306ae 100644 --- a/SGGL/FineUIPro.Web/ProjectData/Installation.aspx.cs +++ b/SGGL/FineUIPro.Web/ProjectData/Installation.aspx.cs @@ -241,7 +241,6 @@ namespace FineUIPro.Web.ProjectData { if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectInstallationMenuId, BLL.Const.BtnAdd)) { - string url = Funs.RealNameApiUrl + "/Projects/GetConstructionWbsList"; string contenttype = "application/json;charset=utf-8"; var returndata = BLL.APIGetHttpService.ControlHttp(Funs.ControlApiUrl + "/Projects/GetConstructionWbsList?ProjId=" + 2370, "GET", contenttype, null, null); if (!string.IsNullOrEmpty(returndata))