提交代码

This commit is contained in:
2023-11-27 11:00:08 +08:00
parent a543e35f45
commit 971aae10d6
6 changed files with 119 additions and 41 deletions
@@ -27,6 +27,7 @@
OnClick="btnQuery_Click"> OnClick="btnQuery_Click">
</f:Button> </f:Button>
<f:Label runat="server" Label="已检测口明细" ID="lbDef" LabelWidth="120px" LabelAlign="Right"></f:Label> <f:Label runat="server" Label="已检测口明细" ID="lbDef" LabelWidth="120px" LabelAlign="Right"></f:Label>
<f:Label runat="server" Label="尚需检测口数量" ID="lbNeedDef" LabelWidth="120px" LabelAlign="Right"></f:Label>
<f:ToolbarFill runat="server"></f:ToolbarFill> <f:ToolbarFill runat="server"></f:ToolbarFill>
</Items> </Items>
</f:Toolbar> </f:Toolbar>
@@ -23,7 +23,20 @@ namespace FineUIPro.Web.HJGL.PointTrust
where y.DetectionRateId == rateId && y.UnitWorkId == unitWorkId && y.DetectionTypeId == detectionType where y.DetectionRateId == rateId && y.UnitWorkId == unitWorkId && y.DetectionTypeId == detectionType
&& x.PointState == "1" && x.PointState == "1"
select new { x.WeldJointId, z.WeldJointCode, z.JointAttribute }); select new { x.WeldJointId, z.WeldJointCode, z.JointAttribute });
this.lbDef.Text = "预制口:" + pointJoints.Count(x => x.JointAttribute == "预制口").ToString() + "个,安装口:" + pointJoints.Count(x => x.JointAttribute == "安装口").ToString()+"个。"; int totalJointNum = (from x in db.HJGL_WeldJoint
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
where y.DetectionRateId == rateId && y.UnitWorkId == unitWorkId && y.DetectionType == detectionType
select x).Count();
int needJointNum = 0, needYZJointNum = 0, needAZJointNum = 0;
Model.Base_DetectionRate rate = BLL.Base_DetectionRateService.GetDetectionRateByDetectionRateId(rateId);
if (rate != null)
{
needJointNum = Convert.ToInt32(Math.Ceiling((totalJointNum * rate.DetectionRateValue.Value) * 0.01));
needAZJointNum = Convert.ToInt32(Math.Ceiling(needJointNum * 0.4));
needYZJointNum = needJointNum - needAZJointNum;
}
this.lbDef.Text = "预制口:" + pointJoints.Count(x => x.JointAttribute == "预制口").ToString() + "个,安装口:" + pointJoints.Count(x => x.JointAttribute == "安装口").ToString() + "个。";
this.lbNeedDef.Text = "预制口:" + (needYZJointNum - pointJoints.Count(x => x.JointAttribute == "预制口")).ToString() + "个,安装口:" + (needAZJointNum- pointJoints.Count(x => x.JointAttribute == "安装口")).ToString() + "个。";
BindGrid(); BindGrid();
} }
} }
@@ -84,6 +84,15 @@ namespace FineUIPro.Web.HJGL.PointTrust {
/// </remarks> /// </remarks>
protected global::FineUIPro.Label lbDef; protected global::FineUIPro.Label lbDef;
/// <summary>
/// lbNeedDef 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label lbNeedDef;
/// <summary> /// <summary>
/// ToolbarSeparator1 控件。 /// ToolbarSeparator1 控件。
/// </summary> /// </summary>
@@ -30,10 +30,13 @@
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left"> <f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
<Items> <Items>
<f:TextBox ID="txtPipelineCode" runat="server" Label="管线" <f:TextBox ID="txtPipelineCode" runat="server" Label="管线"
EmptyText="输入查询条件" AutoPostBack="true" OnTextChanged="Tree_TextChanged" EmptyText="输入查询条件"
Width="280px" LabelWidth="60px"> Width="230px" LabelWidth="60px">
</f:TextBox> </f:TextBox>
<f:HiddenField runat="server" ID="hdUnitWorkId"></f:HiddenField> <f:HiddenField runat="server" ID="hdUnitWorkId"></f:HiddenField>
<f:Button ID="btnTreeFind" ToolTip="查询" Icon="SystemSearch"
EnablePostBack="true" OnClick="btnTreeFind_Click" runat="server">
</f:Button>
<%--<f:Button ID="btnOut" runat="server" Text="导出" ToolTip="导出焊口情况信息" Icon="FolderUp" OnClick="btnOut_Click"> <%--<f:Button ID="btnOut" runat="server" Text="导出" ToolTip="导出焊口情况信息" Icon="FolderUp" OnClick="btnOut_Click">
</f:Button>--%> </f:Button>--%>
</Items> </Items>
@@ -57,10 +60,17 @@
EmptyText="输入查询条件" AutoPostBack="true" OnTextChanged="TextBox_TextChanged" EmptyText="输入查询条件" AutoPostBack="true" OnTextChanged="TextBox_TextChanged"
Width="240px" LabelWidth="80px" LabelAlign="Right"> Width="240px" LabelWidth="80px" LabelAlign="Right">
</f:TextBox> </f:TextBox>
<f:CheckBox ID="ckIsAudit" runat ="server" Label="未审核" AutoPostBack="true" OnCheckedChanged="ckIsAudit_CheckedChanged"></f:CheckBox> <f:RadioButtonList runat="server" ID="rbIsAudit" LabelAlign="Right" Label="审核状态" LabelWidth="80px" Width="300px" AutoPostBack="true" OnSelectedIndexChanged="rbIsAudit_SelectedIndexChanged">
<f:RadioItem Text="全部" Value="2" />
<f:RadioItem Selected="true" Text="未审核" Value="0" />
<f:RadioItem Text="已审核" Value="1" />
</f:RadioButtonList>
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="审核日期" ID="txtAuditDate"
AutoPostBack="true" OnTextChanged="txtAuditDate_TextChanged" LabelWidth="90px" LabelAlign="Right" Width="200px">
</f:DatePicker>
<f:Label ID="lbSize" CssClass="customlabel" runat="server" Label="达因"></f:Label> <f:Label ID="lbSize" CssClass="customlabel" runat="server" Label="达因"></f:Label>
<f:DropDownList runat="server" ID="DropTwoJointType" Label="二次新增类型" LabelAlign="Right" LabelWidth="140px" AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged"> <f:DropDownList runat="server" ID="DropTwoJointType" Label="二次新增类型" Width="220px" LabelAlign="Right" LabelWidth="140px" AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged">
<f:ListItem Text="新增口" Value="新增口" /> <f:ListItem Text="新增口" Value="新增口" />
<f:ListItem Text="修改口" Value="修改口" /> <f:ListItem Text="修改口" Value="修改口" />
</f:DropDownList> </f:DropDownList>
@@ -85,7 +85,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{ {
foreach (var q in unitWork1) foreach (var q in unitWork1)
{ {
int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId select x).Count(); int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) select x).Count();
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId); var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
TreeNode tn1 = new TreeNode(); TreeNode tn1 = new TreeNode();
tn1.NodeID = q.UnitWorkId; tn1.NodeID = q.UnitWorkId;
@@ -109,7 +109,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{ {
foreach (var q in unitWork2) foreach (var q in unitWork2)
{ {
int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId select x).Count(); int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) select x).Count();
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId); var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
TreeNode tn2 = new TreeNode(); TreeNode tn2 = new TreeNode();
tn2.NodeID = q.UnitWorkId; tn2.NodeID = q.UnitWorkId;
@@ -169,29 +169,22 @@ namespace FineUIPro.Web.HJGL.WeldingManage
var AuditCount = (from x in hJGL_WeldJoints where x.PipelineId == item.PipelineId && x.IsTwoJoint == true && x.AuditDate != null select x).Count(); var AuditCount = (from x in hJGL_WeldJoints where x.PipelineId == item.PipelineId && x.IsTwoJoint == true && x.AuditDate != null select x).Count();
TreeNode newNode = new TreeNode(); TreeNode newNode = new TreeNode();
if (jotCount == AuditCount) //全部审核 //if (jotCount == AuditCount) //全部审核
{
newNode.Text = "<font color='#00FF00'>" + item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】" + "</font>";
}
else if (AuditCount == 0) //全部未审核
{
newNode.Text = "<font color='#FF0000'>" + item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】" + "</font>";
}
else //部分审核
{
newNode.Text = "<font color='#B9B925'>" + item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】" + "</font>";
}
//if (jotCount > weldJotCount)
//{ //{
// newNode.Text = "<font color='#EE0000'>" + item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】" + "</font>"; // newNode.Text = "<font color='#00FF00'>" + item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】" + "</font>";
//} //}
//else //else if (AuditCount == 0) //全部未审核
//{ //{
// newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】"; // newNode.Text = "<font color='#FF0000'>" + item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】" + "</font>";
//} //}
//else //部分审核
//{
// newNode.Text = "<font color='#B9B925'>" + item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】" + "</font>";
//}
newNode.Text = item.PipelineCode + "【" + jotCount.ToString() + " " + "焊口" + "】";
newNode.ToolTip = "管线号【焊口数】"; newNode.ToolTip = "管线号【焊口数】";
newNode.NodeID = item.PipelineId; newNode.NodeID = item.PipelineId;
newNode.EnableClickEvent = true; newNode.EnableClickEvent = true;
@@ -239,7 +232,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
else else
{ {
this.hdUnitWorkId.Text = this.tvControlItem.SelectedNodeID; this.hdUnitWorkId.Text = this.tvControlItem.SelectedNodeID;
ckIsAudit.Checked = true;
NoAuditBindGrid(); NoAuditBindGrid();
} }
@@ -290,13 +282,26 @@ namespace FineUIPro.Web.HJGL.WeldingManage
strSql += " AND TwoJointType = @TwoJointType"; strSql += " AND TwoJointType = @TwoJointType";
listStr.Add(new SqlParameter("@TwoJointType", DropTwoJointType.SelectedValue)); listStr.Add(new SqlParameter("@TwoJointType", DropTwoJointType.SelectedValue));
} }
if (ckIsAudit.Checked == true) if (rbIsAudit.SelectedValue != "2")
{
if (rbIsAudit.SelectedValue == "0")
{ {
strSql += " and AuditDate is null"; strSql += " and AuditDate is null";
} }
else
{
strSql += " and AuditDate is not null";
}
}
if (!string.IsNullOrEmpty(this.txtAuditDate.Text.Trim()))
{
strSql += " AND CONVERT(VARCHAR(20),AuditDate,23) =@AuditDate";
listStr.Add(new SqlParameter("@AuditDate", this.txtAuditDate.Text.Trim()));
}
SqlParameter[] parameter = listStr.ToArray(); SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
var SizeSum = tb.AsEnumerable().Select(x => x.Field<decimal>("Size")).Sum(); decimal? d = 0;
var SizeSum = tb.AsEnumerable().Select(x => x.Field<decimal?>("Size") ?? d).Sum();
lbSize.Text = SizeSum.ToString(); lbSize.Text = SizeSum.ToString();
// 2.获取当前分页数据 // 2.获取当前分页数据
Grid1.RecordCount = tb.Rows.Count; Grid1.RecordCount = tb.Rows.Count;
@@ -333,10 +338,22 @@ namespace FineUIPro.Web.HJGL.WeldingManage
strSql += " AND TwoJointType = @TwoJointType"; strSql += " AND TwoJointType = @TwoJointType";
listStr.Add(new SqlParameter("@TwoJointType", DropTwoJointType.SelectedValue)); listStr.Add(new SqlParameter("@TwoJointType", DropTwoJointType.SelectedValue));
} }
if (ckIsAudit.Checked == true) if (rbIsAudit.SelectedValue != "2")
{
if (rbIsAudit.SelectedValue == "0")
{ {
strSql += " and AuditDate is null"; strSql += " and AuditDate is null";
} }
else
{
strSql += " and AuditDate is not null";
}
}
if (!string.IsNullOrEmpty(this.txtAuditDate.Text.Trim()))
{
strSql += " AND CONVERT(VARCHAR(20),AuditDate,23) =@AuditDate";
listStr.Add(new SqlParameter("@AuditDate", this.txtAuditDate.Text.Trim()));
}
SqlParameter[] parameter = listStr.ToArray(); SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
var SizeSum = tb.AsEnumerable().Select(x => x.Field<decimal>("Size")).Sum(); var SizeSum = tb.AsEnumerable().Select(x => x.Field<decimal>("Size")).Sum();
@@ -805,12 +822,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
this.BindGrid(); this.BindGrid();
} }
/// <summary> protected void btnTreeFind_Click(object sender, EventArgs e)
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Tree_TextChanged(object sender, EventArgs e)
{ {
this.InitTreeMenu(); this.InitTreeMenu();
this.BindGrid(); this.BindGrid();
@@ -1127,7 +1139,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
} }
#endregion #endregion
protected void ckIsAudit_CheckedChanged(object sender, CheckedEventArgs e) protected void rbIsAudit_SelectedIndexChanged(object sender, EventArgs e)
{ {
Model.HJGL_Pipeline pipeline = BLL.PipelineService.GetPipelineByPipelineId(this.tvControlItem.SelectedNodeID); Model.HJGL_Pipeline pipeline = BLL.PipelineService.GetPipelineByPipelineId(this.tvControlItem.SelectedNodeID);
this.hdUnitWorkId.Text = string.Empty; this.hdUnitWorkId.Text = string.Empty;
@@ -1141,7 +1153,22 @@ namespace FineUIPro.Web.HJGL.WeldingManage
this.hdUnitWorkId.Text = this.tvControlItem.SelectedNodeID; this.hdUnitWorkId.Text = this.tvControlItem.SelectedNodeID;
NoAuditBindGrid(); NoAuditBindGrid();
} }
}
protected void txtAuditDate_TextChanged(object sender, EventArgs e)
{
Model.HJGL_Pipeline pipeline = BLL.PipelineService.GetPipelineByPipelineId(this.tvControlItem.SelectedNodeID);
this.hdUnitWorkId.Text = string.Empty;
if (pipeline != null)
{
this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID;
this.BindGrid();
}
else
{
this.hdUnitWorkId.Text = this.tvControlItem.SelectedNodeID;
NoAuditBindGrid();
}
} }
} }
} }
@@ -75,6 +75,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage {
/// </remarks> /// </remarks>
protected global::FineUIPro.HiddenField hdUnitWorkId; protected global::FineUIPro.HiddenField hdUnitWorkId;
/// <summary>
/// btnTreeFind 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnTreeFind;
/// <summary> /// <summary>
/// tvControlItem 控件。 /// tvControlItem 控件。
/// </summary> /// </summary>
@@ -112,13 +121,22 @@ namespace FineUIPro.Web.HJGL.WeldingManage {
protected global::FineUIPro.TextBox txtWeldJointCode; protected global::FineUIPro.TextBox txtWeldJointCode;
/// <summary> /// <summary>
/// ckIsAudit 控件。 /// rbIsAudit 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUIPro.CheckBox ckIsAudit; protected global::FineUIPro.RadioButtonList rbIsAudit;
/// <summary>
/// txtAuditDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtAuditDate;
/// <summary> /// <summary>
/// lbSize 控件。 /// lbSize 控件。