1028-gaofei
This commit is contained in:
parent
6b41214a49
commit
537a0e8894
|
@ -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<Model.View_WBS_CostControlDetailStatistics> newList = new List<Model.View_WBS_CostControlDetailStatistics>();
|
||||
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);
|
||||
|
|
|
@ -46,6 +46,15 @@
|
|||
<f:Button ID="btnSearch" Text="查询" MarginLeft="40px" EnablePostBack="true" runat="server"
|
||||
OnClick="btnSearch_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnSend" Text="推送数据" EnablePostBack="true" runat="server"
|
||||
OnClick="btnSend_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnDelete" Text="删除数据" EnablePostBack="true" runat="server"
|
||||
OnClick="btnDelete_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnCheck" Text="查询数据" EnablePostBack="true" runat="server"
|
||||
OnClick="btnCheck_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
|
||||
EnableAjax="false" DisableControlBeforePostBack="false">
|
||||
</f:Button>
|
||||
|
|
|
@ -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 推送数据
|
||||
/// <summary>
|
||||
/// 推送数据按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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 删除数据
|
||||
/// <summary>
|
||||
/// 删除数据按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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 查询数据
|
||||
/// <summary>
|
||||
/// 查询数据按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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 统计类型选择事件
|
||||
/// <summary>
|
||||
/// 统计类型选择事件
|
||||
|
|
|
@ -102,6 +102,33 @@ namespace FineUIPro.Web.JDGL.WBS {
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSearch;
|
||||
|
||||
/// <summary>
|
||||
/// btnSend 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSend;
|
||||
|
||||
/// <summary>
|
||||
/// btnDelete 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnDelete;
|
||||
|
||||
/// <summary>
|
||||
/// btnCheck 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnCheck;
|
||||
|
||||
/// <summary>
|
||||
/// btnOut 控件。
|
||||
/// </summary>
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue