1028-gaofei

This commit is contained in:
gaofei
2021-10-28 18:24:30 +08:00
parent 6b41214a49
commit 537a0e8894
5 changed files with 146 additions and 2 deletions
@@ -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>
/// 统计类型选择事件