提交代码

This commit is contained in:
2023-11-22 16:06:58 +08:00
parent 55b52e460a
commit 60d29ffb4e
8 changed files with 210 additions and 126 deletions
@@ -17,7 +17,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
public partial class WeldJointList : PageBase
{
public int pageSize = PipelineService.pageSize;
public static List<Model.HJGL_WeldJoint> WeldJointlist = new List<Model.HJGL_WeldJoint>();
public static List<Model.HJGL_WeldJoint> WeldJointlist = new List<Model.HJGL_WeldJoint>();
/// <summary>
/// 预制口总达因
/// </summary>
@@ -40,7 +40,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
if (!IsPostBack)
{
// WeldJointlist = WeldJointService.GetWeldJointByProjectid(this.CurrUser.LoginProjectId);
// WeldJointlist = WeldJointService.GetWeldJointByProjectid(this.CurrUser.LoginProjectId);
this.InitTreeMenu();//加载树
//显示列
//Model.Sys_UserShowColumns c = BLL.UserShowColumnsService.GetColumnsByUserId(this.CurrUser.PersonId, "Joint");
@@ -111,8 +111,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
//}
//else
//{
unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList();
unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList();
unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList();
unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList();
//}
if (unitWork1.Count() > 0)
@@ -143,8 +143,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
foreach (var q in unitWork2)
{
int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId
&& x.PipelineCode.Contains(this.tvPipeCode.Text.Trim())
int a = (from x in Funs.DB.HJGL_Pipeline
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId
&& x.PipelineCode.Contains(this.tvPipeCode.Text.Trim())
select x).Count();
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
TreeNode tn2 = new TreeNode();
@@ -157,7 +158,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
tn2.ToolTip = "施工单位:" + unitNamesUnitIds;
tn2.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize);
tn2.EnableExpandEvent = true;
tn2.EnableClickEvent= true;
tn2.EnableClickEvent = true;
rootNode2.Nodes.Add(tn2);
if (a > 0)
{
@@ -175,7 +176,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
#region
private void BindNodes(TreeNode node)
{
BLL.PipelineService.BindTreeNodes(node, this.tvPipeCode.Text.Trim(), this.CurrUser.LoginProjectId,pageSize);
BLL.PipelineService.BindTreeNodes(node, this.tvPipeCode.Text.Trim(), this.CurrUser.LoginProjectId, pageSize);
}
#endregion
@@ -188,7 +189,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
//e.Node.Nodes.Clear();
//if (e.Node.CommandName == "单位工程")
//{
// var pipeline = (from x in Funs.DB.HJGL_Pipeline
@@ -196,7 +197,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
// orderby x.PipelineCode
// select x).ToList();
// var hJGL_WeldJoints = (from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList();
// // var WeldJointlist = (from x in Funs.DB.View_HJGL_WeldJoint where x.UnitWorkId == e.Node.NodeID && x.IsTwoJoint == null select x).ToList();
// foreach (var item in pipeline)
@@ -210,7 +211,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
// e.Node.Nodes.Add(newNode);
// }
//}
}
@@ -266,7 +267,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
this.lbFiledSum.Text = FieldSum;
}
}
}
#endregion
@@ -411,29 +412,29 @@ namespace FineUIPro.Web.HJGL.WeldingManage
#endregion
#region
private string GetRateByUnitWork(string unitworkid)
private string GetRateByUnitWork(string unitworkid)
{
var db = Funs.DB;
var q=from x in db.View_HJGL_WeldJoint where x.UnitWorkId == unitworkid select x ;
var q = from x in db.View_HJGL_WeldJoint where x.UnitWorkId == unitworkid select x;
string rate = "";
ShopSumSize = "0";
FieldSumSize = "0";
if (q!=null&&q.Count()>0)
if (q != null && q.Count() > 0)
{
var proSum = (from x in q
where x.JointAttribute == "预制口"
where x.JointAttribute == "预制口"
group x by x.UnitWorkId into g
select new
{
SizeSum = g.Sum(x => x.Size)
}).FirstOrDefault()?.SizeSum;
var FieldSum = (from x in q
where x.JointAttribute == "安装口"
group x by x.UnitWorkId into g
select new
{
SizeSum = g.Sum(x => x.Size)
}).FirstOrDefault()?.SizeSum;
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 q
group x by x.UnitWorkId into g
select new
@@ -442,14 +443,14 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}).FirstOrDefault()?.SizeSum;
proSum = (proSum != null) ? proSum : 0;
FieldSum = (FieldSum != null) ? FieldSum : 0;
ShopSumSize = proSum.ToString() ;
FieldSumSize = FieldSum.ToString() ;
if (AllSum>0)
ShopSumSize = proSum.ToString();
FieldSumSize = FieldSum.ToString();
if (AllSum > 0)
{
var a = (decimal)100 * proSum / AllSum;
rate = Math.Round((decimal)a, 1).ToString()+"%";
rate = Math.Round((decimal)a, 1).ToString() + "%";
}
return rate;
}
return "0%";
@@ -496,28 +497,28 @@ namespace FineUIPro.Web.HJGL.WeldingManage
var q = from x in db.View_HJGL_WeldJoint where x.PipelineId == pipelineid select x;
if (q != null && q.Count() > 0)
{
var proSumModel= (from x in q
where x.JointAttribute == "预制口"
group x by x.PipelineId into g
select new
{
SizeSum = g.Sum(x => x.Size)
}).FirstOrDefault();
var proSum= (proSumModel !=null) ? proSumModel.SizeSum : 0;
var proSumModel = (from x in q
where x.JointAttribute == "预制口"
group x by x.PipelineId into g
select new
{
SizeSum = g.Sum(x => x.Size)
}).FirstOrDefault();
var proSum = (proSumModel != null) ? proSumModel.SizeSum : 0;
var FieldSumModel = (from x in q
where x.JointAttribute == "安装口"
group x by x.PipelineId into g
select new
{
SizeSum = g.Sum(x => x.Size)
}).FirstOrDefault();
var FieldSum= (FieldSumModel != null) ? FieldSumModel.SizeSum : 0;
where x.JointAttribute == "安装口"
group x by x.PipelineId into g
select new
{
SizeSum = g.Sum(x => x.Size)
}).FirstOrDefault();
var FieldSum = (FieldSumModel != null) ? FieldSumModel.SizeSum : 0;
var AllSumModel = (from x in q
group x by x.PipelineId into g
select new
{
SizeSum = g.Sum(x => x.Size)
}).FirstOrDefault();
group x by x.PipelineId into g
select new
{
SizeSum = g.Sum(x => x.Size)
}).FirstOrDefault();
var AllSum = (AllSumModel != null) ? AllSumModel.SizeSum : 0;
proSum = (proSum != null) ? proSum : 0;
@@ -529,7 +530,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
var a = (decimal)100 * proSum / AllSum;
rate = Math.Round((decimal)a, 1).ToString() + "%";
}
return rate;
}
return "0%";
@@ -549,13 +550,14 @@ namespace FineUIPro.Web.HJGL.WeldingManage
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();
shopNum = (from x in q
where x.JointAttribute == "预制口"
select x
).Count();
fieldNum = (from x in q
where x.JointAttribute == "安装口"
select x
).Count();
ShopSum = shopNum.ToString();
FieldSum = fieldNum.ToString();
AllNum = shopNum + fieldNum;
@@ -765,6 +767,38 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
}
protected void btnMenuPipeLineAllDelete_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.HJGL_WeldJointMenuId, Const.BtnDelete))
{
if (this.tvControlItem.SelectedNode.CommandName != "管线")
{
Alert.ShowInTop("请选择一条管线!", MessageBoxIcon.Warning);
return;
}
string pipelineId = this.tvControlItem.SelectedNodeID;
var weldJoints = from x in Funs.DB.HJGL_WeldJoint
where x.PipelineId == pipelineId && x.WeldingDailyId != null
select x;
if (weldJoints.Count() > 0)
{
Alert.ShowInTop("存在已焊接的焊口,无法删除管线!", MessageBoxIcon.Warning);
return;
}
BLL.WeldJointService.DeleteWeldJointByPipelineId(pipelineId);
BLL.PipelineService.DeletePipeline(pipelineId);
//BLL.Sys_LogService.AddLog(BLL.Const.System_6, this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.HJGL_PipelineMenuId, Const.BtnDelete, rowID);
ShowNotify("删除成功!", MessageBoxIcon.Success);
this.InitTreeMenu();
}
else
{
ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
}
}
protected void btnDelMat_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.HJGL_WeldJointMenuId, Const.BtnDelete))