diff --git a/SGGL/BLL/DigData/HTGLDataDWService.cs b/SGGL/BLL/DigData/HTGLDataDWService.cs index 9d980c22..592f7e2a 100644 --- a/SGGL/BLL/DigData/HTGLDataDWService.cs +++ b/SGGL/BLL/DigData/HTGLDataDWService.cs @@ -36,7 +36,7 @@ namespace BLL /// /// /// - public static IEnumerable getDataDWList( string projectId, DateTime? startTime, DateTime? endTime, Grid Grid1) + public static IEnumerable getDataDWList( string projectId, Grid Grid1) { var getDataList = from x in Funs.DB.Base_Project select x; if (!string.IsNullOrEmpty(projectId) && projectId != Const._Null) @@ -56,10 +56,29 @@ namespace BLL x.ProjectId, x.ProjectName, x.ProjectCode, - Count1=0, + Count1= getTotalProfit(x.ProjectId), }; } #endregion + public static string getTotalProfit(string projectId) + { + decimal contractAmount = 0; + var getContract = Funs.DB.PHTGL_Contract.Where(x => x.ProjectId == projectId); + if (getContract.Count() > 0) + { + contractAmount = getContract.Sum(x => x.ContractAmount ?? 0); + } + + decimal estimatedAmount = 0; + var getContractTrack = Funs.DB.PHTGL_ContractTrack.Where(x => x.ProjectId == projectId); + if (getContractTrack.Count() > 0) + { + estimatedAmount = getContractTrack.Sum(x => x.EstimatedAmount ?? 0); + } + + return estimatedAmount > 0 ? Math.Round(contractAmount / estimatedAmount).ToString() + "%" : "0%"; + + } } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/DigData/HTGLDataDW.aspx b/SGGL/FineUIPro.Web/DigData/HTGLDataDW.aspx index ef607b73..b74cfbd3 100644 --- a/SGGL/FineUIPro.Web/DigData/HTGLDataDW.aspx +++ b/SGGL/FineUIPro.Web/DigData/HTGLDataDW.aspx @@ -20,12 +20,12 @@ OnSelectedIndexChanged="btSearch_Click" Width="500px" EmptyText="请选择项目" EnableEdit="true"> - + --%> @@ -54,7 +54,7 @@ FieldType="String" HeaderText="项目名称" HeaderTextAlign="Center" TextAlign="Left"> + FieldType="String" HeaderText="项目总体毛利" HeaderTextAlign="Center" TextAlign="Right"> diff --git a/SGGL/FineUIPro.Web/DigData/HTGLDataDW.aspx.cs b/SGGL/FineUIPro.Web/DigData/HTGLDataDW.aspx.cs index 75c79984..4120f1f9 100644 --- a/SGGL/FineUIPro.Web/DigData/HTGLDataDW.aspx.cs +++ b/SGGL/FineUIPro.Web/DigData/HTGLDataDW.aspx.cs @@ -33,8 +33,7 @@ namespace FineUIPro.Web.DigData /// private void BindGrid() { - var getData = HTGLDataDWService.getDataDWList( this.drpProject.SelectedValue, - Funs.GetNewDateTime(this.txtStartTime.Text), Funs.GetNewDateTime(this.txtEndTime.Text),this.Grid1); + var getData = HTGLDataDWService.getDataDWList( this.drpProject.SelectedValue,this.Grid1); Grid1.RecordCount = HTGLDataDWService.count; Grid1.DataSource = getData; Grid1.DataBind(); diff --git a/SGGL/FineUIPro.Web/DigData/HTGLDataDW.aspx.designer.cs b/SGGL/FineUIPro.Web/DigData/HTGLDataDW.aspx.designer.cs index 83094669..5e45f235 100644 --- a/SGGL/FineUIPro.Web/DigData/HTGLDataDW.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/DigData/HTGLDataDW.aspx.designer.cs @@ -59,24 +59,6 @@ namespace FineUIPro.Web.DigData /// protected global::FineUIPro.DropDownList drpProject; - /// - /// txtStartTime 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DatePicker txtStartTime; - - /// - /// txtEndTime 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DatePicker txtEndTime; - /// /// ToolbarFill2 控件。 /// diff --git a/SGGL/FineUIPro.Web/DigData/ProjectDataDW.aspx b/SGGL/FineUIPro.Web/DigData/ProjectDataDW.aspx index 24f0e66e..688aac3c 100644 --- a/SGGL/FineUIPro.Web/DigData/ProjectDataDW.aspx +++ b/SGGL/FineUIPro.Web/DigData/ProjectDataDW.aspx @@ -110,17 +110,17 @@ - + - + - - - +<%-- + --%> + - + - + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/DigData/ProjectDataDW.aspx.cs b/SGGL/FineUIPro.Web/DigData/ProjectDataDW.aspx.cs index 76ab76ec..762f7fde 100644 --- a/SGGL/FineUIPro.Web/DigData/ProjectDataDW.aspx.cs +++ b/SGGL/FineUIPro.Web/DigData/ProjectDataDW.aspx.cs @@ -116,6 +116,26 @@ namespace FineUIPro.Web.DigData if (item == "HTGL") { this.gpHTGL.Hidden = false; + decimal contractAmount = 0; + var getContract = Funs.DB.PHTGL_Contract.Where(x => x.ProjectId == this.ProjectId); + if (getContract.Count() > 0) + { + contractAmount = getContract.Sum(x => x.ContractAmount ?? 0); + } + this.lbContractAmount.Text = contractAmount.ToString(); + + decimal estimatedAmount = 0; + var getContractTrack = Funs.DB.PHTGL_ContractTrack.Where(x => x.ProjectId == this.ProjectId); + if (getContractTrack.Count() > 0) + { + estimatedAmount = getContractTrack.Sum(x => x.EstimatedAmount ?? 0); + + } + this.lbEstimatedAmount.Text= estimatedAmount.ToString(); + + this.lbTotalProfit.Text = estimatedAmount > 0 ? Math.Round(contractAmount / estimatedAmount ).ToString() + "%" : "0%"; + + } if (item == "LW") { diff --git a/SGGL/FineUIPro.Web/DigData/ProjectDataDW.aspx.designer.cs b/SGGL/FineUIPro.Web/DigData/ProjectDataDW.aspx.designer.cs index e6515584..ff9e9930 100644 --- a/SGGL/FineUIPro.Web/DigData/ProjectDataDW.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/DigData/ProjectDataDW.aspx.designer.cs @@ -240,40 +240,31 @@ namespace FineUIPro.Web.DigData protected global::FineUIPro.Form Form4; /// - /// Label4 控件。 + /// lbContractAmount 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.Label Label4; + protected global::FineUIPro.Label lbContractAmount; /// - /// Label1 控件。 + /// lbEstimatedAmount 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.Label Label1; + protected global::FineUIPro.Label lbEstimatedAmount; /// - /// Label11 控件。 + /// lbTotalProfit 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.Label Label11; - - /// - /// Label6 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Label Label6; + protected global::FineUIPro.Label lbTotalProfit; /// /// Label12 控件。 @@ -347,6 +338,24 @@ namespace FineUIPro.Web.DigData /// protected global::FineUIPro.Label Label19; + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// labNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label labNumber; + /// /// gpLW 控件。 /// diff --git a/SGGL/FineUIPro.Web/HSSE/CostGoods/Expense.aspx.cs b/SGGL/FineUIPro.Web/HSSE/CostGoods/Expense.aspx.cs index 41ac41aa..95ea6f0d 100644 --- a/SGGL/FineUIPro.Web/HSSE/CostGoods/Expense.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/CostGoods/Expense.aspx.cs @@ -182,6 +182,7 @@ namespace FineUIPro.Web.HSSE.CostGoods orderby y.Year, x.SupSortIndex, x.SortIndex select new { x.ExpenseDetailId, x.ExpenseId, y.Year, x.SupCostTypeId, x.SupCostTypeName, x.SupSortIndex, x.CostType, x.CostTypeName, x.SortIndex, x.CostMoney }; var getType = (from x in getDetail select new { x.SupSortIndex, x.SortIndex, x.CostType }).Distinct(); + int j = 1; foreach (var item in getType) { var getD = getDetail.FirstOrDefault(x => x.CostType == item.CostType); @@ -208,8 +209,30 @@ namespace FineUIPro.Web.HSSE.CostGoods } row[r] = getDetail.Where(x => x.CostType == item.CostType).Sum(x => x.CostMoney ?? 0); table.Rows.Add(row); + j = r + 1; } } + + DataRow rowSum = table.NewRow(); + rowSum[0] = SQLHelper.GetNewID(); + rowSum[1] = ""; + rowSum[2] = "合计"; + int rSum = 3; + for (int i = 0; sDate + i <= eDate; i++) + { + var getV = getDetail.Where(x => x.Year == sDate + i ); + if (getV.Count() > 0) + { + rowSum[rSum] = getV.Sum(x => x.CostMoney ?? 0); + } + else + { + rowSum[rSum] = 0.00; + } + + rSum = rSum + 1; + } + table.Rows.Add(rowSum); }