20231008项目合同大数据展示、费用计划加合计行

This commit is contained in:
2023-10-08 10:59:38 +08:00
parent b574fe7220
commit 3c3c531016
8 changed files with 122 additions and 47 deletions
+21 -2
View File
@@ -36,7 +36,7 @@ namespace BLL
/// <param name="endTime"></param>
/// <param name="Grid1"></param>
/// <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;
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%";
}
}
}