From e46a7ad17943583c04302d08bb7391e0b753e32a Mon Sep 17 00:00:00 2001 From: fly-l <1420031550@qq.com> Date: Fri, 27 Oct 2023 14:02:52 +0800 Subject: [PATCH] 2023-10-27 --- SGGL/BLL/HJGL/PointTrust/PointBatchService.cs | 3 +- .../HJGL/WeldingManage/WeldingDailyService.cs | 50 ++ .../HJGL/WeldingManage/WeldJointEdit.aspx.cs | 2 +- .../HJGL/WeldingManage/WeldReport.aspx | 19 +- .../HJGL/WeldingManage/WeldReport.aspx.cs | 25 +- .../WeldingManage/WeldReport.aspx.designer.cs | 18 + .../HJGL/WeldingManage/WeldReportEdit.aspx | 2 +- .../HJGL/WeldingManage/WeldReportEdit.aspx.cs | 782 +++++++++--------- .../HJGL/WeldingManage/WeldTask.aspx.cs | 6 +- 9 files changed, 486 insertions(+), 421 deletions(-) diff --git a/SGGL/BLL/HJGL/PointTrust/PointBatchService.cs b/SGGL/BLL/HJGL/PointTrust/PointBatchService.cs index b391b9d2..04705021 100644 --- a/SGGL/BLL/HJGL/PointTrust/PointBatchService.cs +++ b/SGGL/BLL/HJGL/PointTrust/PointBatchService.cs @@ -140,6 +140,7 @@ namespace BLL var project = BLL.ProjectService.GetProjectByProjectId(pipeline.ProjectId); var unitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(pipeline.UnitWorkId); var unit = BLL.UnitService.GetUnitByUnitId(pipeline.UnitId); + var WeldingDaily = BLL.WeldingDailyService.GetPipeline_WeldingDailyByWeldingDailyId(newWeldJoint.WeldingDailyId); var ndt = BLL.Base_DetectionTypeService.GetDetectionTypeByDetectionTypeId(pipeline.DetectionType); var ndtr = BLL.Base_DetectionRateService.GetDetectionRateByDetectionRateId(pipeline.DetectionRateId); @@ -241,7 +242,7 @@ namespace BLL batch.ProjectId = project.ProjectId; batch.UnitWorkId = pipeline.UnitWorkId; batch.BatchCondition = batchCondition; - batch.UnitId = pipeline.UnitId; + batch.UnitId = WeldingDaily.UnitId; batch.DetectionTypeId = pipeline.DetectionType; batch.DetectionRateId = pipeline.DetectionRateId; if (condition.Contains("5")) diff --git a/SGGL/BLL/HJGL/WeldingManage/WeldingDailyService.cs b/SGGL/BLL/HJGL/WeldingManage/WeldingDailyService.cs index 86ea8e24..8949031b 100644 --- a/SGGL/BLL/HJGL/WeldingManage/WeldingDailyService.cs +++ b/SGGL/BLL/HJGL/WeldingManage/WeldingDailyService.cs @@ -295,6 +295,56 @@ namespace BLL db.SubmitChanges(); } } + /// + /// 日报明细删除 + /// + /// + /// + public static string DeleteWeldingDailyItemByweldJointId(string weldJointId) + { + string errlog = string.Empty; + var newWeldJoint = BLL.WeldJointService.GetWeldJointByWeldJointId(weldJointId); + var pipeline = BLL.PipelineService.GetPipelineByPipelineId(newWeldJoint.PipelineId); + + if (newWeldJoint != null && !string.IsNullOrEmpty(newWeldJoint.WeldingDailyId)) + { + var isTrust = from x in Funs.DB.HJGL_Batch_BatchTrustItem + where x.WeldJointId == weldJointId + select x; ; + if (isTrust.Count() == 0) + { + var updateWeldJoint = BLL.WeldJointService.GetWeldJointByWeldJointId(weldJointId); + if (updateWeldJoint != null) + { + updateWeldJoint.WeldingDailyId = null; + updateWeldJoint.WeldingDailyCode = null; + updateWeldJoint.CoverWelderId = null; + updateWeldJoint.BackingWelderId = null; + BLL.WeldJointService.UpdateWeldJoint(updateWeldJoint); + + var pointBatchItems = from x in Funs.DB.HJGL_Batch_PointBatchItem where x.WeldJointId == weldJointId select x; + string pointBatchId = pointBatchItems.FirstOrDefault().PointBatchId; + + // 删除焊口所在批明细信息 + BLL.PointBatchDetailService.DeleteBatchDetail(weldJointId); + + // 删除批信息 + var batch = from x in Funs.DB.HJGL_Batch_PointBatchItem where x.PointBatchId == pointBatchId select x; + if (pointBatchId != null && batch.Count() == 0) + { + BLL.PointBatchService.DeleteBatch(pointBatchId); + } + } + } + else + { + errlog += "焊口【" + newWeldJoint.WeldJointCode + "】已进委托单了,不能删除。"; + } + } + + return errlog; + } + /// /// 按类型获取焊接日报项 diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointEdit.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointEdit.aspx.cs index e0c37828..ec9605fb 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldJointEdit.aspx.cs @@ -71,7 +71,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage if (flag == "2") { GroupPanel2.Hidden = false; - IsReadOnly(true); + IsReadOnly(false); } else { diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx index f9852200..0829e1cf 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldReport.aspx @@ -161,8 +161,14 @@ - + + + + + @@ -203,16 +209,25 @@ runat="server" Text="删除"> + + + +