diff --git a/.vs/SGGL_SeDin_New.slnx/v18/.wsuo b/.vs/SGGL_SeDin_New.slnx/v18/.wsuo index 9f69490a..f2acacff 100644 Binary files a/.vs/SGGL_SeDin_New.slnx/v18/.wsuo and b/.vs/SGGL_SeDin_New.slnx/v18/.wsuo differ diff --git a/.vs/SGGL_SeDin_New.slnx/v18/DocumentLayout.backup.json b/.vs/SGGL_SeDin_New.slnx/v18/DocumentLayout.backup.json index 75ab69a7..7c674097 100644 --- a/.vs/SGGL_SeDin_New.slnx/v18/DocumentLayout.backup.json +++ b/.vs/SGGL_SeDin_New.slnx/v18/DocumentLayout.backup.json @@ -70,6 +70,22 @@ { "$type": "Bookmark", "Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}" + }, + { + "$type": "Bookmark", + "Name": "ST:130:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" + }, + { + "$type": "Bookmark", + "Name": "ST:132:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" + }, + { + "$type": "Bookmark", + "Name": "ST:129:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" + }, + { + "$type": "Bookmark", + "Name": "ST:131:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" } ] } diff --git a/.vs/SGGL_SeDin_New.slnx/v18/DocumentLayout.json b/.vs/SGGL_SeDin_New.slnx/v18/DocumentLayout.json index 7c674097..3a6bdf60 100644 --- a/.vs/SGGL_SeDin_New.slnx/v18/DocumentLayout.json +++ b/.vs/SGGL_SeDin_New.slnx/v18/DocumentLayout.json @@ -86,6 +86,14 @@ { "$type": "Bookmark", "Name": "ST:131:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" + }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}" + }, + { + "$type": "Bookmark", + "Name": "ST:128:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" } ] } diff --git a/DataBase/版本日志/SGGLDB_V2025-10-24-001-lpf.sql b/DataBase/版本日志/SGGLDB_V2025-10-24-001-lpf.sql new file mode 100644 index 00000000..5eb2580e --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2025-10-24-001-lpf.sql @@ -0,0 +1,136 @@ +drop view View_HJGL_InstallData +go +Create VIEW View_HJGL_InstallData + AS + WITH PackagingManage AS (SELECT p.PackagingManageId, + p.ProjectId, + p.PackagingCode, + p.TrainNumberId, + s.Value as SplitPipelineComponentId + FROM HJGL_PackagingManage p + CROSS APPLY dbo.SplitString(p.PipelineComponentId, ',', 1) s + WHERE p.PipelineComponentId IS NOT NULL + AND p.PipelineComponentId != '' -- Ìí¼Ó¿Õ×Ö·û´®¼ì²é + ), + TwOutPutData as (select distinct twRelation.PipelineId, + outdetail.Id as TwOutputDetailId, + twRelation.MaterialCode, + master.Id as OutputMasterId + from Tw_OutputMaster master + join Tw_OutputDetail outdetail on outdetail.OutputMasterId = master.Id + join Tw_InOutPlanMaster planmaster on planmaster.Id = master.InOutPlanMasterId + join Tw_InOutPlanDetail_Relation twRelation + on twRelation.InOutPlanMasterId = planmaster.Id and + outdetail.MaterialCode = twRelation.MaterialCode), + PrefabricatedData AS (SELECT pipe.PipeLineMatId as Id, + line.PipelineCode, + pipe.PrefabricatedComponents as Code, + 'Ô¤ÖÆ×é¼þ' as TypeStr, + '' as Matdef, + CAST(NULL AS DECIMAL(18, 2)) as Number, -- Ã÷È·Ö¸¶¨Êý¾ÝÀàÐÍ + pack.PackagingCode, + trainnumber.TrainNumber, + line.FlowingSection, + line.UnitWorkId, + line.ProjectId + FROM dbo.HJGL_PipeLineMat pipe + INNER JOIN dbo.HJGL_Pipeline line -- ¸ÄΪINNER JOIN£¬Èç¹û¹ÜµÀ±ØÐë´æÔÚ + ON pipe.PipelineId = line.PipelineId + LEFT JOIN dbo.HJGL_MaterialCodeLib lib + ON lib.MaterialCode = pipe.MaterialCode + LEFT JOIN HJGL_Pipeline_Component comonent + ON comonent.PipelineComponentCode = pipe.PrefabricatedComponents + LEFT JOIN PackagingManage pack + ON pack.SplitPipelineComponentId = comonent.PipelineComponentId + AND pack.ProjectId = line.ProjectId -- Ìí¼ÓÏîÄ¿¹ØÁªÌõ¼þ + LEFT JOIN HJGL_TrainNumberManage trainnumber + ON pack.TrainNumberId = trainnumber.Id + WHERE line.PipeArea = '1' + and (pipe.PrefabricatedComponents != '' + AND pipe.PrefabricatedComponents IS NOT NULL)), + LooseComponentsData AS (SELECT distinct pipe.PipeLineMatId as Id, + line.PipelineCode, + pipe.MaterialCode as Code, + 'Ô¤ÖÆÉ¢¼þ' as TypeStr, + lib.MaterialDef as Matdef, + cast( packdetail.Number as DECIMAL(18, 2)) as Number, + pack.PackagingCode, + trainnumber.TrainNumber, + line.FlowingSection, + line.UnitWorkId, + line.ProjectId + FROM dbo.HJGL_PipeLineMat pipe + INNER JOIN HJGL_Pipeline line -- ¸ÄΪINNER JOIN + ON pipe.PipelineId = line.PipelineId + LEFT JOIN dbo.HJGL_MaterialCodeLib lib + ON lib.MaterialCode = pipe.MaterialCode + LEFT JOIN HJGL_PackagingManageDetail packdetail + ON packdetail.MaterialCode = pipe.MaterialCode + LEFT JOIN TwOutPutData twOutPutData + ON twOutPutData.PipelineId = pipe.PipelineId and + twOutPutData.MaterialCode = packdetail.MaterialCode + LEFT JOIN HJGL_PackagingManage pack + ON packdetail.PackagingManageId = pack.PackagingManageId + AND pack.ProjectId = line.ProjectId -- Ìí¼ÓÏîÄ¿¹ØÁªÌõ¼þ + LEFT JOIN HJGL_TrainNumberManage trainnumber + ON pack.TrainNumberId = trainnumber.Id + where line.PipeArea = '1' + and (pipe.PrefabricatedComponents is null or pipe.PrefabricatedComponents = '')) + +-- ºÏ²¢½á¹û + SELECT * + FROM PrefabricatedData + UNION ALL + SELECT * + FROM LooseComponentsData + +go +alter table dbo.HJGL_PackagingManage + add CategoryInt int +go + +exec sp_addextendedproperty 'MS_Description', N'°ü×°Àà±ð', 'SCHEMA', 'dbo', 'TABLE', 'HJGL_PackagingManage', 'COLUMN', + 'CategoryInt' +go + +drop table Base_MaterialColor +CREATE TABLE [dbo].[Base_MaterialColor] +( + [MaterialColorId] nvarchar(50) NOT NULL DEFAULT (NEWID()) PRIMARY KEY, + [UnitId] nvarchar(50), + [MaterialId] nvarchar(50), + [ColorName] NVARCHAR(50), + [ColorCardNo] NVARCHAR(50), + [RGB] NVARCHAR(20), + [Remark] NVARCHAR(200) +); + +go +exec sp_addextendedproperty 'MS_Description', N'µ¥Î»id', 'SCHEMA', 'dbo', 'TABLE', 'Base_MaterialColor', 'COLUMN', + 'UnitId' +go + +exec sp_addextendedproperty 'MS_Description', N'²ÄÖÊid', 'SCHEMA', 'dbo', 'TABLE', 'Base_MaterialColor', 'COLUMN', + 'MaterialId' +go + + +exec sp_addextendedproperty 'MS_Description', N'ÑÕÉ«Ãû³Æ', 'SCHEMA', 'dbo', 'TABLE', 'Base_MaterialColor', 'COLUMN', + 'ColorName' +go + +exec sp_addextendedproperty 'MS_Description', N'É«¿¨ºÅ', 'SCHEMA', 'dbo', 'TABLE', 'Base_MaterialColor', 'COLUMN', + 'ColorCardNo' +go + +exec sp_addextendedproperty 'MS_Description', N'±¸×¢', 'SCHEMA', 'dbo', 'TABLE', 'Base_MaterialColor', 'COLUMN', + 'Remark' +go + +alter table dbo.HJGL_PackagingManageDetail + add TwOutputDetailId nvarchar(50) +go + +exec sp_addextendedproperty 'MS_Description', N'³ö¿âÃ÷ϸ±íÖ÷¼ü', 'SCHEMA', 'dbo', 'TABLE', 'HJGL_PackagingManageDetail', + 'COLUMN', 'TwOutputDetailId' +go