0718-修改进度数据录入保存方法

This commit is contained in:
2022-07-18 15:33:29 +08:00
parent 1f471c2f56
commit bec6bc5fc0
4 changed files with 29 additions and 17 deletions
@@ -361,6 +361,8 @@ namespace FineUIPro.Web.JDGL.WBS
Model.WBS_CostControl costControl = BLL.CostControlService.GetCostControlByCostControlId(costControlId);
if (costControl != null)
{
decimal oldPlanPrice = costControl.PlanPrice ?? 0;
decimal oldRealPrice = costControl.RealPrice ?? 0;
string totalNum = values.Value<string>("TotalNum");
string planPrice = values.Value<string>("PlanPrice");
string realPrice = values.Value<string>("RealPrice");
@@ -381,9 +383,9 @@ namespace FineUIPro.Web.JDGL.WBS
Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlIdAndMonths(costControlId, months[j]);
if (costControlDetail != null)
{
oldThisPlanValue = (costControlDetail.PlanNum ?? 0) * (costControl.PlanPrice ?? 0);
oldThisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0);
oldThisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0);
oldThisPlanValue = (costControlDetail.PlanNum ?? 0) * oldPlanPrice;
oldThisRealCost = (costControlDetail.ThisNum ?? 0) * oldRealPrice;
oldThisPlanCost = (costControlDetail.ThisNum ?? 0) * oldPlanPrice;
costControlDetail.PlanNum = Funs.GetNewDecimalOrZero(planNum);
costControlDetail.ThisNum = Funs.GetNewDecimalOrZero(thisNum);
thisPlanValue = (costControlDetail.PlanNum ?? 0) * (costControl.PlanPrice ?? 0);
@@ -174,6 +174,7 @@ namespace FineUIPro.Web.JDGL.WBS
where x.ProjectId == this.CurrUser.LoginProjectId
select x;
foreach (JObject mergedRow in Grid1.GetMergedData())
//foreach (JObject mergedRow in Grid1.GetModifiedData())
{
JObject values = mergedRow.Value<JObject>("values");
int i = mergedRow.Value<int>("index");
@@ -182,6 +183,8 @@ namespace FineUIPro.Web.JDGL.WBS
Model.WBS_CostControl costControl = oldViewInfos.FirstOrDefault(x => x.CostControlId == this.Grid1.Rows[i].DataKeys[2].ToString());
if (costControl != null)
{
decimal oldPlanPrice = costControl.PlanPrice ?? 0;
decimal oldRealPrice = costControl.RealPrice ?? 0;
string costControlId = costControl.CostControlId;
string totalNum = values.Value<string>("TotalNum");
string planPrice = values.Value<string>("PlanPrice");
@@ -211,9 +214,9 @@ namespace FineUIPro.Web.JDGL.WBS
Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlIdAndMonths(costControlId, months[j]);
if (costControlDetail != null)
{
oldThisPlanValue = (costControlDetail.PlanNum ?? 0) * (costControl.PlanPrice ?? 0);
oldThisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0);
oldThisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0);
oldThisPlanValue = (costControlDetail.PlanNum ?? 0) * oldPlanPrice;
oldThisRealCost = (costControlDetail.ThisNum ?? 0) * oldRealPrice;
oldThisPlanCost = (costControlDetail.ThisNum ?? 0) * oldPlanPrice;
costControlDetail.PlanNum = Funs.GetNewDecimalOrZero(planNum);
costControlDetail.ThisNum = Funs.GetNewDecimalOrZero(thisNum);
thisPlanValue = (costControlDetail.PlanNum ?? 0) * (costControl.PlanPrice ?? 0);
@@ -337,7 +337,7 @@ namespace FineUIPro.Web.JDGL.WBS
{
result += "第" + (i + 2).ToString() + "行," + "实际开始时间" + "," + "[" + row + "]格式错误!" + "|";
}
else if (j == 8)
else if (j == 8)
{
result += "第" + (i + 2).ToString() + "行," + "实际完成时间" + "," + "[" + row + "]格式错误!" + "|";
}
@@ -480,6 +480,8 @@ namespace FineUIPro.Web.JDGL.WBS
Model.WBS_CostControl costControl = oldViewInfos.FirstOrDefault(x => x.CostControlId == pds.Rows[i][Cols - 1].ToString());
if (costControl != null)
{
decimal oldPlanPrice = costControl.PlanPrice ?? 0;
decimal oldRealPrice = costControl.RealPrice ?? 0;
costControl.TotalNum = Funs.GetNewDecimal(pds.Rows[i][2].ToString().Trim());
costControl.PlanPrice = Funs.GetNewDecimal(pds.Rows[i][3].ToString().Trim());
costControl.RealPrice = Funs.GetNewDecimal(pds.Rows[i][4].ToString().Trim());
@@ -501,9 +503,9 @@ namespace FineUIPro.Web.JDGL.WBS
Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlIdAndMonths(costControl.CostControlId, months[j]);
if (costControlDetail != null)
{
oldThisPlanValue = (costControlDetail.PlanNum ?? 0) * (costControl.PlanPrice ?? 0);
oldThisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0);
oldThisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0);
oldThisPlanValue = (costControlDetail.PlanNum ?? 0) * oldPlanPrice;
oldThisRealCost = (costControlDetail.ThisNum ?? 0) * oldRealPrice;
oldThisPlanCost = (costControlDetail.ThisNum ?? 0) * oldPlanPrice;
costControlDetail.PlanNum = Funs.GetNewDecimalOrZero(planNum);
costControlDetail.ThisNum = Funs.GetNewDecimalOrZero(thisNum);
thisPlanValue = (costControlDetail.PlanNum ?? 0) * (costControl.PlanPrice ?? 0);