20231008项目合同大数据展示、费用计划加合计行
This commit is contained in:
@@ -36,7 +36,7 @@ namespace BLL
|
|||||||
/// <param name="endTime"></param>
|
/// <param name="endTime"></param>
|
||||||
/// <param name="Grid1"></param>
|
/// <param name="Grid1"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
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;
|
var getDataList = from x in Funs.DB.Base_Project select x;
|
||||||
if (!string.IsNullOrEmpty(projectId) && projectId != Const._Null)
|
if (!string.IsNullOrEmpty(projectId) && projectId != Const._Null)
|
||||||
@@ -56,10 +56,29 @@ namespace BLL
|
|||||||
x.ProjectId,
|
x.ProjectId,
|
||||||
x.ProjectName,
|
x.ProjectName,
|
||||||
x.ProjectCode,
|
x.ProjectCode,
|
||||||
Count1=0,
|
Count1= getTotalProfit(x.ProjectId),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endregion
|
#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%";
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -20,12 +20,12 @@
|
|||||||
OnSelectedIndexChanged="btSearch_Click" Width="500px"
|
OnSelectedIndexChanged="btSearch_Click" Width="500px"
|
||||||
EmptyText="请选择项目" EnableEdit="true">
|
EmptyText="请选择项目" EnableEdit="true">
|
||||||
</f:DropDownList>
|
</f:DropDownList>
|
||||||
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" EmptyText="开始日期"
|
<%-- <f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" EmptyText="开始日期"
|
||||||
ID="txtStartTime" EnableEdit="false" Hidden="true">
|
ID="txtStartTime" EnableEdit="false" Hidden="true">
|
||||||
</f:DatePicker>
|
</f:DatePicker>
|
||||||
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" EmptyText="结束日期"
|
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" EmptyText="结束日期"
|
||||||
ID="txtEndTime" EnableEdit="false" Hidden="true">
|
ID="txtEndTime" EnableEdit="false" Hidden="true">
|
||||||
</f:DatePicker>
|
</f:DatePicker>--%>
|
||||||
<f:ToolbarFill ID="ToolbarFill2" runat="server">
|
<f:ToolbarFill ID="ToolbarFill2" runat="server">
|
||||||
</f:ToolbarFill>
|
</f:ToolbarFill>
|
||||||
<f:Button ID="btSearch" Text="查询" Icon="SystemSearch" runat="server" OnClick="btSearch_Click"></f:Button>
|
<f:Button ID="btSearch" Text="查询" Icon="SystemSearch" runat="server" OnClick="btSearch_Click"></f:Button>
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
FieldType="String" HeaderText="项目名称" HeaderTextAlign="Center" TextAlign="Left">
|
FieldType="String" HeaderText="项目名称" HeaderTextAlign="Center" TextAlign="Left">
|
||||||
</f:RenderField>
|
</f:RenderField>
|
||||||
<f:RenderField Width="150px" ColumnID="Count1" DataField="Count1"
|
<f:RenderField Width="150px" ColumnID="Count1" DataField="Count1"
|
||||||
FieldType="Int" HeaderText="项目总体毛利" HeaderTextAlign="Center" TextAlign="Right">
|
FieldType="String" HeaderText="项目总体毛利" HeaderTextAlign="Center" TextAlign="Right">
|
||||||
</f:RenderField>
|
</f:RenderField>
|
||||||
</Columns>
|
</Columns>
|
||||||
<PageItems>
|
<PageItems>
|
||||||
|
|||||||
@@ -33,8 +33,7 @@ namespace FineUIPro.Web.DigData
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void BindGrid()
|
private void BindGrid()
|
||||||
{
|
{
|
||||||
var getData = HTGLDataDWService.getDataDWList( this.drpProject.SelectedValue,
|
var getData = HTGLDataDWService.getDataDWList( this.drpProject.SelectedValue,this.Grid1);
|
||||||
Funs.GetNewDateTime(this.txtStartTime.Text), Funs.GetNewDateTime(this.txtEndTime.Text),this.Grid1);
|
|
||||||
Grid1.RecordCount = HTGLDataDWService.count;
|
Grid1.RecordCount = HTGLDataDWService.count;
|
||||||
Grid1.DataSource = getData;
|
Grid1.DataSource = getData;
|
||||||
Grid1.DataBind();
|
Grid1.DataBind();
|
||||||
|
|||||||
@@ -59,24 +59,6 @@ namespace FineUIPro.Web.DigData
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.DropDownList drpProject;
|
protected global::FineUIPro.DropDownList drpProject;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// txtStartTime 控件。
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// 自动生成的字段。
|
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|
||||||
/// </remarks>
|
|
||||||
protected global::FineUIPro.DatePicker txtStartTime;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// txtEndTime 控件。
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// 自动生成的字段。
|
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|
||||||
/// </remarks>
|
|
||||||
protected global::FineUIPro.DatePicker txtEndTime;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ToolbarFill2 控件。
|
/// ToolbarFill2 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -110,17 +110,17 @@
|
|||||||
<Rows>
|
<Rows>
|
||||||
<f:FormRow>
|
<f:FormRow>
|
||||||
<Items>
|
<Items>
|
||||||
<f:Label ID="Label4" runat="server" Label="合同签约价">
|
<f:Label ID="lbContractAmount" runat="server" Label="合同签约价">
|
||||||
</f:Label>
|
</f:Label>
|
||||||
<f:Label ID="Label1" runat="server" Label="概算">
|
<f:Label ID="lbEstimatedAmount" runat="server" Label="概算">
|
||||||
</f:Label>
|
</f:Label>
|
||||||
<f:Label ID="Label11" runat="server" Label="单合同毛利">
|
<%-- <f:Label ID="Label11" runat="server" Label="单合同毛利">
|
||||||
</f:Label>
|
</f:Label>--%>
|
||||||
<f:Label ID="Label6" runat="server" Label="项目总体毛利">
|
<f:Label ID="lbTotalProfit" runat="server" Label="项目总体毛利">
|
||||||
</f:Label>
|
</f:Label>
|
||||||
</Items>
|
</Items>
|
||||||
</f:FormRow>
|
</f:FormRow>
|
||||||
<f:FormRow>
|
<f:FormRow Hidden="true">
|
||||||
<Items>
|
<Items>
|
||||||
<f:Label ID="Label12" runat="server" Label="合同进度百分比">
|
<f:Label ID="Label12" runat="server" Label="合同进度百分比">
|
||||||
</f:Label>
|
</f:Label>
|
||||||
@@ -132,7 +132,7 @@
|
|||||||
</f:Label>
|
</f:Label>
|
||||||
</Items>
|
</Items>
|
||||||
</f:FormRow>
|
</f:FormRow>
|
||||||
<f:FormRow>
|
<f:FormRow Hidden="true">
|
||||||
<Items>
|
<Items>
|
||||||
<f:Label ID="Label16" runat="server" Label="合同签证率">
|
<f:Label ID="Label16" runat="server" Label="合同签证率">
|
||||||
</f:Label>
|
</f:Label>
|
||||||
@@ -144,6 +144,29 @@
|
|||||||
</f:Label>
|
</f:Label>
|
||||||
</Items>
|
</Items>
|
||||||
</f:FormRow>
|
</f:FormRow>
|
||||||
|
<f:FormRow>
|
||||||
|
<Items>
|
||||||
|
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="合同"
|
||||||
|
runat="server" BoxFlex="1" DataKeyNames="ProjectId" DataIDField="ProjectId" ForceFit="true"
|
||||||
|
AllowSorting="true" SortField="DropMainContractCode" SortDirection="DESC"
|
||||||
|
EnableColumnLines="true" AllowPaging="false" PageSize="100" EnableTextSelection="True">
|
||||||
|
<Columns>
|
||||||
|
<f:TemplateField ColumnID="tfNumber" Width="55px" HeaderText="序号" HeaderTextAlign="Center" TextAlign="Center"
|
||||||
|
EnableLock="true" Locked="False">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Label ID="labNumber" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
|
||||||
|
</ItemTemplate>
|
||||||
|
</f:TemplateField>
|
||||||
|
<f:RenderField Width="120px" ColumnID="DropMainContractCode" DataField="DropMainContractCode"
|
||||||
|
FieldType="String" HeaderText="合同号" HeaderTextAlign="Center" TextAlign="Left">
|
||||||
|
</f:RenderField>
|
||||||
|
<f:RenderField Width="150px" ColumnID="Count1" DataField="Count1"
|
||||||
|
FieldType="String" HeaderText="单合同毛利" HeaderTextAlign="Center" TextAlign="Right">
|
||||||
|
</f:RenderField>
|
||||||
|
</Columns>
|
||||||
|
</f:Grid>
|
||||||
|
</Items>
|
||||||
|
</f:FormRow>
|
||||||
</Rows>
|
</Rows>
|
||||||
</f:Form>
|
</f:Form>
|
||||||
</Items>
|
</Items>
|
||||||
|
|||||||
@@ -116,6 +116,26 @@ namespace FineUIPro.Web.DigData
|
|||||||
if (item == "HTGL")
|
if (item == "HTGL")
|
||||||
{
|
{
|
||||||
this.gpHTGL.Hidden = false;
|
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")
|
if (item == "LW")
|
||||||
{
|
{
|
||||||
|
|||||||
+24
-15
@@ -240,40 +240,31 @@ namespace FineUIPro.Web.DigData
|
|||||||
protected global::FineUIPro.Form Form4;
|
protected global::FineUIPro.Form Form4;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Label4 控件。
|
/// lbContractAmount 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// 自动生成的字段。
|
/// 自动生成的字段。
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.Label Label4;
|
protected global::FineUIPro.Label lbContractAmount;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Label1 控件。
|
/// lbEstimatedAmount 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// 自动生成的字段。
|
/// 自动生成的字段。
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.Label Label1;
|
protected global::FineUIPro.Label lbEstimatedAmount;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Label11 控件。
|
/// lbTotalProfit 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// 自动生成的字段。
|
/// 自动生成的字段。
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.Label Label11;
|
protected global::FineUIPro.Label lbTotalProfit;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Label6 控件。
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// 自动生成的字段。
|
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
|
||||||
/// </remarks>
|
|
||||||
protected global::FineUIPro.Label Label6;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Label12 控件。
|
/// Label12 控件。
|
||||||
@@ -347,6 +338,24 @@ namespace FineUIPro.Web.DigData
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.Label Label19;
|
protected global::FineUIPro.Label Label19;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Grid1 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.Grid Grid1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// labNumber 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.Label labNumber;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// gpLW 控件。
|
/// gpLW 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
|||||||
orderby y.Year, x.SupSortIndex, x.SortIndex
|
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 };
|
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();
|
var getType = (from x in getDetail select new { x.SupSortIndex, x.SortIndex, x.CostType }).Distinct();
|
||||||
|
int j = 1;
|
||||||
foreach (var item in getType)
|
foreach (var item in getType)
|
||||||
{
|
{
|
||||||
var getD = getDetail.FirstOrDefault(x => x.CostType == item.CostType);
|
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);
|
row[r] = getDetail.Where(x => x.CostType == item.CostType).Sum(x => x.CostMoney ?? 0);
|
||||||
table.Rows.Add(row);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user