2023-06-28
This commit is contained in:
@@ -234,16 +234,22 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
this.BindGrid1(this.tvControlItem.SelectedNodeID);
|
||||
this.BindGrid2(this.tvControlItem.SelectedNodeID);
|
||||
this.BindGrid3(this.tvControlItem.SelectedNodeID);
|
||||
this.lbSinglePreRate.Label = "图纸预制率";
|
||||
this.lbSinglePreRate.Label = "图纸预制率(达因)";
|
||||
this.lbSinglePreRate.Text = GetRateByPipelineid(this.tvControlItem.SelectedNodeID);
|
||||
|
||||
this.lbSinglePreRateByWeldJoint.Label = "图纸预制率(焊口)";
|
||||
this.lbSinglePreRateByWeldJoint.Text = GetWeldJointRateByPipelineid(this.tvControlItem.SelectedNodeID);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
this.hdUnitWorkId.Text = this.tvControlItem.SelectedNodeID;
|
||||
this.lbSinglePreRate.Label = "主项预制率";
|
||||
this.lbSinglePreRate.Label = "主项预制率(达因)";
|
||||
this.lbSinglePreRate.Text = GetRateByUnitWork(this.tvControlItem.SelectedNodeID);
|
||||
|
||||
this.lbSinglePreRateByWeldJoint.Label = "主项预制率(焊口)";
|
||||
this.lbSinglePreRateByWeldJoint.Text = GetWeldJointRateByUnitWork(this.tvControlItem.SelectedNodeID);
|
||||
|
||||
}
|
||||
this.lbShopSize.Text = ShopSumSize;
|
||||
this.lbFiledSize.Text = FieldSumSize;
|
||||
@@ -437,6 +443,37 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
}
|
||||
return "0%";
|
||||
}
|
||||
|
||||
private string GetWeldJointRateByUnitWork(string unitworkid)
|
||||
{
|
||||
string rate = "";
|
||||
int ShopNum = 0;
|
||||
int FieldNum = 0;
|
||||
int AllNum = 0;
|
||||
var db = Funs.DB;
|
||||
var q = from x in db.View_HJGL_WeldJoint where x.UnitWorkId == unitworkid select x;
|
||||
if (q != null && q.Count() > 0)
|
||||
{
|
||||
ShopNum = (from x in q
|
||||
where x.JointAttribute == "预制口"
|
||||
select x
|
||||
).Count();
|
||||
FieldNum = (from x in q
|
||||
where x.JointAttribute == "安装口"
|
||||
select x
|
||||
).Count();
|
||||
AllNum = ShopNum + FieldNum;
|
||||
|
||||
if (AllNum > 0)
|
||||
{
|
||||
var a = (decimal)100 * ShopNum / AllNum;
|
||||
rate = Math.Round((decimal)a, 1).ToString() + "%";
|
||||
}
|
||||
|
||||
return rate;
|
||||
}
|
||||
return "0%";
|
||||
}
|
||||
private string GetRateByPipelineid(string pipelineid)
|
||||
{
|
||||
string rate = "";
|
||||
@@ -484,8 +521,41 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
}
|
||||
return "0%";
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取预制率(焊口) 预制口数量/总焊口数量
|
||||
/// </summary>
|
||||
/// <param name="pipelineid"></param>
|
||||
/// <returns></returns>
|
||||
private string GetWeldJointRateByPipelineid(string pipelineid)
|
||||
{
|
||||
string rate = "";
|
||||
int ShopNum = 0;
|
||||
int FieldNum = 0;
|
||||
int AllNum = 0;
|
||||
var db = Funs.DB;
|
||||
var q = from x in db.View_HJGL_WeldJoint where x.PipelineId == pipelineid select x;
|
||||
if (q != null && q.Count() > 0)
|
||||
{
|
||||
ShopNum = (from x in q
|
||||
where x.JointAttribute == "预制口" select x
|
||||
).Count();
|
||||
FieldNum = (from x in q
|
||||
where x.JointAttribute == "安装口"
|
||||
select x
|
||||
).Count();
|
||||
AllNum = ShopNum + FieldNum;
|
||||
|
||||
if (AllNum > 0)
|
||||
{
|
||||
var a = (decimal)100 * ShopNum / AllNum;
|
||||
rate = Math.Round((decimal)a, 1).ToString() + "%";
|
||||
}
|
||||
|
||||
return rate;
|
||||
}
|
||||
return "0%";
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 焊口信息 维护事件
|
||||
|
||||
Reference in New Issue
Block a user