焊接修改
This commit is contained in:
@@ -35,6 +35,13 @@
|
||||
AutoPostBack="true" Label="<%$ Resources:Lan,TestNumber %>" LabelWidth="100px"
|
||||
OnTextChanged="Tree_TextChanged" Width="265px" LabelAlign="Right">
|
||||
</f:TextBox>
|
||||
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
<f:Toolbar ID="Toolbar3" Position="Top" runat="server" ToolbarAlign="Right">
|
||||
<Items>
|
||||
<f:CheckBox ID="ckUnqualified" ShowLabel="false" runat="server" Text="<%$ Resources:Lan,Unqualified %>" Checked="false">
|
||||
</f:CheckBox>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
|
||||
@@ -203,7 +203,7 @@ namespace FineUIPro.Web.CheckManage
|
||||
|
||||
//单号
|
||||
string ndtTypeId = e.Node.NodeID.Split('|')[0];
|
||||
var checks = from x in Funs.DB.View_Batch_NDE
|
||||
var checks = (from x in Funs.DB.View_Batch_NDE
|
||||
where x.NDEDate < Convert.ToDateTime(this.txtNDEDateMonth.Text.Trim() + "-01").AddMonths(1)
|
||||
&& x.NDEDate >= Convert.ToDateTime(this.txtNDEDateMonth.Text.Trim() + "-01").AddMonths(-1)
|
||||
&& x.ProjectId == this.CurrUser.LoginProjectId && x.NDECode.Contains(this.txtSearchCode.Text.Trim())
|
||||
@@ -211,7 +211,12 @@ namespace FineUIPro.Web.CheckManage
|
||||
&& x.UnitId == e.Node.ParentNode.ParentNode.NodeID
|
||||
&& x.DetectionTypeId == ndtTypeId
|
||||
orderby x.NDECode descending
|
||||
select x;
|
||||
select x).ToList();
|
||||
if (ckUnqualified.Checked)
|
||||
{
|
||||
var q = (from x in Funs.DB.View_NoReportNdt select x.NDEID).ToList().Distinct();
|
||||
checks = checks.Where(x => q.Contains(x.NDEID)).ToList();
|
||||
}
|
||||
foreach (var check in checks)
|
||||
{
|
||||
TreeNode newNode = new TreeNode();
|
||||
|
||||
+61
-41
@@ -7,11 +7,13 @@
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.CheckManage {
|
||||
|
||||
|
||||
public partial class CheckManage {
|
||||
|
||||
namespace FineUIPro.Web.CheckManage
|
||||
{
|
||||
|
||||
|
||||
public partial class CheckManage
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
@@ -20,7 +22,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
@@ -29,7 +31,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
@@ -38,7 +40,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// panelLeftRegion 控件。
|
||||
/// </summary>
|
||||
@@ -47,7 +49,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelLeftRegion;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
@@ -56,7 +58,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtNDEDateMonth 控件。
|
||||
/// </summary>
|
||||
@@ -65,7 +67,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtNDEDateMonth;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar5 控件。
|
||||
/// </summary>
|
||||
@@ -74,7 +76,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar5;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtSearchCode 控件。
|
||||
/// </summary>
|
||||
@@ -83,7 +85,25 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtSearchCode;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar3;
|
||||
|
||||
/// <summary>
|
||||
/// ckUnqualified 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.CheckBox ckUnqualified;
|
||||
|
||||
/// <summary>
|
||||
/// tvControlItem 控件。
|
||||
/// </summary>
|
||||
@@ -92,7 +112,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Tree tvControlItem;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// panelCenterRegion 控件。
|
||||
/// </summary>
|
||||
@@ -101,7 +121,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelCenterRegion;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
@@ -110,7 +130,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// hdNDEID 控件。
|
||||
/// </summary>
|
||||
@@ -119,7 +139,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hdNDEID;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
@@ -128,7 +148,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnNew 控件。
|
||||
/// </summary>
|
||||
@@ -137,7 +157,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNew;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnImport 控件。
|
||||
/// </summary>
|
||||
@@ -146,7 +166,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnImport;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnEdit 控件。
|
||||
/// </summary>
|
||||
@@ -155,7 +175,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnEdit;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnAudit 控件。
|
||||
/// </summary>
|
||||
@@ -164,7 +184,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnAudit;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnDelete 控件。
|
||||
/// </summary>
|
||||
@@ -173,7 +193,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnDelete;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// BtnRepairRecord 控件。
|
||||
/// </summary>
|
||||
@@ -182,7 +202,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button BtnRepairRecord;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
@@ -191,7 +211,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtNDECode 控件。
|
||||
/// </summary>
|
||||
@@ -200,7 +220,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label txtNDECode;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtUnitName 控件。
|
||||
/// </summary>
|
||||
@@ -209,7 +229,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label txtUnitName;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtInstallation 控件。
|
||||
/// </summary>
|
||||
@@ -218,7 +238,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label txtInstallation;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtNDEDate 控件。
|
||||
/// </summary>
|
||||
@@ -227,7 +247,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label txtNDEDate;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtCheckUnit 控件。
|
||||
/// </summary>
|
||||
@@ -236,7 +256,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label txtCheckUnit;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtDetectionTypeCode 控件。
|
||||
/// </summary>
|
||||
@@ -245,7 +265,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label txtDetectionTypeCode;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtTrustBatchCode 控件。
|
||||
/// </summary>
|
||||
@@ -254,7 +274,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label txtTrustBatchCode;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Label1 控件。
|
||||
/// </summary>
|
||||
@@ -263,7 +283,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label Label1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Label2 控件。
|
||||
/// </summary>
|
||||
@@ -272,7 +292,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label Label2;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
@@ -281,7 +301,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// lbCheckDefects 控件。
|
||||
/// </summary>
|
||||
@@ -290,7 +310,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lbCheckDefects;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator1 控件。
|
||||
/// </summary>
|
||||
@@ -299,7 +319,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarText1 控件。
|
||||
/// </summary>
|
||||
@@ -308,7 +328,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarText ToolbarText1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ddlPageSize 控件。
|
||||
/// </summary>
|
||||
@@ -317,7 +337,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlPageSize;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
@@ -326,7 +346,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Window2 控件。
|
||||
/// </summary>
|
||||
@@ -335,7 +355,7 @@ namespace FineUIPro.Web.CheckManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window2;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// WindowRepair 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -245,6 +245,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
|
||||
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@DetectionTypeId", repairRecord.DetectionTypeId));
|
||||
#region 旧逻辑
|
||||
// 如果是第二次返修不加载扩透口
|
||||
if (!code4.Contains("EX1") && code2 == "R2")
|
||||
{
|
||||
@@ -275,6 +276,24 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region 新逻辑
|
||||
//var rate = from x in Funs.DB.Pipeline_WeldJoint
|
||||
// join y in Funs.DB.Pipeline_Pipeline on x.PipelineId equals y.PipelineId
|
||||
// join z in Funs.DB.Base_DetectionRate on y.DetectionRateId equals z.DetectionRateId
|
||||
// where x.WeldJointId == repairRecord.WeldJointId
|
||||
// select z.DetectionRateValue;
|
||||
//// 如果返修的焊口为100%的检测比例,则不进行扩透
|
||||
//if (rate.Count() > 0 && rate.First().Value == 100)
|
||||
//{
|
||||
// listStr.Add(new SqlParameter("@ProjectId", "0"));
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
|
||||
//}
|
||||
#endregion
|
||||
//if (ndt.SysType == "射线检测")
|
||||
//{
|
||||
// strSql += " AND Flag = @Flag";
|
||||
@@ -406,6 +425,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
|
||||
var rjot = BLL.Pipeline_WeldJointService.GetWeldJointByWeldJointId(repair.WeldJointId);
|
||||
rjot.WeldJointCode = rjot.WeldJointCode.Replace("R1","").Replace("P1", "").Replace("S1", "").Trim() + "C1";
|
||||
rjot.OldWeldJointCode = rjot.WeldJointCode;
|
||||
rjot.Remark = "返修割口";
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
else
|
||||
@@ -608,12 +628,14 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
|
||||
|
||||
// 回写焊口
|
||||
var joint = BLL.Pipeline_WeldJointService.GetWeldJointByWeldJointId(repair.WeldJointId);
|
||||
if (!string.IsNullOrEmpty(joint.OldWeldJointCode))
|
||||
{
|
||||
joint.WeldJointCode = joint.OldWeldJointCode;
|
||||
joint.OldWeldJointCode = null;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
//if (!string.IsNullOrEmpty(joint.OldWeldJointCode))
|
||||
//{
|
||||
// joint.WeldJointCode = joint.OldWeldJointCode;
|
||||
// joint.OldWeldJointCode = null;
|
||||
// Funs.DB.SubmitChanges();
|
||||
//}--应为删除返修口
|
||||
|
||||
|
||||
//var exp = BLL.RepairRecordService.GetExportItem(repairRecordId);
|
||||
//if (exp != null)
|
||||
//{
|
||||
@@ -628,6 +650,11 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
|
||||
//}
|
||||
db.Repair_RepairRecord.DeleteOnSubmit(repair);
|
||||
db.SubmitChanges();
|
||||
if (joint.WeldJointCode.Contains("P") || joint.WeldJointCode.Contains("S") || joint.WeldJointCode.Contains("R"))
|
||||
{
|
||||
Pipeline_WeldJointService.DeleteWeldJointById(joint.WeldJointId);
|
||||
|
||||
}
|
||||
this.InitTreeMenu();//加载树
|
||||
Alert.ShowInTop("删除成功!", MessageBoxIcon.Success);
|
||||
}
|
||||
|
||||
@@ -78,132 +78,203 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
|
||||
newItem.RepairRecordId = SQLHelper.GetNewID(typeof(Model.Repair_RepairRecord));
|
||||
|
||||
string code = q.TrustBatchCode;
|
||||
if (code.Substring(code.Length - 2, 1) == "R")
|
||||
//if (code.Substring(code.Length - 2, 1) == "R")
|
||||
//{
|
||||
// string first = code.Substring(0, code.Length - 1);
|
||||
// string last = code.Substring(code.Length - 1);
|
||||
// int n = Convert.ToInt32(last) + 1;
|
||||
// newItem.RepairRecordCode = first + n.ToString();
|
||||
// newJointCode = q.WeldJointCode.Substring(0, q.WeldJointCode.Length - 2) + "R" + n.ToString();
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// if (q.CheckResult != "1") // 不合格
|
||||
// {
|
||||
// if (code.Substring(code.Length - 3, 2) == "EX")
|
||||
// {
|
||||
// newItem.RepairRecordCode = q.TrustBatchCode.Substring(0, code.Length - 3) + "-" + "EX1R1";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// newItem.RepairRecordCode = q.TrustBatchCode + "R1";
|
||||
// }
|
||||
// if (!q.WeldJointCode.Contains("R1"))
|
||||
// {
|
||||
// newJointCode = q.WeldJointCode + "R1";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// newJointCode = q.WeldJointCode;
|
||||
// }
|
||||
// }
|
||||
// else // 合格但有修磨或异物
|
||||
// {
|
||||
// if (q.Remark.Contains("修磨"))
|
||||
// {
|
||||
// newItem.RepairRecordCode = q.TrustBatchCode + "P1";
|
||||
// if (!q.WeldJointCode.Contains("P1"))
|
||||
// {
|
||||
// newJointCode = q.WeldJointCode + "P1";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// newJointCode = q.WeldJointCode;
|
||||
// }
|
||||
// }
|
||||
// if (q.Remark.Contains("异物"))
|
||||
// {
|
||||
// newItem.RepairRecordCode = q.TrustBatchCode + "S1";
|
||||
|
||||
// if (!q.WeldJointCode.Contains("S1"))
|
||||
// {
|
||||
// newJointCode = q.WeldJointCode + "S1";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// newJointCode = q.WeldJointCode;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// #region 原逻辑
|
||||
// //if (code.Substring(code.Length - 3, 2) == "EX")
|
||||
// //{
|
||||
// // newItem.RepairRecordCode = q.TrustBatchCode.Substring(0, code.Length - 3) + "-" + "EX1R1";
|
||||
// // if (!q.WeldJointCode.Contains("R1"))
|
||||
// // {
|
||||
// // newJointCode = q.WeldJointCode + "R1";
|
||||
// // }
|
||||
// // else
|
||||
// // {
|
||||
// // newJointCode = q.WeldJointCode;
|
||||
// // }
|
||||
// //}
|
||||
// //else
|
||||
// //{
|
||||
// // if (q.Remark.Contains("修磨"))
|
||||
// // {
|
||||
// // newItem.RepairRecordCode = q.TrustBatchCode + "P1";
|
||||
// // if (!q.WeldJointCode.Contains("P1"))
|
||||
// // {
|
||||
// // newJointCode = q.WeldJointCode + "P1";
|
||||
// // }
|
||||
// // else
|
||||
// // {
|
||||
// // newJointCode = q.WeldJointCode;
|
||||
// // }
|
||||
// // }
|
||||
// // else if (q.Remark.Contains("异物"))
|
||||
// // {
|
||||
// // newItem.RepairRecordCode = q.TrustBatchCode + "S1";
|
||||
|
||||
// // if (!q.WeldJointCode.Contains("S1"))
|
||||
// // {
|
||||
// // newJointCode = q.WeldJointCode + "S1";
|
||||
// // }
|
||||
// // else
|
||||
// // {
|
||||
// // newJointCode = q.WeldJointCode;
|
||||
// // }
|
||||
// // }
|
||||
// // else
|
||||
// // {
|
||||
// // newItem.RepairRecordCode = q.TrustBatchCode + "R1";
|
||||
// // if (!q.WeldJointCode.Contains("R1"))
|
||||
// // {
|
||||
// // newJointCode = q.WeldJointCode + "R1";
|
||||
// // }
|
||||
// // else
|
||||
// // {
|
||||
// // newJointCode = q.WeldJointCode;
|
||||
// // }
|
||||
// // }
|
||||
// //}
|
||||
// #endregion
|
||||
//}
|
||||
|
||||
if (code.Substring(code.Length - 2, 1)=="R"|| code.Substring(code.Length - 2, 1) == "P" || code.Substring(code.Length - 2, 1) == "S")
|
||||
{
|
||||
string first = code.Substring(0, code.Length - 1);
|
||||
string last = code.Substring(code.Length - 1);
|
||||
int n = Convert.ToInt32(last) + 1;
|
||||
newItem.RepairRecordCode = first + n.ToString();
|
||||
newJointCode = q.WeldJointCode.Substring(0, q.WeldJointCode.Length - 2) + "R" + n.ToString();
|
||||
newItem.RepairRecordCode = code.Substring(0,code.Length - 2) + txtRepairMark.Text;
|
||||
newJointCode = q.WeldJointCode.Substring(0, q.WeldJointCode.Length - 2)+txtRepairMark.Text;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (q.CheckResult != "1") // 不合格
|
||||
{
|
||||
if (code.Substring(code.Length - 3, 2) == "EX")
|
||||
{
|
||||
newItem.RepairRecordCode = q.TrustBatchCode.Substring(0, code.Length - 3) + "-" + "EX1R1";
|
||||
}
|
||||
else
|
||||
{
|
||||
newItem.RepairRecordCode = q.TrustBatchCode + "R1";
|
||||
}
|
||||
if (!q.WeldJointCode.Contains("R1"))
|
||||
{
|
||||
newJointCode = q.WeldJointCode + "R1";
|
||||
}
|
||||
else
|
||||
{
|
||||
newJointCode = q.WeldJointCode;
|
||||
}
|
||||
}
|
||||
else // 合格但有修磨或异物
|
||||
{
|
||||
if (q.Remark.Contains("修磨"))
|
||||
{
|
||||
newItem.RepairRecordCode = q.TrustBatchCode + "P1";
|
||||
if (!q.WeldJointCode.Contains("P1"))
|
||||
{
|
||||
newJointCode = q.WeldJointCode + "P1";
|
||||
}
|
||||
else
|
||||
{
|
||||
newJointCode = q.WeldJointCode;
|
||||
}
|
||||
}
|
||||
if (q.Remark.Contains("异物"))
|
||||
{
|
||||
newItem.RepairRecordCode = q.TrustBatchCode + "S1";
|
||||
|
||||
if (!q.WeldJointCode.Contains("S1"))
|
||||
{
|
||||
newJointCode = q.WeldJointCode + "S1";
|
||||
}
|
||||
else
|
||||
{
|
||||
newJointCode = q.WeldJointCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region 原逻辑
|
||||
//if (code.Substring(code.Length - 3, 2) == "EX")
|
||||
//{
|
||||
// newItem.RepairRecordCode = q.TrustBatchCode.Substring(0, code.Length - 3) + "-" + "EX1R1";
|
||||
// if (!q.WeldJointCode.Contains("R1"))
|
||||
// {
|
||||
// newJointCode = q.WeldJointCode + "R1";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// newJointCode = q.WeldJointCode;
|
||||
// }
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// if (q.Remark.Contains("修磨"))
|
||||
// {
|
||||
// newItem.RepairRecordCode = q.TrustBatchCode + "P1";
|
||||
// if (!q.WeldJointCode.Contains("P1"))
|
||||
// {
|
||||
// newJointCode = q.WeldJointCode + "P1";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// newJointCode = q.WeldJointCode;
|
||||
// }
|
||||
// }
|
||||
// else if (q.Remark.Contains("异物"))
|
||||
// {
|
||||
// newItem.RepairRecordCode = q.TrustBatchCode + "S1";
|
||||
|
||||
// if (!q.WeldJointCode.Contains("S1"))
|
||||
// {
|
||||
// newJointCode = q.WeldJointCode + "S1";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// newJointCode = q.WeldJointCode;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// newItem.RepairRecordCode = q.TrustBatchCode + "R1";
|
||||
// if (!q.WeldJointCode.Contains("R1"))
|
||||
// {
|
||||
// newJointCode = q.WeldJointCode + "R1";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// newJointCode = q.WeldJointCode;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
#endregion
|
||||
newItem.RepairRecordCode = code + txtRepairMark.Text;
|
||||
newJointCode = q.WeldJointCode + txtRepairMark.Text;
|
||||
}
|
||||
|
||||
var isExistRepairRecordCode = from x in Funs.DB.Repair_RepairRecord where x.RepairRecordCode == newItem.RepairRecordCode select x;
|
||||
if (isExistRepairRecordCode.Count() > 0)
|
||||
{
|
||||
ShowNotify("该返修号已存在!请修改已存在的返修号", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// 回写焊口号
|
||||
var weldJoint = BLL.Pipeline_WeldJointService.GetWeldJointByWeldJointId(q.WeldJointId);
|
||||
//joint.WeldJointCode = newJointCode;
|
||||
//joint.OldWeldJointCode = q.WeldJointCode;
|
||||
//Funs.DB.SubmitChanges();
|
||||
Model.Pipeline_WeldJoint newWeldJoint = new Model.Pipeline_WeldJoint
|
||||
{
|
||||
WeldJointId = SQLHelper.GetNewID(typeof(Model.Pipeline_WeldJoint)),
|
||||
ProjectId = weldJoint.ProjectId,
|
||||
PipelineId = weldJoint.PipelineId,
|
||||
WeldJointCode = newJointCode,
|
||||
WeldTypeId = weldJoint.WeldTypeId,
|
||||
Material1Id = weldJoint.Material1Id,
|
||||
Material2Id = weldJoint.Material2Id,
|
||||
Thickness = weldJoint.Thickness,
|
||||
Dia = weldJoint.Dia,
|
||||
Size = weldJoint.Size,
|
||||
JointAttribute = weldJoint.JointAttribute,
|
||||
JointArea = weldJoint.JointArea,
|
||||
WeldingMethodId = weldJoint.WeldingMethodId,
|
||||
IsHotProess = weldJoint.IsHotProess,
|
||||
WeldingLocationId = weldJoint.WeldingLocationId,
|
||||
WeldMatId = weldJoint.WeldMatId,
|
||||
WeldSilkId = weldJoint.WeldSilkId,
|
||||
GrooveTypeId = weldJoint.GrooveTypeId,
|
||||
PipeSegment = weldJoint.PipeSegment,
|
||||
PipeAssembly1Id = weldJoint.PipeAssembly1Id,
|
||||
PipeAssembly2Id = weldJoint.PipeAssembly2Id,
|
||||
PipeAssemblyCount = weldJoint.PipeAssemblyCount,
|
||||
HeartNo1 = weldJoint.HeartNo1,
|
||||
HeartNo2 = weldJoint.HeartNo2,
|
||||
LastTemp = weldJoint.LastTemp,
|
||||
CellTemp = weldJoint.CellTemp,
|
||||
PrepareTemp = weldJoint.PrepareTemp,
|
||||
Electricity = weldJoint.Electricity,
|
||||
Voltage = weldJoint.Voltage,
|
||||
TestPackageNo = weldJoint.TestPackageNo,
|
||||
WeldingDailyCode = weldJoint.WeldingDailyCode,
|
||||
BackingWelderId = weldJoint.BackingWelderId,
|
||||
CoverWelderId = weldJoint.CoverWelderId,
|
||||
WeldingDailyId = weldJoint.WeldingDailyId,
|
||||
PipingClassId = weldJoint.PipingClassId,
|
||||
Specification = weldJoint.Specification,
|
||||
DoneDin = weldJoint.DoneDin,
|
||||
SystemNumber = weldJoint.SystemNumber,
|
||||
Remark = weldJoint.Remark,
|
||||
IsGoldJoint = weldJoint.IsGoldJoint,
|
||||
IsPMI = weldJoint.IsPMI,
|
||||
WPQId = weldJoint.WPQId,
|
||||
DetectionType = weldJoint.DetectionType,
|
||||
PageNum = weldJoint.PageNum,
|
||||
ANSISCH = weldJoint.ANSISCH,
|
||||
OldWeldJointCode = weldJoint.OldWeldJointCode,
|
||||
|
||||
};
|
||||
string WeldJointId= BLL.Pipeline_WeldJointService.AddWeldJointRef(newWeldJoint);
|
||||
|
||||
newItem.ProjectId = q.ProjectId;
|
||||
newItem.UnitId = q.UnitId;
|
||||
newItem.InstallationId = q.InstallationId;
|
||||
newItem.WorkAreaId = q.WorkAreaId;
|
||||
newItem.NoticeDate = DateTime.Now;
|
||||
newItem.NDEItemID = ndeItemId;
|
||||
newItem.WeldJointId = q.WeldJointId;
|
||||
newItem.WeldJointId = WeldJointId;
|
||||
newItem.DetectionTypeId = q.DetectionTypeId;
|
||||
newItem.WelderId = q.BackingWelderId;
|
||||
newItem.RepairLocation = q.RepairLocation;
|
||||
@@ -211,12 +282,6 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
|
||||
newItem.RepairMark = txtRepairMark.Text;
|
||||
newItem.PhotoUrl = imgPhoto.ImageUrl;
|
||||
BLL.RepairRecordService.AddRepairRecord(newItem);
|
||||
|
||||
// 回写焊口号
|
||||
var joint = BLL.Pipeline_WeldJointService.GetWeldJointByWeldJointId(q.WeldJointId);
|
||||
joint.WeldJointCode = newJointCode;
|
||||
joint.OldWeldJointCode = q.WeldJointCode;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user