diff --git a/DataBase/版本日志/SGGLDB_V2026-10-14-001-lpf.sql b/DataBase/版本日志/SGGLDB_V2026-10-14-001-lpf.sql new file mode 100644 index 00000000..b85b9b79 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2026-10-14-001-lpf.sql @@ -0,0 +1,22 @@ + +SET NOCOUNT ON; + +IF COL_LENGTH(N'dbo.WBS_UnitWork', N'SerialNumber') IS NULL +BEGIN + ALTER TABLE dbo.WBS_UnitWork ADD SerialNumber int NULL; +END; + + +-- 为角色权限配置提供“修改”按钮,具体角色由管理员按需授权。 +DECLARE @MenuId NVARCHAR(50) = N'0CA58EC2-7934-49B3-A2C3-327FAD27C541'; + +IF NOT EXISTS ( + SELECT 1 FROM dbo.Sys_ButtonToMenu + WHERE MenuId = @MenuId AND ButtonName = N'修改' +) +BEGIN + INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) + SELECT CONVERT(NVARCHAR(50), NEWID()), @MenuId, N'修改', ISNULL(MAX(SortIndex), 0) + 1 + FROM dbo.Sys_ButtonToMenu + WHERE MenuId = @MenuId; +END; diff --git a/SGGL/BLL/API/HJGL/APINDETrustService.cs b/SGGL/BLL/API/HJGL/APINDETrustService.cs index ffd257c4..62a2c56f 100644 --- a/SGGL/BLL/API/HJGL/APINDETrustService.cs +++ b/SGGL/BLL/API/HJGL/APINDETrustService.cs @@ -431,10 +431,13 @@ namespace BLL List toPointBatchList = generateTrustItem.Select(x => x.PointBatchId).Distinct().ToList(); + var project = BLL.ProjectService.GetProjectByProjectId(batch.ProjectId); + var area = BLL.UnitWorkService.getUnitWorkByUnitWorkId(batch.UnitWorkId); + var ndt = BLL.Base_DetectionTypeService.GetDetectionTypeByDetectionTypeId(batch.DetectionTypeId); Model.HJGL_Batch_BatchTrust newBatchTrust = new Model.HJGL_Batch_BatchTrust { TrustBatchId = trustBatchId, - TrustBatchCode = BLL.Batch_BatchTrustService.BuildTrustBatchCode(batch.PointBatchCode, DateTime.Now,string.Empty,string.Empty), + TrustBatchCode = BLL.Batch_BatchTrustService.BuildTrustBatchCode(project.ProjectCode, area.UnitWorkCode, ndt.DetectionTypeCode, batch.PointBatchCode), TrustDate = DateTime.Now, ProjectId = batch.ProjectId, PointBatchId = pointBatchId, diff --git a/SGGL/BLL/HJGL/PointTrust/Batch_BatchTrustService.cs b/SGGL/BLL/HJGL/PointTrust/Batch_BatchTrustService.cs index ce7b5c87..931f8ca8 100644 --- a/SGGL/BLL/HJGL/PointTrust/Batch_BatchTrustService.cs +++ b/SGGL/BLL/HJGL/PointTrust/Batch_BatchTrustService.cs @@ -8,12 +8,12 @@ namespace BLL public static class Batch_BatchTrustService { /// - /// 根据点口批编号生成委托单号,在流水号前追加日期段。 + /// 按项目、单位工程、检测方法和原点口批流水号生成委托单号。 /// - public static string BuildTrustBatchCode(string pointBatchCode, System.DateTime trustDate, string typeStr1, string typeStr2) + public static string BuildTrustBatchCode(string projectCode, string unitWorkCode, string detectionTypeCode, string pointBatchCode) { - string trustBatchCode = (pointBatchCode ?? string.Empty).Replace("-DK-", "-WT-").Replace(typeStr1, typeStr2); - return InsertDateBeforeSerial(trustBatchCode, trustDate); + string serial = pointBatchCode.Substring(pointBatchCode.LastIndexOf('-') + 1); + return projectCode + "-" + unitWorkCode + "-" + detectionTypeCode + "-SPCECC-" + serial; } /// @@ -24,30 +24,6 @@ namespace BLL return unitCode + "-" + detectionTypeCode + "-" + detectionRateValue + "%-" + trustDate.ToString("yyyyMMdd") + "-"; } - private static string InsertDateBeforeSerial(string code, System.DateTime date) - { - if (string.IsNullOrEmpty(code)) - { - return code; - } - - string dateText = date.ToString("yyyyMMdd"); - int lastIndex = code.LastIndexOf('-'); - if (lastIndex < 0) - { - return code + "-" + dateText; - } - - string prefix = code.Substring(0, lastIndex); - string serial = code.Substring(lastIndex + 1); - if (prefix.EndsWith("-" + dateText, System.StringComparison.Ordinal)) - { - return code; - } - - return prefix + "-" + dateText + "-" + serial; - } - /// /// 根据主键获取无损委托 /// diff --git a/SGGL/BLL/ProjectData/UnitWorkService.cs b/SGGL/BLL/ProjectData/UnitWorkService.cs index fba061ab..01b33189 100644 --- a/SGGL/BLL/ProjectData/UnitWorkService.cs +++ b/SGGL/BLL/ProjectData/UnitWorkService.cs @@ -20,6 +20,7 @@ namespace BLL Model.WBS_UnitWork newUnitWork = new Model.WBS_UnitWork(); newUnitWork.UnitWorkId = UnitWork.UnitWorkId; newUnitWork.UnitWorkCode = UnitWork.UnitWorkCode; + newUnitWork.SerialNumber = UnitWork.SerialNumber; newUnitWork.UnitWorkName = UnitWork.UnitWorkName; newUnitWork.SuperUnitWork = UnitWork.SuperUnitWork; newUnitWork.IsChild = UnitWork.IsChild; @@ -50,6 +51,7 @@ namespace BLL { newUnitWork.UnitWorkId = UnitWork.UnitWorkId; newUnitWork.UnitWorkCode = UnitWork.UnitWorkCode; + newUnitWork.SerialNumber = UnitWork.SerialNumber; newUnitWork.UnitWorkName = UnitWork.UnitWorkName; newUnitWork.SuperUnitWork = UnitWork.SuperUnitWork; newUnitWork.IsChild = UnitWork.IsChild; diff --git a/SGGL/FineUIPro.Web/CLGL/AntiCorrosionTrust.aspx.cs b/SGGL/FineUIPro.Web/CLGL/AntiCorrosionTrust.aspx.cs index 53767878..314206f9 100644 --- a/SGGL/FineUIPro.Web/CLGL/AntiCorrosionTrust.aspx.cs +++ b/SGGL/FineUIPro.Web/CLGL/AntiCorrosionTrust.aspx.cs @@ -59,7 +59,7 @@ namespace FineUIPro.Web.CLGL where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null && (string.IsNullOrEmpty(keyword) || x.UnitWorkName.Contains(keyword) || x.UnitWorkCode.Contains(keyword)) - orderby x.UnitWorkCode + orderby x.SerialNumber, x.UnitWorkCode select x).ToList(); foreach (var q in unitWorkList.Where(x => x.ProjectType == "1")) diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.cs b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.cs index f7e5be7d..a422ec34 100644 --- a/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.cs +++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.cs @@ -178,7 +178,7 @@ namespace FineUIPro.Web.CLGL var unitWorkList = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null - orderby x.UnitWorkCode + orderby x.SerialNumber, x.UnitWorkCode select x).ToList(); List unitWork1 = null; diff --git a/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx.cs b/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx.cs index 0b84b22d..0cf2e824 100644 --- a/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx.cs +++ b/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx.cs @@ -156,7 +156,7 @@ namespace FineUIPro.Web.CLGL var unitWorkList = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null - orderby x.UnitWorkCode + orderby x.SerialNumber, x.UnitWorkCode select x).ToList(); List unitWork1 = null; diff --git a/SGGL/FineUIPro.Web/HJGL/DataImport/DrawingImport.aspx.cs b/SGGL/FineUIPro.Web/HJGL/DataImport/DrawingImport.aspx.cs index 2c24f5f5..99a5d723 100644 --- a/SGGL/FineUIPro.Web/HJGL/DataImport/DrawingImport.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/DataImport/DrawingImport.aspx.cs @@ -58,7 +58,7 @@ namespace FineUIPro.Web.HJGL.DataImport var unitWorkList = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null - orderby x.UnitWorkCode + orderby x.SerialNumber, x.UnitWorkCode select x).ToList(); List unitWork1 = null; diff --git a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs index 843c46c0..7f266874 100644 --- a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx.cs @@ -64,7 +64,7 @@ namespace FineUIPro.Web.HJGL.DataImport var unitWorkList = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null - orderby x.UnitWorkCode + orderby x.SerialNumber, x.UnitWorkCode select x).ToList(); List unitWork1 = null; diff --git a/SGGL/FineUIPro.Web/HJGL/DataImport/TDMImport.aspx.cs b/SGGL/FineUIPro.Web/HJGL/DataImport/TDMImport.aspx.cs index 47209574..ffe8ebab 100644 --- a/SGGL/FineUIPro.Web/HJGL/DataImport/TDMImport.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/DataImport/TDMImport.aspx.cs @@ -57,7 +57,7 @@ namespace FineUIPro.Web.HJGL.DataImport var unitWorkList = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null - orderby x.UnitWorkCode + orderby x.SerialNumber, x.UnitWorkCode select x).ToList(); List unitWork1 = null; diff --git a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardFeedback.aspx.cs b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardFeedback.aspx.cs index 6a9d72e9..e8c78749 100644 --- a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardFeedback.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardFeedback.aspx.cs @@ -72,7 +72,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard var unitWorkList = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null - orderby x.UnitWorkCode + orderby x.SerialNumber, x.UnitWorkCode select x).ToList(); List unitWork1 = null; diff --git a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReport.aspx.cs b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReport.aspx.cs index db5ca63d..48aa38d2 100644 --- a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReport.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardReport.aspx.cs @@ -73,7 +73,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard var unitWorkList = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null - orderby x.UnitWorkCode + orderby x.SerialNumber, x.UnitWorkCode select x).ToList(); List unitWork1 = null; diff --git a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardTrust.aspx.cs b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardTrust.aspx.cs index e2e5efd5..7f850325 100644 --- a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardTrust.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HardTrust.aspx.cs @@ -106,7 +106,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard var unitWorkList = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null - orderby x.UnitWorkCode + orderby x.SerialNumber, x.UnitWorkCode select x).ToList(); List unitWork1 = null; diff --git a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessFeedback.aspx.cs b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessFeedback.aspx.cs index 32d4d072..af7bb310 100644 --- a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessFeedback.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessFeedback.aspx.cs @@ -73,7 +73,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard var unitWorkList = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null - orderby x.UnitWorkCode + orderby x.SerialNumber, x.UnitWorkCode select x).ToList(); List unitWork1 = null; diff --git a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReport.aspx.cs b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReport.aspx.cs index ed3f370b..3b250edb 100644 --- a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReport.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessReport.aspx.cs @@ -100,7 +100,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard var unitWorkList = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null - orderby x.UnitWorkCode + orderby x.SerialNumber, x.UnitWorkCode select x).ToList(); List unitWork1 = null; diff --git a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessTrust.aspx.cs b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessTrust.aspx.cs index cb65760b..bfa45680 100644 --- a/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessTrust.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/HotProcessHard/HotProessTrust.aspx.cs @@ -108,7 +108,7 @@ namespace FineUIPro.Web.HJGL.HotProcessHard var unitWorkList = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null - orderby x.UnitWorkCode + orderby x.SerialNumber, x.UnitWorkCode select x).ToList(); List unitWork1 = null; diff --git a/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx.cs b/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx.cs index ba1ad65e..586a22b5 100644 --- a/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/InfoQuery/JointQuery.aspx.cs @@ -258,7 +258,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null - orderby x.UnitWorkCode + orderby x.SerialNumber, x.UnitWorkCode select x).ToList(); // 优化2: 批量获取所有相关管线数据,避免N+1查询问题 diff --git a/SGGL/FineUIPro.Web/HJGL/InfoQuery/MaterialOverview.aspx.cs b/SGGL/FineUIPro.Web/HJGL/InfoQuery/MaterialOverview.aspx.cs index 3c95a77d..32ce0857 100644 --- a/SGGL/FineUIPro.Web/HJGL/InfoQuery/MaterialOverview.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/InfoQuery/MaterialOverview.aspx.cs @@ -36,7 +36,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery select new { UnitWorkId = groupItem.Key, Count = groupItem.Count() }).ToDictionary(x => x.UnitWorkId, x => x.Count); var unitWorks = (from unitWork in Funs.DB.WBS_UnitWork where unitWork.ProjectId == projectId && unitWork.SuperUnitWork == null && unitWork.UnitId != null && unitWork.ProjectType != null - orderby unitWork.UnitWorkCode + orderby unitWork.SerialNumber, unitWork.UnitWorkCode select unitWork).ToList(); var unitIds = unitWorks.Where(x => x.UnitId != null).Select(x => x.UnitId).Distinct().ToList(); var unitNames = (from unit in Funs.DB.Base_Unit where unitIds.Contains(unit.UnitId) select unit).ToDictionary(x => x.UnitId, x => x.UnitName); diff --git a/SGGL/FineUIPro.Web/HJGL/InfoQuery/PipeLengthOverview.aspx.cs b/SGGL/FineUIPro.Web/HJGL/InfoQuery/PipeLengthOverview.aspx.cs index d9a6d9a2..8adb8527 100644 --- a/SGGL/FineUIPro.Web/HJGL/InfoQuery/PipeLengthOverview.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/InfoQuery/PipeLengthOverview.aspx.cs @@ -36,7 +36,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery select new { UnitWorkId = groupItem.Key, Count = groupItem.Count() }).ToDictionary(x => x.UnitWorkId, x => x.Count); var unitWorks = (from unitWork in Funs.DB.WBS_UnitWork where unitWork.ProjectId == projectId && unitWork.SuperUnitWork == null && unitWork.UnitId != null && unitWork.ProjectType != null - orderby unitWork.UnitWorkCode + orderby unitWork.SerialNumber, unitWork.UnitWorkCode select unitWork).ToList(); var unitIds = unitWorks.Where(x => x.UnitId != null).Select(x => x.UnitId).Distinct().ToList(); var unitNames = (from unit in Funs.DB.Base_Unit where unitIds.Contains(unit.UnitId) select unit).ToDictionary(x => x.UnitId, x => x.UnitName); diff --git a/SGGL/FineUIPro.Web/HJGL/InfoQuery/PipelineQuery.aspx.cs b/SGGL/FineUIPro.Web/HJGL/InfoQuery/PipelineQuery.aspx.cs index d58bbfc1..9a33bc2c 100644 --- a/SGGL/FineUIPro.Web/HJGL/InfoQuery/PipelineQuery.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/InfoQuery/PipelineQuery.aspx.cs @@ -75,7 +75,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery var unitWorkList = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null - orderby x.UnitWorkCode + orderby x.SerialNumber, x.UnitWorkCode select x).ToList(); List unitWork1 = null; diff --git a/SGGL/FineUIPro.Web/HJGL/LeakVacuum/LV_ItemEndCheck.aspx.cs b/SGGL/FineUIPro.Web/HJGL/LeakVacuum/LV_ItemEndCheck.aspx.cs index e33174a5..a7384681 100644 --- a/SGGL/FineUIPro.Web/HJGL/LeakVacuum/LV_ItemEndCheck.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/LeakVacuum/LV_ItemEndCheck.aspx.cs @@ -92,7 +92,7 @@ namespace FineUIPro.Web.HJGL.LeakVacuum var unitWorkList = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null - orderby x.UnitWorkCode + orderby x.SerialNumber, x.UnitWorkCode select x).ToList(); List LeakVacuumLists = (from x in Funs.DB.HJGL_LV_LeakVacuum where x.ProjectId == this.CurrUser.LoginProjectId && x.TableDate >= startTime && x.TableDate < endTime select x).ToList(); List unitWork1 = null; diff --git a/SGGL/FineUIPro.Web/HJGL/LeakVacuum/LeakVacuumAudit.aspx.cs b/SGGL/FineUIPro.Web/HJGL/LeakVacuum/LeakVacuumAudit.aspx.cs index 4e5cc052..14787d4b 100644 --- a/SGGL/FineUIPro.Web/HJGL/LeakVacuum/LeakVacuumAudit.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/LeakVacuum/LeakVacuumAudit.aspx.cs @@ -90,7 +90,7 @@ namespace FineUIPro.Web.HJGL.LeakVacuum var unitWorkList = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null - orderby x.UnitWorkCode + orderby x.SerialNumber, x.UnitWorkCode select x).ToList(); List LeakVacuumLists = (from x in Funs.DB.HJGL_LV_LeakVacuum where x.ProjectId == this.CurrUser.LoginProjectId && x.TableDate >= startTime && x.TableDate < endTime select x).ToList(); List unitWork1 = null; diff --git a/SGGL/FineUIPro.Web/HJGL/LeakVacuum/LeakVacuumComplete.aspx.cs b/SGGL/FineUIPro.Web/HJGL/LeakVacuum/LeakVacuumComplete.aspx.cs index b7d711ac..1d148eeb 100644 --- a/SGGL/FineUIPro.Web/HJGL/LeakVacuum/LeakVacuumComplete.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/LeakVacuum/LeakVacuumComplete.aspx.cs @@ -90,7 +90,7 @@ namespace FineUIPro.Web.HJGL.LeakVacuum var unitWorkList = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null - orderby x.UnitWorkCode + orderby x.SerialNumber, x.UnitWorkCode select x).ToList(); List LeakVacuumLists = (from x in Funs.DB.HJGL_LV_LeakVacuum where x.ProjectId == this.CurrUser.LoginProjectId && x.TableDate >= startTime && x.TableDate < endTime select x).ToList(); List unitWork1 = null; diff --git a/SGGL/FineUIPro.Web/HJGL/LeakVacuum/LeakVacuumEdit.aspx.cs b/SGGL/FineUIPro.Web/HJGL/LeakVacuum/LeakVacuumEdit.aspx.cs index 5db84dee..50df4c2f 100644 --- a/SGGL/FineUIPro.Web/HJGL/LeakVacuum/LeakVacuumEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/LeakVacuum/LeakVacuumEdit.aspx.cs @@ -74,7 +74,7 @@ namespace FineUIPro.Web.HJGL.LeakVacuum var unitWorkList = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null - orderby x.UnitWorkCode + orderby x.SerialNumber, x.UnitWorkCode select x).ToList(); List LeakVacuumLists = (from x in Funs.DB.HJGL_LV_LeakVacuum where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList(); List unitWork1 = null; diff --git a/SGGL/FineUIPro.Web/HJGL/NDT/NDTBatch.aspx.cs b/SGGL/FineUIPro.Web/HJGL/NDT/NDTBatch.aspx.cs index a0748452..49553d0b 100644 --- a/SGGL/FineUIPro.Web/HJGL/NDT/NDTBatch.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/NDT/NDTBatch.aspx.cs @@ -132,7 +132,7 @@ namespace FineUIPro.Web.HJGL.NDT var unitWorkList = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null - orderby x.UnitWorkCode + orderby x.SerialNumber, x.UnitWorkCode select x).ToList(); List unitWork1 = null; diff --git a/SGGL/FineUIPro.Web/HJGL/PointTrust/PointAudit.aspx.cs b/SGGL/FineUIPro.Web/HJGL/PointTrust/PointAudit.aspx.cs index be248680..76309912 100644 --- a/SGGL/FineUIPro.Web/HJGL/PointTrust/PointAudit.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/PointTrust/PointAudit.aspx.cs @@ -163,14 +163,10 @@ namespace FineUIPro.Web.HJGL.PointTrust { Model.HJGL_Batch_BatchTrust newBatchTrust = new Model.HJGL_Batch_BatchTrust(); var project = BLL.ProjectService.GetProjectByProjectId(batch.ProjectId); - var unit = BLL.UnitService.GetUnitByUnitId(batch.UnitId); var area = BLL.UnitWorkService.getUnitWorkByUnitWorkId(batch.UnitWorkId); var ndt = BLL.Base_DetectionTypeService.GetDetectionTypeByDetectionTypeId(batch.DetectionTypeId); - var rate = BLL.Base_DetectionRateService.GetDetectionRateByDetectionRateId(batch.DetectionRateId); - string perfix = string.Empty; - perfix = BLL.Batch_BatchTrustService.BuildTrustBatchCodePrefix(unit.UnitCode, ndt.DetectionTypeCode, rate.DetectionRateValue.ToString(), DateTime.Now); - newBatchTrust.TrustBatchCode = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.HJGL_Batch_BatchTrust", "TrustBatchCode", project.ProjectId, perfix); + newBatchTrust.TrustBatchCode = BLL.Batch_BatchTrustService.BuildTrustBatchCode(project.ProjectCode, area.UnitWorkCode, ndt.DetectionTypeCode, batch.PointBatchCode); string trustBatchId = SQLHelper.GetNewID(typeof(Model.HJGL_Batch_BatchTrust)); newBatchTrust.TrustBatchId = trustBatchId; diff --git a/SGGL/FineUIPro.Web/HJGL/PointTrust/PointBatch.aspx.cs b/SGGL/FineUIPro.Web/HJGL/PointTrust/PointBatch.aspx.cs index 9276e2a6..0e994a15 100644 --- a/SGGL/FineUIPro.Web/HJGL/PointTrust/PointBatch.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/PointTrust/PointBatch.aspx.cs @@ -75,7 +75,7 @@ namespace FineUIPro.Web.HJGL.PointTrust var unitWorkList = (from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null - orderby x.UnitWorkCode + orderby x.SerialNumber, x.UnitWorkCode select x).ToList(); List unitWork1 = null; @@ -1056,12 +1056,6 @@ namespace FineUIPro.Web.HJGL.PointTrust if (batch.EndDate.HasValue && detail.Where(d => d.NDT != null).Count() > 0) { var detectionTypes = from x in Funs.DB.Base_DetectionType select x; - var type1 = detectionTypes.FirstOrDefault(x => x.DetectionTypeId == batch.DetectionTypeId); - string typeStr1 = string.Empty; - if (type1 != null) - { - typeStr1 = type1.DetectionTypeCode; - } var trust = from x in Funs.DB.HJGL_Batch_BatchTrust where x.PointBatchId == batchId select x; if (trust.Count() == 0) { @@ -1076,19 +1070,14 @@ namespace FineUIPro.Web.HJGL.PointTrust { Model.HJGL_Batch_BatchTrust newBatchTrust = new Model.HJGL_Batch_BatchTrust(); var project = BLL.ProjectService.GetProjectByProjectId(batch.ProjectId); - var unit = BLL.UnitService.GetUnitByUnitId(batch.UnitId); var area = BLL.UnitWorkService.getUnitWorkByUnitWorkId(batch.UnitWorkId); - var ndt = BLL.Base_DetectionTypeService.GetDetectionTypeByDetectionTypeId(batch.DetectionTypeId); - var rate = BLL.Base_DetectionRateService.GetDetectionRateByDetectionRateId(batch.DetectionRateId); - - string perfix = string.Empty; var type2 = detectionTypes.FirstOrDefault(x => x.DetectionTypeId == n); string typeStr2 = string.Empty; if (type2 != null) { typeStr2 = type2.DetectionTypeCode; } - newBatchTrust.TrustBatchCode = BLL.Batch_BatchTrustService.BuildTrustBatchCode(batch.PointBatchCode, DateTime.Now, typeStr1, typeStr2); + newBatchTrust.TrustBatchCode = BLL.Batch_BatchTrustService.BuildTrustBatchCode(project.ProjectCode, area.UnitWorkCode, typeStr2, batch.PointBatchCode); string trustBatchId = SQLHelper.GetNewID(typeof(Model.HJGL_Batch_BatchTrust)); newBatchTrust.TrustBatchId = trustBatchId; diff --git a/SGGL/FineUIPro.Web/HJGL/PointTrust/PointTrust.aspx.cs b/SGGL/FineUIPro.Web/HJGL/PointTrust/PointTrust.aspx.cs index 3743308d..82105e9d 100644 --- a/SGGL/FineUIPro.Web/HJGL/PointTrust/PointTrust.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/PointTrust/PointTrust.aspx.cs @@ -51,11 +51,11 @@ namespace FineUIPro.Web.HJGL.PointTrust var batch = BLL.PointBatchService.GetPointBatchById(this.PointBatchId); if (batch != null) { + var project = BLL.ProjectService.GetProjectByProjectId(batch.ProjectId); var unit = BLL.UnitService.GetUnitByUnitId(batch.UnitId); var unitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(batch.UnitWorkId); var ndt = BLL.Base_DetectionTypeService.GetDetectionTypeByDetectionTypeId(batch.DetectionTypeId); - var rate = BLL.Base_DetectionRateService.GetDetectionRateByDetectionRateId(batch.DetectionRateId); - this.txtTrustBatchCode.Text = BLL.Batch_BatchTrustService.BuildTrustBatchCode(batch.PointBatchCode, DateTime.Now, string.Empty, string.Empty); + this.txtTrustBatchCode.Text = BLL.Batch_BatchTrustService.BuildTrustBatchCode(project.ProjectCode, unitWork.UnitWorkCode, ndt.DetectionTypeCode, batch.PointBatchCode); if (unit != null) { this.txtUnit.Text = unit.UnitName; diff --git a/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustBatch.aspx b/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustBatch.aspx index ca667f6d..415d1490 100644 --- a/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustBatch.aspx +++ b/SGGL/FineUIPro.Web/HJGL/PointTrust/TrustBatch.aspx @@ -88,7 +88,7 @@ - + + @@ -188,6 +190,29 @@ +