2023-03-01 合同增加主办部门
This commit is contained in:
@@ -212,6 +212,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
var table = this.GetPagedDataTable(Grid1, list);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
lbSinglePreRate.Text= GetSinglePreRateByUnitWork(this.tvControlItem.SelectedNodeID);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -394,7 +395,47 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
}
|
||||
return PipeAreaValue;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取图纸预制率(工厂预制管线的预制达因/工厂预制管线的总达因)
|
||||
/// </summary>
|
||||
/// <param name="unitworkid"></param>
|
||||
/// <returns></returns>
|
||||
private string GetSinglePreRateByUnitWork(string unitworkid)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
var pipeline=from x in db.View_HJGL_Pipeline where x.UnitWorkId == unitworkid && x.PipeArea=="1" select x;
|
||||
var q = from x in db.View_HJGL_WeldJoint where x.UnitWorkId == unitworkid select x;
|
||||
string rate = "";
|
||||
|
||||
if (q != null && q.Count() > 0)
|
||||
{
|
||||
var proSum = (from x in q
|
||||
join y in pipeline on x.PipelineId equals y.PipelineId into temp
|
||||
from tt in temp.DefaultIfEmpty()
|
||||
where x.JointAttribute == "预制口"
|
||||
group x by x.UnitWorkId into g
|
||||
select new
|
||||
{
|
||||
SizeSum = g.Sum(x => x.Size)
|
||||
}).FirstOrDefault().SizeSum;
|
||||
var AllSum = (from x in pipeline
|
||||
group x by x.UnitWorkId into g
|
||||
select new
|
||||
{
|
||||
SizeSum = g.Sum(x => x.TotalDin)
|
||||
}).FirstOrDefault().SizeSum;
|
||||
|
||||
proSum = (proSum != null) ? proSum : 0;
|
||||
if (AllSum > 0)
|
||||
{
|
||||
var a = (decimal)100 * proSum / AllSum;
|
||||
rate = Math.Round((decimal)a, 1).ToString() + "%";
|
||||
}
|
||||
|
||||
return rate;
|
||||
}
|
||||
return "0%";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user