提交代码

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

View File

@ -27,6 +27,7 @@
OnClick="btnQuery_Click">
</f:Button>
<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>
</Items>
</f:Toolbar>

View File

@ -23,7 +23,20 @@ namespace FineUIPro.Web.HJGL.PointTrust
where y.DetectionRateId == rateId && y.UnitWorkId == unitWorkId && y.DetectionTypeId == detectionType
&& x.PointState == "1"
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();
}
}

View File

@ -84,6 +84,15 @@ namespace FineUIPro.Web.HJGL.PointTrust {
/// </remarks>
protected global::FineUIPro.Label lbDef;
/// <summary>
/// lbNeedDef 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label lbNeedDef;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>

View File

@ -30,10 +30,13 @@
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:TextBox ID="txtPipelineCode" runat="server" Label="管线"
EmptyText="输入查询条件" AutoPostBack="true" OnTextChanged="Tree_TextChanged"
Width="280px" LabelWidth="60px">
EmptyText="输入查询条件"
Width="230px" LabelWidth="60px">
</f:TextBox>
<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>--%>
</Items>
@ -57,10 +60,17 @@
EmptyText="输入查询条件" AutoPostBack="true" OnTextChanged="TextBox_TextChanged"
Width="240px" LabelWidth="80px" LabelAlign="Right">
</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: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:DropDownList>

View File

@ -85,7 +85,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
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);
TreeNode tn1 = new TreeNode();
tn1.NodeID = q.UnitWorkId;
@ -109,7 +109,7 @@ 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 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);
TreeNode tn2 = new TreeNode();
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();
TreeNode newNode = new TreeNode();
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)
//if (jotCount == AuditCount) //全部审核
//{
// 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.NodeID = item.PipelineId;
newNode.EnableClickEvent = true;
@ -239,7 +232,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
else
{
this.hdUnitWorkId.Text = this.tvControlItem.SelectedNodeID;
ckIsAudit.Checked = true;
NoAuditBindGrid();
}
@ -290,13 +282,26 @@ namespace FineUIPro.Web.HJGL.WeldingManage
strSql += " AND TwoJointType = @TwoJointType";
listStr.Add(new SqlParameter("@TwoJointType", DropTwoJointType.SelectedValue));
}
if (ckIsAudit.Checked == true)
if (rbIsAudit.SelectedValue != "2")
{
strSql += " and AuditDate is null";
if (rbIsAudit.SelectedValue == "0")
{
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();
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();
// 2.获取当前分页数据
Grid1.RecordCount = tb.Rows.Count;
@ -333,9 +338,21 @@ namespace FineUIPro.Web.HJGL.WeldingManage
strSql += " AND TwoJointType = @TwoJointType";
listStr.Add(new SqlParameter("@TwoJointType", DropTwoJointType.SelectedValue));
}
if (ckIsAudit.Checked == true)
if (rbIsAudit.SelectedValue != "2")
{
strSql += " and AuditDate is null";
if (rbIsAudit.SelectedValue == "0")
{
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();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
@ -805,12 +822,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
this.BindGrid();
}
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Tree_TextChanged(object sender, EventArgs e)
protected void btnTreeFind_Click(object sender, EventArgs e)
{
this.InitTreeMenu();
this.BindGrid();
@ -1127,7 +1139,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
#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);
this.hdUnitWorkId.Text = string.Empty;
@ -1141,7 +1153,22 @@ namespace FineUIPro.Web.HJGL.WeldingManage
this.hdUnitWorkId.Text = this.tvControlItem.SelectedNodeID;
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();
}
}
}
}

View File

@ -75,6 +75,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage {
/// </remarks>
protected global::FineUIPro.HiddenField hdUnitWorkId;
/// <summary>
/// btnTreeFind 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnTreeFind;
/// <summary>
/// tvControlItem 控件。
/// </summary>
@ -112,13 +121,22 @@ namespace FineUIPro.Web.HJGL.WeldingManage {
protected global::FineUIPro.TextBox txtWeldJointCode;
/// <summary>
/// ckIsAudit 控件。
/// rbIsAudit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.CheckBox ckIsAudit;
protected global::FineUIPro.RadioButtonList rbIsAudit;
/// <summary>
/// txtAuditDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtAuditDate;
/// <summary>
/// lbSize 控件。