This commit is contained in:
佘春生 2024-05-23 09:35:43 +08:00
parent df39b88c09
commit 6c7c257fd2
8 changed files with 255 additions and 32 deletions

Binary file not shown.

View File

@ -3,7 +3,7 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>委托单打印</title>
<title>点口待审核</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
@ -22,20 +22,21 @@
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:DropDownList ID="drpNoAudit" runat="server" Label="未审核" LabelAlign="Right" Width="170" LabelWidth="80px">
<f:DropDownList ID="drpNoAudit" runat="server" Label="未审核" LabelAlign="Right" Width="160" LabelWidth="70px">
<f:ListItem Text="-请选择-" Value="0" />
<f:ListItem Text="监理" Value="1" />
<f:ListItem Text="管理公司" Value="2" />
<f:ListItem Text="其它" Value="3" />
</f:DropDownList>
<f:TextBox ID="txtPipeCode" runat="server" Label="管线" LabelAlign="Right" Width="180" LabelWidth="65px"></f:TextBox>
<f:DropDownList ID="drpNde" runat="server" Label="检测方法"
LabelAlign="Right" EnableEdit="true" Width="180" LabelWidth="90px">
LabelAlign="Right" EnableEdit="true" Width="170" LabelWidth="90px">
</f:DropDownList>
<f:DatePicker runat="server" ID="txtPointStartDate" LabelAlign="Right" LabelWidth="90px"
Label="点口日期" Width="200px">
Label="点口日期" Width="195px">
</f:DatePicker>
<f:DatePicker runat="server" ID="txtPointEndDate" LabelAlign="Right" LabelWidth="40px"
Label="至" Width="150px">
<f:DatePicker runat="server" ID="txtPointEndDate" LabelAlign="Right" LabelWidth="30px"
Label="至" Width="135px">
</f:DatePicker>
<f:Button ID="BtnAnalyse" Icon="Find"
runat="server" OnClick="BtnAnalyse_Click">
@ -51,6 +52,9 @@
<f:Button ID="btnOtherAudit" Text="其它审核" Icon="ChartPie"
runat="server" OnClick="btnOtherAudit_Click">
</f:Button>
<f:Button ID="btnHandGenerate" Text="生成委托单" ToolTip="勾选需要生成委托单的焊口手动生成委托单" Icon="TableEdit" runat="server"
OnClick="btnHandGenerate_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>

View File

@ -30,8 +30,13 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
(CASE WHEN IsWelderFirst=1 THEN '是' ELSE '否' END) AS IsWelderFirst,
JLAudit,GLGSAudit,QTAudit,IsPointAudit
FROM dbo.View_Batch_PointBatchItem
WHERE PointState IS NOT NULL";
WHERE PointState IS NOT NULL AND TrustBatchItemId IS NULL";
List<SqlParameter> listStr = new List<SqlParameter>();
if (!string.IsNullOrEmpty(this.txtPipeCode.Text))
{
strSql += " AND PipelineCode LIKE @PipelineCode";
listStr.Add(new SqlParameter("@PipelineCode", "%" + this.txtPipeCode.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(this.txtPointStartDate.Text))
{
strSql += " AND PointDate >= @PointStartDate";
@ -200,5 +205,148 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
return;
}
}
/// <summary>
/// 手动生成委托单
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnHandGenerate_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_PointManageMenuId, Const.BtnHandGenerate))
{
List<string> selectRow = new List<string>();
foreach (string pitem in Grid1.SelectedRowIDArray)
{
selectRow.Add(pitem);
}
if (selectRow.Count() > 0)
{
List<string> weldMot = new List<string>();
List<string> grooveType = new List<string>();
List<bool> IsFist = new List<bool>();
List<string> pointBatchIds = new List<string>();
string error = string.Empty;
foreach (string pointItemId in selectRow)
{
var pointItem = BLL.Batch_PointBatchItemService.GetPointBatchItemByPointBatchItemId(pointItemId);
var jot = BLL.Pipeline_WeldJointService.GetWeldJointByWeldJointId(pointItem.WeldJointId);
weldMot.Add(jot.WeldingMethodId);
grooveType.Add(jot.GrooveTypeId);
IsFist.Add(pointItem.IsWelderFirst == true ? true : false);
pointBatchIds.Add(pointItem.PointBatchId);
}
if (pointBatchIds.Distinct().Count() > 1)
{
error = "勾选的焊口不在一个批次中,";
}
if (weldMot.Distinct().Count() > 1)
{
error = "勾选的焊口焊接方法不一至,";
}
if (grooveType.Distinct().Count() > 1)
{
error = error + "勾选的焊口坡口类型不一至,";
}
if (IsFist.Distinct().Count() > 1)
{
error = error + "勾选的焊口是否首三不一至,";
}
if (error == string.Empty)
{
var point = BLL.Batch_PointBatchService.GetPointBatchById(pointBatchIds[0]);
var iso = BLL.Pipeline_PipelineService.GetPipelineByPipelineId(point.PipelineId);
var project = BLL.Base_ProjectService.GetProjectByProjectId(point.ProjectId);
var unit = BLL.Base_UnitService.GetUnit(point.UnitId);
var ndt = BLL.Base_DetectionTypeService.GetDetectionTypeByDetectionTypeId(point.DetectionTypeId);
var work = BLL.Project_WorkAreaService.GetProject_WorkAreaByWorkAreaId(iso.WorkAreaId);
Model.Batch_BatchTrust newBatchTrust = new Model.Batch_BatchTrust();
string perfix = string.Empty;
//perfix = unit.UnitCode + "-" + ins.InstallationCode + "-GD-" + ndt.DetectionTypeCode + "-";
perfix = ndt.DetectionTypeCode + "-" + unit.UnitCode + "-" + work.WorkAreaCode + "-PI" + "-";
newBatchTrust.TrustBatchCode = BLL.SQLHelper.RunProcNewId("SpGetNewCode", "dbo.Batch_BatchTrust", "TrustBatchCode", project.ProjectId, perfix);
string trustBatchId = SQLHelper.GetNewID(typeof(Model.Batch_BatchTrust));
newBatchTrust.TrustBatchId = trustBatchId;
newBatchTrust.TrustDate = DateTime.Now;
newBatchTrust.ProjectId = point.ProjectId;
newBatchTrust.UnitId = point.UnitId;
newBatchTrust.InstallationId = point.InstallationId;
newBatchTrust.WorkAreaId = iso.WorkAreaId;
newBatchTrust.WeldingMethodId = weldMot[0];
newBatchTrust.GrooveTypeId = grooveType[0];
newBatchTrust.IsWelderFirst = IsFist[0];
newBatchTrust.DetectionTypeId = point.DetectionTypeId;
newBatchTrust.PipelineId = point.PipelineId;
BLL.Batch_BatchTrustService.AddBatchTrust(newBatchTrust); // 新增委托单
// 生成委托明细,并回写点口明细信息
string toPointBatch = string.Empty;
foreach (string pointItemId in selectRow)
{
var pointItem = BLL.Batch_PointBatchItemService.GetPointBatchItemByPointBatchItemId(pointItemId);
if (BLL.Batch_PointBatchService.GetIsGenerateTrust(pointItem.PointBatchItemId)) ////生成委托单的条件判断
{
if (!toPointBatch.Contains(pointItem.PointBatchId))
{
toPointBatch = toPointBatch + pointItem.PointBatchId + ",";
}
Model.Batch_BatchTrustItem trustItem = new Model.Batch_BatchTrustItem
{
TrustBatchItemId = SQLHelper.GetNewID(typeof(Model.Batch_BatchTrustItem)),
TrustBatchId = trustBatchId,
PointBatchItemId = pointItem.PointBatchItemId,
WeldJointId = pointItem.WeldJointId,
//FilmNum = fileNum,
CreateDate = DateTime.Now
};
Batch_BatchTrustItemService.AddBatchTrustItem(trustItem);
}
//Model.Batch_PointBatchItem pointBatchItem = Funs.DB.Batch_PointBatchItem.FirstOrDefault(e => e.PointBatchItemId == item.PointBatchItemId);
pointItem.IsBuildTrust = true;
Funs.DB.SubmitChanges();
}
// 回写委托批对应点口信息
if (!string.IsNullOrEmpty(toPointBatch))
{
toPointBatch = toPointBatch.Substring(0, toPointBatch.Length - 1);
var updateTrut = BLL.Batch_BatchTrustService.GetBatchTrustById(trustBatchId);
if (updateTrut != null)
{
updateTrut.TopointBatch = toPointBatch;
BLL.Batch_BatchTrustService.UpdateBatchTrust(updateTrut);
}
}
Alert.ShowInTop("委托单已生成!", MessageBoxIcon.Success);
}
else
{
Alert.ShowInTop(error + "不能组成一个委托单!", MessageBoxIcon.Warning);
}
}
else
{
Alert.ShowInTop("请勾选要生成委托单的焊口!", MessageBoxIcon.Warning);
}
}
else
{
ShowNotify(Resources.Lan.NoPrivilegePrompt, MessageBoxIcon.Warning);
return;
}
}
}
}

View File

@ -7,10 +7,12 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.WeldingProcess.TrustManage {
namespace FineUIPro.Web.WeldingProcess.TrustManage
{
public partial class PointForAudit {
public partial class PointForAudit
{
/// <summary>
/// form1 控件。
@ -66,6 +68,15 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage {
/// </remarks>
protected global::FineUIPro.DropDownList drpNoAudit;
/// <summary>
/// txtPipeCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPipeCode;
/// <summary>
/// drpNde 控件。
/// </summary>
@ -138,6 +149,15 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage {
/// </remarks>
protected global::FineUIPro.Button btnOtherAudit;
/// <summary>
/// btnHandGenerate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnHandGenerate;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>

View File

@ -69,11 +69,11 @@
</f:DropDownList>
<f:NumberBox ID="txtDia" Label="<%$ Resources:Lan,ExternalDiameter %>" runat="server"
LabelWidth="130px" DecimalPrecision="4" NoNegative="true" ShowRedStar="true"
Required="true" Readonly="true">
AutoPostBack="true" OnTextChanged="txtText_TextChanged" Required="true" Readonly="true">
</f:NumberBox>
<f:NumberBox ID="txtThickness" Label="<%$ Resources:Lan,WallThickness %>" runat="server"
LabelWidth="130px" DecimalPrecision="4" NoNegative="true" ShowRedStar="true"
Required="true" Readonly="true">
AutoPostBack="true" OnTextChanged="txtText_TextChanged" Required="true" Readonly="true">
</f:NumberBox>

View File

@ -324,6 +324,9 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
{
if (ansi != "FB")
{
txtDia.Readonly = true;
txtThickness.Readonly = true;
if (dn.First().OutSizeDia != null)
{
dia = dn.First().OutSizeDia.ToString();
@ -459,6 +462,9 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
// 非美标FB
else
{
txtDia.Readonly = false;
txtThickness.Readonly = false;
if (dn.First().OutSize_FB != null)
{
dia = dn.First().OutSize_FB.ToString();
@ -482,7 +488,25 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
this.txtSpecification.Text = "Φ" + dia + "×" + sch;
}
}
}
}
/// <summary>
/// 选择外径和壁厚自动获取规格
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtText_TextChanged(object sender, EventArgs e)
{
string dn = string.Empty;
string s = string.Empty;
if (!string.IsNullOrEmpty(this.txtDia.Text.Trim()))
{
dn = this.txtDia.Text.Trim();
if (!string.IsNullOrEmpty(this.txtThickness.Text.Trim()))
{
this.txtSpecification.Text = "Φ" + dn + "×" + this.txtThickness.Text.Trim();
}
}
}

View File

@ -63,10 +63,10 @@
<f:DropDownList ID="drpANSISCH" Label="美标壁厚" AutoPostBack="true" OnSelectedIndexChanged="drpANSISCH_OnSelectedIndexChanged"
runat="server" ShowRedStar="true" Required="true" EnableEdit="true" LabelWidth="130px">
</f:DropDownList>
<f:NumberBox ID="txtDia" Label="<%$ Resources:Lan,ExternalDiameter %>" runat="server"
<f:NumberBox ID="txtDia" Label="<%$ Resources:Lan,ExternalDiameter %>" runat="server" AutoPostBack="true" OnTextChanged="txtText_TextChanged"
LabelWidth="130px" DecimalPrecision="4" NoNegative="true" ShowRedStar="true" Required="true" Readonly="true">
</f:NumberBox>
<f:NumberBox ID="txtThickness" Label="<%$ Resources:Lan,WallThickness %>" runat="server"
<f:NumberBox ID="txtThickness" Label="<%$ Resources:Lan,WallThickness %>" runat="server" AutoPostBack="true" OnTextChanged="txtText_TextChanged"
LabelWidth="130px" DecimalPrecision="4" NoNegative="true" ShowRedStar="true" Required="true"
Readonly="true">
</f:NumberBox>

View File

@ -633,12 +633,16 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
string ansi = drpANSISCH.SelectedValue;
string dia = string.Empty;
string sch = string.Empty;
var dn = from x in Funs.DB.Base_DNCompare where x.PipeSize == Funs.GetNewDecimal(txtSize.Text.Trim()) select x;
if (dn.Count() > 0)
{
if (ansi != "FB")
{
txtDia.Readonly = true;
txtThickness.Readonly = true;
if (dn.First().OutSizeDia != null)
{
dia = dn.First().OutSizeDia.ToString();
@ -774,6 +778,9 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
else // 非美标FB
{
txtDia.Readonly = false;
txtThickness.Readonly = false;
if (dn.First().OutSize_FB != null)
{
dia = dn.First().OutSize_FB.ToString();
@ -799,6 +806,26 @@ namespace FineUIPro.Web.WeldingProcess.WeldingManage
}
}
}
/// <summary>
/// 选择外径和壁厚自动获取规格
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtText_TextChanged(object sender, EventArgs e)
{
string dn = string.Empty;
string s = string.Empty;
if (!string.IsNullOrEmpty(this.txtDia.Text.Trim()))
{
dn = this.txtDia.Text.Trim();
if (!string.IsNullOrEmpty(this.txtThickness.Text.Trim()))
{
this.txtSpecification.Text = "Φ" + dn + "×" + this.txtThickness.Text.Trim();
}
}
}
#endregion
}
}