This commit is contained in:
2024-10-10 10:35:01 +08:00
parent 94fc0c6aa5
commit 022aebc00d
45 changed files with 1525 additions and 487 deletions
@@ -486,6 +486,11 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
List<Model.View_Batch_NDEItem> GetNDEItem = this.CollectGridNDEItem();
string errlog = string.Empty;
if (GetNDEItem.Count()==0)
{
ShowNotify("请勾选检测细明!", MessageBoxIcon.Warning);
return;
}
foreach (var item in GetNDEItem)
{
var oldItem = BLL.Batch_NDEItemService.GetNDEItemById(item.NDEItemID);
@@ -73,15 +73,18 @@
</f:HiddenField>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnSave" Text="<%$ Resources:Lan,Save %>" ToolTip="<%$ Resources:Lan,Save %>"
<f:Button ID="btnSave" Text="<%$ Resources:Lan,Submit %>" ToolTip="<%$ Resources:Lan,Submit %>"
Icon="SystemSave" runat="server" OnClick="btnSave_Click">
</f:Button>
<f:Button ID="btnPointAudit" Text="扩透口审核" ToolTip="监理审核后才可生成委托单" Icon="ArrowNsew" runat="server"
OnClick="btnPointAudit_Click" Hidden="true">
</f:Button>
<f:Button ID="btnGenerate" Text="生成" ToolTip="生成委托单" Icon="TableEdit" runat="server"
OnClick="btnGenerate_Click" >
OnClick="btnGenerate_Click" Hidden="true">
</f:Button>
<f:button id="btnDelete" text="<%$ Resources:Lan,Delete %>" icon="Delete" runat="server"
onclick="btnDelete_Click">
</f:button>
<f:Button ID="btnSee" Text="查看底片" OnClick="btnSee_Click" runat="server"></f:Button>
</Items>
</f:Toolbar>
@@ -7,6 +7,7 @@ using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using NPOI.SS.Formula.Functions;
namespace FineUIPro.Web.WeldingProcess.CheckManage
{
@@ -239,7 +240,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
JointArea,Size,WeldingDate,PipelineCode,PipingClassName
FROM dbo.View_Batch_PointBatchItem
WHERE ProjectId=@ProjectId AND DetectionTypeId=@DetectionTypeId
AND (PointDate IS NULL OR (PointDate IS NOT NULL AND RepairRecordId=@RepairRecordId))";
AND (PState IS NULL OR (PState='2' AND RepairRecordId=@RepairRecordId))";
}
List<SqlParameter> listStr = new List<SqlParameter>();
@@ -392,32 +393,107 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
if (ckbIsCut.Checked)
{
repair.IsCut = true;
repair.RepairRecordCode = repair.RepairRecordCode.Substring(0, repair.RepairRecordCode.Length - 1) + "C";
repair.RepairRecordCode = repair.RepairRecordCode.Substring(0, repair.RepairRecordCode.Length - 2) + "C1";
//先还原
var joint = BLL.Pipeline_WeldJointService.GetWeldJointByWeldJointId(repair.WeldJointId);
if (!string.IsNullOrEmpty(joint.OldWeldJointCode))
{
joint.WeldJointCode = joint.OldWeldJointCode;
joint.OldWeldJointCode = null;
Funs.DB.SubmitChanges();
}
// 回写焊口号
var rjot = BLL.Pipeline_WeldJointService.GetWeldJointByWeldJointId(repair.WeldJointId);
rjot.WeldJointCode = rjot.WeldJointCode.Replace("R1","").Replace("P1", "").Replace("S1", "").Trim() + "C1";
rjot.OldWeldJointCode = rjot.WeldJointCode;
Funs.DB.SubmitChanges();
}
else
{
// 回写焊口号 撤消
var joint = BLL.Pipeline_WeldJointService.GetWeldJointByWeldJointId(repair.WeldJointId);
if (joint.WeldJointCode.Contains("C1") && joint.OldWeldJointCode != null)
{
joint.WeldJointCode = joint.OldWeldJointCode;
joint.OldWeldJointCode = null;
Funs.DB.SubmitChanges();
}
}
}
// 更新返修口
var batchItem = db.Batch_PointBatchItem.FirstOrDefault(x => x.WeldJointId == repair.WeldJointId && x.RepairDate == null);
if (batchItem != null)
#region
//var batchItem = db.Batch_PointBatchItem.FirstOrDefault(x => x.WeldJointId == repair.WeldJointId && x.RepairDate == null);
//if (batchItem != null)
//{
// batchItem.RepairDate = Convert.ToDateTime(this.txtRepairDate.Text);
// batchItem.RepairRecordId = repairRecordId;
// if (ckbIsCut.Checked)
// {
// batchItem.CutDate = DateTime.Now.Date;
// }
// db.SubmitChanges();
//}
//else
//{
// var updatebatchItem = db.Batch_PointBatchItem.FirstOrDefault(x => x.WeldJointId == repair.WeldJointId && x.RepairRecordId == repairRecordId);
// if (updatebatchItem != null)
// {
// updatebatchItem.RepairDate = Convert.ToDateTime(this.txtRepairDate.Text);
// db.SubmitChanges();
// }
//}
#endregion
// 点口状态3表示返修口
var repairbatchItem = db.Batch_PointBatchItem.FirstOrDefault(x => x.WeldJointId == repair.WeldJointId && x.RepairRecordId == repairRecordId && (x.PointState == "3" || x.PointState == "4" || x.PointState == "5"));
var repairbatch = (from x in db.Batch_PointBatchItem
join y in db.Batch_PointBatch on x.PointBatchId equals y.PointBatchId
where x.WeldJointId==repair.WeldJointId && y.DetectionTypeId==repair.DetectionTypeId
select x).FirstOrDefault();
if (repairbatchItem == null) // 增加返修口
{
batchItem.RepairDate = Convert.ToDateTime(this.txtRepairDate.Text);
batchItem.RepairRecordId = repairRecordId;
if (ckbIsCut.Checked)
if (repairbatch != null)
{
batchItem.CutDate = DateTime.Now.Date;
}
db.SubmitChanges();
if (ckbIsCut.Checked) // 切除
{
repairbatch.CutDate = DateTime.Now.Date;
}
else
{
Model.Batch_PointBatchItem addRepairPointBatch = new Model.Batch_PointBatchItem();
string itemId = SQLHelper.GetNewID(typeof(Model.Batch_PointBatchItem));
addRepairPointBatch.PointBatchItemId = itemId;
addRepairPointBatch.PointBatchId = repairbatch.PointBatchId;
addRepairPointBatch.WeldJointId = repair.WeldJointId;
addRepairPointBatch.WeldingDate = Convert.ToDateTime(this.txtRepairDate.Text);
addRepairPointBatch.RepairDate = Convert.ToDateTime(this.txtRepairDate.Text);
addRepairPointBatch.AcceptLevel = repairbatch.AcceptLevel;
addRepairPointBatch.PointDate = DateTime.Now;
addRepairPointBatch.RepairRecordId = repairRecordId;
addRepairPointBatch.IsCheckRepair = false;
addRepairPointBatch.EnterDate= DateTime.Now;
if (repair.RepairMark.Contains("R"))
{
addRepairPointBatch.PointState = "3";
}
if (repair.RepairMark.Contains("P"))
{
addRepairPointBatch.PointState = "4";
}
if (repair.RepairMark.Contains("S"))
{
addRepairPointBatch.PointState = "5";
}
BLL.Batch_PointBatchItemService.AddPointBatchItem(addRepairPointBatch);
}
}
}
else
{
var updatebatchItem = db.Batch_PointBatchItem.FirstOrDefault(x => x.WeldJointId == repair.WeldJointId && x.RepairRecordId == repairRecordId);
if (updatebatchItem != null)
{
updatebatchItem.RepairDate = Convert.ToDateTime(this.txtRepairDate.Text);
db.SubmitChanges();
}
repairbatchItem.RepairDate = Convert.ToDateTime(this.txtRepairDate.Text);
db.SubmitChanges();
}
var exp = BLL.RepairRecordService.GetExportItem(repairRecordId);
if (exp != null)
@@ -433,8 +509,14 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
newPointBatchItem.RepairRecordId = null;
db.SubmitChanges();
}
// 回写焊口号
var joint = BLL.Pipeline_WeldJointService.GetWeldJointByWeldJointId(item.WeldJointId);
joint.WeldJointCode = joint.OldWeldJointCode;
joint.OldWeldJointCode = null;
Funs.DB.SubmitChanges();
}
}
// 更新扩透口
string[] checkedRow = Grid1.SelectedRowIDArray;
if (checkedRow.Count() > 0)
@@ -451,6 +533,15 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
newPointBatchItem.PointDate = DateTime.Now;
newPointBatchItem.RepairRecordId = repairRecordId;
db.SubmitChanges();
// 回写焊口号
var joint = BLL.Pipeline_WeldJointService.GetWeldJointByWeldJointId(newPointBatchItem.WeldJointId);
if (!joint.WeldJointCode.Contains("EX1"))
{
joint.WeldJointCode = joint.WeldJointCode + "EX1";
joint.OldWeldJointCode = joint.WeldJointCode;
Funs.DB.SubmitChanges();
}
}
// 大于500的焊口扩透口是自身,这时要增加批明细
else
@@ -472,8 +563,17 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
addPointBatchItem.IsCheckRepair = false;
BLL.Batch_PointBatchItemService.AddPointBatchItem(addPointBatchItem);
// 回写焊口号 不用回写,本身是返修口又是扩透口
//var joint = BLL.Pipeline_WeldJointService.GetWeldJointByWeldJointId(repair.WeldJointId);
//joint.WeldJointCode = joint.WeldJointCode + "EX1";
//joint.OldWeldJointCode = joint.WeldJointCode;
//Funs.DB.SubmitChanges();
}
}
}
}
}
@@ -492,6 +592,52 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
}
}
protected void btnDelete_Click(object sender, EventArgs e)
{
if (CurrUser.UserId == Const.GlyId)
{
Model.HJGLDB db = Funs.DB;
string repairRecordId = tvControlItem.SelectedNodeID;
var repair = db.Repair_RepairRecord.FirstOrDefault(x => x.RepairRecordId == repairRecordId);
var repairTrust = from x in db.Batch_PointBatchItem where x.RepairRecordId == repairRecordId && (x.PointState == "2" || x.PointState == "3") select x;
if (repairTrust.Count() > 0)
{
ShowNotify("返修扩透数据已提交,不能删除!", MessageBoxIcon.Warning);
return;
}
// 回写焊口
var joint = BLL.Pipeline_WeldJointService.GetWeldJointByWeldJointId(repair.WeldJointId);
if (!string.IsNullOrEmpty(joint.OldWeldJointCode))
{
joint.WeldJointCode = joint.OldWeldJointCode;
joint.OldWeldJointCode = null;
Funs.DB.SubmitChanges();
}
//var exp = BLL.RepairRecordService.GetExportItem(repairRecordId);
//if (exp != null)
//{
// foreach (Model.Batch_PointBatchItem item in exp)
// {
// Model.Batch_PointBatchItem newPointBatchItem = db.Batch_PointBatchItem.FirstOrDefault(x => x.PointBatchItemId == item.PointBatchItemId);
// newPointBatchItem.PointState = null;
// newPointBatchItem.PointDate = null;
// newPointBatchItem.RepairRecordId = null;
// db.SubmitChanges();
// }
//}
db.Repair_RepairRecord.DeleteOnSubmit(repair);
db.SubmitChanges();
this.InitTreeMenu();//加载树
Alert.ShowInTop("删除成功!", MessageBoxIcon.Success);
}
else
{
ShowNotify(Resources.Lan.NoPrivilegePrompt, MessageBoxIcon.Warning);
return;
}
}
protected void btnPointAudit_Click(object sender, EventArgs e)
{
Model.HJGLDB db = Funs.DB;
@@ -534,9 +680,13 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
Model.Repair_RepairRecord repairRecord = BLL.RepairRecordService.GetRepairRecordById(repairRecordId);
var pipe = BLL.Pipeline_WeldJointService.GetViewWeldJointById(repairRecord.WeldJointId);
string pipelineId = string.Empty;
string weldingMethodId = string.Empty;
string grooveTypeId = string.Empty;
if (pipe != null)
{
pipelineId = pipe.PipelineId;
weldingMethodId = pipe.WeldingMethodId;
grooveTypeId = pipe.GrooveTypeId;
}
var t = from x in Funs.DB.Batch_BatchTrustItem where x.RepairRecordId == repairRecordId select x;
if (t.Count() == 0)
@@ -557,6 +707,9 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
newRepairTrust.WorkAreaId = repairRecord.WorkAreaId;
newRepairTrust.DetectionTypeId = repairRecord.DetectionTypeId;
newRepairTrust.PipelineId = pipelineId;
newRepairTrust.WeldingMethodId = weldingMethodId;
newRepairTrust.GrooveTypeId = grooveTypeId;
BLL.Batch_BatchTrustService.AddBatchTrust(newRepairTrust); // 新增返修委托单
Model.Batch_BatchTrustItem newRepairTrustItem = new Model.Batch_BatchTrustItem();
@@ -572,6 +725,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
var exp = BLL.RepairRecordService.GetExportItem(repairRecordId);
if (exp != null)
{
var jot = BLL.Pipeline_WeldJointService.GetWeldJointByWeldJointId(exp.First().WeldJointId);
string exportTrustCode = string.Empty;
if (repairRecord.RepairRecordCode.Substring(repairRecord.RepairRecordCode.Length - 5) == "EX1R2")
{
@@ -600,6 +754,8 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
newExportTrust.WorkAreaId = repairRecord.WorkAreaId;
newExportTrust.DetectionTypeId = repairRecord.DetectionTypeId;
newExportTrust.PipelineId = pipelineId;
newExportTrust.WeldingMethodId = jot.WeldingMethodId;
newExportTrust.GrooveTypeId = jot.GrooveTypeId;
BLL.Batch_BatchTrustService.AddBatchTrust(newExportTrust); // 新增扩透委托单
foreach (var q in exp)
@@ -7,11 +7,13 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.WeldingProcess.CheckManage {
public partial class RepairAndExpand {
namespace FineUIPro.Web.WeldingProcess.CheckManage
{
public partial class RepairAndExpand
{
/// <summary>
/// form1 控件。
/// </summary>
@@ -20,7 +22,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
@@ -29,7 +31,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
@@ -38,7 +40,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// panelLeftRegion 控件。
/// </summary>
@@ -47,7 +49,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelLeftRegion;
/// <summary>
/// Toolbar4 控件。
/// </summary>
@@ -56,7 +58,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar4;
/// <summary>
/// drpTrust 控件。
/// </summary>
@@ -65,7 +67,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpTrust;
/// <summary>
/// Toolbar1 控件。
/// </summary>
@@ -74,7 +76,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// txtRepairMonth 控件。
/// </summary>
@@ -83,7 +85,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtRepairMonth;
/// <summary>
/// Toolbar5 控件。
/// </summary>
@@ -92,7 +94,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar5;
/// <summary>
/// txtSearchCode 控件。
/// </summary>
@@ -101,7 +103,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtSearchCode;
/// <summary>
/// tvControlItem 控件。
/// </summary>
@@ -110,7 +112,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Tree tvControlItem;
/// <summary>
/// panelCenterRegion 控件。
/// </summary>
@@ -119,7 +121,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelCenterRegion;
/// <summary>
/// Toolbar2 控件。
/// </summary>
@@ -128,7 +130,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// hdNDEID 控件。
/// </summary>
@@ -137,7 +139,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdNDEID;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
@@ -146,7 +148,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnSave 控件。
/// </summary>
@@ -155,7 +157,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnPointAudit 控件。
/// </summary>
@@ -164,7 +166,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnPointAudit;
/// <summary>
/// btnGenerate 控件。
/// </summary>
@@ -173,7 +175,16 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnGenerate;
/// <summary>
/// btnDelete 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnDelete;
/// <summary>
/// btnSee 控件。
/// </summary>
@@ -182,7 +193,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSee;
/// <summary>
/// SimpleForm1 控件。
/// </summary>
@@ -191,7 +202,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// txtPipeCode 控件。
/// </summary>
@@ -200,7 +211,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtPipeCode;
/// <summary>
/// txtWeldJointCode 控件。
/// </summary>
@@ -209,7 +220,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtWeldJointCode;
/// <summary>
/// txtRepairLocation 控件。
/// </summary>
@@ -218,7 +229,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtRepairLocation;
/// <summary>
/// txtWelder 控件。
/// </summary>
@@ -227,7 +238,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtWelder;
/// <summary>
/// txtJudgeGrade 控件。
/// </summary>
@@ -236,7 +247,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtJudgeGrade;
/// <summary>
/// txtCheckDefects 控件。
/// </summary>
@@ -245,7 +256,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtCheckDefects;
/// <summary>
/// drpRepairWelder 控件。
/// </summary>
@@ -254,7 +265,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpRepairWelder;
/// <summary>
/// txtRepairDate 控件。
/// </summary>
@@ -263,7 +274,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtRepairDate;
/// <summary>
/// ckbIsCut 控件。
/// </summary>
@@ -272,7 +283,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.CheckBox ckbIsCut;
/// <summary>
/// lbIsAudit 控件。
/// </summary>
@@ -281,7 +292,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label lbIsAudit;
/// <summary>
/// Grid1 控件。
/// </summary>
@@ -290,7 +301,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar3 控件。
/// </summary>
@@ -299,7 +310,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar3;
/// <summary>
/// ckbWelder 控件。
/// </summary>
@@ -308,7 +319,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.CheckBox ckbWelder;
/// <summary>
/// ckbPipe 控件。
/// </summary>
@@ -317,7 +328,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.CheckBox ckbPipe;
/// <summary>
/// ckbRepairBefore 控件。
/// </summary>
@@ -326,7 +337,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.CheckBox ckbRepairBefore;
/// <summary>
/// ckbMat 控件。
/// </summary>
@@ -335,7 +346,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.CheckBox ckbMat;
/// <summary>
/// ckbSpec 控件。
/// </summary>
@@ -344,7 +355,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.CheckBox ckbSpec;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
@@ -353,7 +364,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
@@ -362,7 +373,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
@@ -371,7 +382,7 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// Window1 控件。
/// </summary>
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using BLL;
using NPOI.SS.Formula.Functions;
namespace FineUIPro.Web.WeldingProcess.CheckManage
{
@@ -27,7 +28,18 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
select x;
if (mark.Count() == 0)
{
txtRepairMark.Text = "R1";
if (q.PassFilm != q.TotalFilm)
{
txtRepairMark.Text = "R1";
}
if (q.Remark.Contains("修磨"))
{
txtRepairMark.Text = "P1";
}
if (q.Remark.Contains("异物"))
{
txtRepairMark.Text = "S1";
}
}
else
{
@@ -57,54 +69,159 @@ namespace FineUIPro.Web.WeldingProcess.CheckManage
var repair = BLL.RepairRecordService.GetRepairRecordByNdeItemId(ndeItemId);
Model.Repair_RepairRecord newItem = new Model.Repair_RepairRecord();
string newJointCode = string.Empty;
if (repair == null)
{
newItem.RepairRecordId = SQLHelper.GetNewID(typeof(Model.Repair_RepairRecord));
if (q.CheckResult != null)
{
newItem.RepairRecordId = SQLHelper.GetNewID(typeof(Model.Repair_RepairRecord));
string code = q.TrustBatchCode;
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();
}
else
{
if (code.Substring(code.Length - 3, 2) == "EX")
string code = q.TrustBatchCode;
if (code.Substring(code.Length - 2, 1) == "R")
{
newItem.RepairRecordCode = q.TrustBatchCode.Substring(0, code.Length - 3) + "-" + q.WeldJointCode + "EX1R1";
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.Remark.Contains("修磨"))
if (q.CheckResult != "1") // 不合格
{
newItem.RepairRecordCode = q.TrustBatchCode + "-" + q.WeldJointCode + "P1";
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("异物"))
else // 合格但有修磨或异物
{
newItem.RepairRecordCode = q.TrustBatchCode + "-" + q.WeldJointCode + "S1";
}
else
{
newItem.RepairRecordCode = q.TrustBatchCode + "-" + q.WeldJointCode + "R1";
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
}
var isExistRepairRecordCode = from x in Funs.DB.Repair_RepairRecord where x.RepairRecordCode == newItem.RepairRecordCode select x;
if (isExistRepairRecordCode.Count() > 0)
{
ShowNotify("该返修号已存在!请修改已存在的返修号", MessageBoxIcon.Warning);
return;
}
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.DetectionTypeId = q.DetectionTypeId;
newItem.WelderId = q.BackingWelderId;
newItem.RepairLocation = q.RepairLocation;
newItem.CheckDefects = txtCheckDefects.Text;
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
{
ShowNotify("没有检测结果!不能生成委托单", MessageBoxIcon.Warning);
}
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.DetectionTypeId = q.DetectionTypeId;
newItem.WelderId = q.BackingWelderId;
newItem.RepairLocation = q.RepairLocation;
newItem.CheckDefects = txtCheckDefects.Text;
newItem.RepairMark = txtRepairMark.Text;
newItem.PhotoUrl = imgPhoto.ImageUrl;
BLL.RepairRecordService.AddRepairRecord(newItem);
}
else
{