diff --git a/.vs/SGGL_SeDin_New/v17/.wsuo b/.vs/SGGL_SeDin_New/v17/.wsuo index 695dc7e4..96fcf830 100644 Binary files a/.vs/SGGL_SeDin_New/v17/.wsuo and b/.vs/SGGL_SeDin_New/v17/.wsuo differ diff --git a/.vs/SGGL_SeDin_New/v17/DocumentLayout.json b/.vs/SGGL_SeDin_New/v17/DocumentLayout.json new file mode 100644 index 00000000..38269f8f --- /dev/null +++ b/.vs/SGGL_SeDin_New/v17/DocumentLayout.json @@ -0,0 +1,79 @@ +{ + "Version": 1, + "WorkspaceRootPath": "D:\\\u6570\u636E\\\u8BFA\u5FC5\u8FBE\\\u8D5B\u9F0E\\SGGL_SeDin_New\\", + "Documents": [], + "DocumentGroupContainers": [ + { + "Orientation": 0, + "VerticalTabListWidth": 256, + "DocumentGroups": [ + { + "DockedWidth": 386, + "SelectedChildIndex": -1, + "Children": [ + { + "$type": "Bookmark", + "Name": "ST:0:0:{e506b91c-c606-466a-90a9-123d1d1e12b3}" + }, + { + "$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:133:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" + }, + { + "$type": "Bookmark", + "Name": "ST:134:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" + }, + { + "$type": "Bookmark", + "Name": "ST:1:0:{f2bd8fb8-fc94-3dae-a733-fd993c73cc87}" + }, + { + "$type": "Bookmark", + "Name": "ST:131:0:{1fc202d4-d401-403c-9834-5b218574bb67}" + }, + { + "$type": "Bookmark", + "Name": "ST:129:0:{13b12e3e-c1b4-4539-9371-4fe9a0d523fc}" + }, + { + "$type": "Bookmark", + "Name": "ST:2:0:{f2bd8fb8-fc94-3dae-a733-fd993c73cc87}" + }, + { + "$type": "Bookmark", + "Name": "ST:3:0:{f2bd8fb8-fc94-3dae-a733-fd993c73cc87}" + }, + { + "$type": "Bookmark", + "Name": "ST:128:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" + }, + { + "$type": "Bookmark", + "Name": "ST:129:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" + }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{1a46fd64-28d5-434c-8eb3-17a02d419b53}" + }, + { + "$type": "Bookmark", + "Name": "ST:131:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" + }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/DataBase/版本日志/SGGLDB_V2024-09-18.sql b/DataBase/版本日志/SGGLDB_V2024-09-18.sql new file mode 100644 index 00000000..75c7f447 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2024-09-18.sql @@ -0,0 +1,395 @@ +create table Tw_InOutPlanDetail +( + Id nvarchar(50) not null + constraint Tw_InOutPlanDetail_pk + primary key, + InOutPlanMasterId nvarchar(50), + PipelineComponentId nvarchar(50), + MaterialCode nvarchar(50), + PlanNum decimal(9, 2), + ActNum decimal(9, 2) +) +go + +exec sp_addextendedproperty 'MS_Description', N'ƻϸ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InOutPlanDetail' +go + +exec sp_addextendedproperty 'MS_Description', N'ƻϸid', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InOutPlanDetail', + 'COLUMN', 'Id' +go + +exec sp_addextendedproperty 'MS_Description', N'ƻid', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InOutPlanDetail', + 'COLUMN', 'InOutPlanMasterId' +go + +exec sp_addextendedproperty 'MS_Description', N'Ԥid', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InOutPlanDetail', + 'COLUMN', 'PipelineComponentId' +go + +exec sp_addextendedproperty 'MS_Description', N'ϱ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InOutPlanDetail', 'COLUMN', + 'MaterialCode' +go + +exec sp_addextendedproperty 'MS_Description', N'ƻ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InOutPlanDetail', 'COLUMN', + 'PlanNum' +go + +exec sp_addextendedproperty 'MS_Description', N'ʵ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InOutPlanDetail', 'COLUMN', + 'ActNum' +go + +create table Tw_InOutPlanMaster +( + Id nvarchar(50) not null + constraint Tw_InOutPlanMaster_pk + primary key, + ProjectId nvarchar(50), + CusBillCode nvarchar(50), + WarehouseCode nvarchar(50), + Source int, + InOutType int, + TypeInt int, + State int, + CreateMan nvarchar(50), + CreateDate datetime, + OutputMasterId nvarchar(50), + WeldTaskId nvarchar(200), + ReqUnitId nvarchar(50), + Category int +) +go + +exec sp_addextendedproperty 'MS_Description', N'ƻ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InOutPlanMaster' +go + +exec sp_addextendedproperty 'MS_Description', N'', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InOutPlanMaster', 'COLUMN', 'Id' +go + +exec sp_addextendedproperty 'MS_Description', N'Ŀ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InOutPlanMaster', 'COLUMN', + 'ProjectId' +go + +exec sp_addextendedproperty 'MS_Description', N'ƻ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InOutPlanMaster', 'COLUMN', + 'CusBillCode' +go + +exec sp_addextendedproperty 'MS_Description', N'ֿ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InOutPlanMaster', 'COLUMN', + 'WarehouseCode' +go + +exec sp_addextendedproperty 'MS_Description', N'1:;2ⵥ', 'SCHEMA', 'dbo', 'TABLE', + 'Tw_InOutPlanMaster', 'COLUMN', 'Source' +go + +exec sp_addextendedproperty 'MS_Description', N'ͣ1⣬2⣩', 'SCHEMA', 'dbo', 'TABLE', + 'Tw_InOutPlanMaster', 'COLUMN', 'InOutType' +go + +exec sp_addextendedproperty 'MS_Description', N'', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InOutPlanMaster', 'COLUMN', + 'TypeInt' +go + +exec sp_addextendedproperty 'MS_Description', N'״̬', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InOutPlanMaster', 'COLUMN', 'State' +go + +exec sp_addextendedproperty 'MS_Description', N'ⵥ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InOutPlanMaster', 'COLUMN', + 'OutputMasterId' +go + +exec sp_addextendedproperty 'MS_Description', N'', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InOutPlanMaster', + 'COLUMN', 'WeldTaskId' +go + +exec sp_addextendedproperty 'MS_Description', N'ϵλid', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InOutPlanMaster', 'COLUMN', + 'ReqUnitId' +go + +exec sp_addextendedproperty 'MS_Description', N'1 ܼ 2ܶ ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InOutPlanMaster', + 'COLUMN', 'Category' +go + +create table Tw_InputDetail +( + Id nvarchar(50) not null + constraint Tw_InputDetail_pk + primary key, + InputMasterId nvarchar(50), + PipelineComponentId nvarchar(50), + MaterialCode nvarchar(50), + PlanNum decimal(9, 2), + ActNum decimal(9, 2) +) +go + +exec sp_addextendedproperty 'MS_Description', N'ⵥϸ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InputDetail' +go + +exec sp_addextendedproperty 'MS_Description', N'ⵥϸid', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InputDetail', + 'COLUMN', 'Id' +go + +exec sp_addextendedproperty 'MS_Description', N'ⵥid', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InputDetail', 'COLUMN', + 'InputMasterId' +go + +exec sp_addextendedproperty 'MS_Description', N'Ԥid', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InputDetail', 'COLUMN', + 'PipelineComponentId' +go + +exec sp_addextendedproperty 'MS_Description', N'ϱid', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InputDetail', 'COLUMN', + 'MaterialCode' +go + +exec sp_addextendedproperty 'MS_Description', N'ƻ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InputDetail', 'COLUMN', + 'PlanNum' +go + +exec sp_addextendedproperty 'MS_Description', N'ʵ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InputDetail', 'COLUMN', + 'ActNum' +go + +create table Tw_InputMaster +( + Id nvarchar(50) not null + constraint Tw_InputMaster_pk + primary key, + ProjectId nvarchar(50), + InOutPlanMasterId nvarchar(50), + CusBillCode nvarchar(50), + WarehouseCode nvarchar(50), + Source int, + TypeInt int, + State int, + CreateMan nvarchar(50), + CreateDate datetime, + ReqUnitId nvarchar(50), + Category int +) +go + +exec sp_addextendedproperty 'MS_Description', N'ⵥ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InputMaster' +go + +exec sp_addextendedproperty 'MS_Description', N'', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InputMaster', 'COLUMN', 'Id' +go + +exec sp_addextendedproperty 'MS_Description', N'Ŀ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InputMaster', 'COLUMN', + 'ProjectId' +go + +exec sp_addextendedproperty 'MS_Description', N'ⵥ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InputMaster', 'COLUMN', + 'CusBillCode' +go + +exec sp_addextendedproperty 'MS_Description', N'ֿ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InputMaster', 'COLUMN', + 'WarehouseCode' +go + +exec sp_addextendedproperty 'MS_Description', N'1:;2', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InputMaster', + 'COLUMN', 'Source' +go + +exec sp_addextendedproperty 'MS_Description', N'', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InputMaster', 'COLUMN', 'TypeInt' +go + +exec sp_addextendedproperty 'MS_Description', N'״̬', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InputMaster', 'COLUMN', 'State' +go + +exec sp_addextendedproperty 'MS_Description', N'ϵλid', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InputMaster', 'COLUMN', + 'ReqUnitId' +go + +exec sp_addextendedproperty 'MS_Description', N'1 ܼ 2ܶ ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_InputMaster', + 'COLUMN', 'Category' +go + +create table Tw_MaterialStock +( + Id nvarchar(50) not null + constraint Tw_MaterialStock_pk + primary key, + WarehouseCode nvarchar(50), + PipeLineMatCode nvarchar(50), + StockNum decimal(9, 2), + ProjectId nvarchar(50) +) +go + +exec sp_addextendedproperty 'MS_Description', N'Ͽ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_MaterialStock' +go + +exec sp_addextendedproperty 'MS_Description', N'Ͽ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_MaterialStock', 'COLUMN', + 'Id' +go + +exec sp_addextendedproperty 'MS_Description', N'ֿ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_MaterialStock', 'COLUMN', + 'WarehouseCode' +go + +exec sp_addextendedproperty 'MS_Description', N'ϱ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_MaterialStock', 'COLUMN', + 'PipeLineMatCode' +go + +exec sp_addextendedproperty 'MS_Description', N'', 'SCHEMA', 'dbo', 'TABLE', 'Tw_MaterialStock', 'COLUMN', + 'StockNum' +go + +exec sp_addextendedproperty 'MS_Description', N'Ŀid', 'SCHEMA', 'dbo', 'TABLE', 'Tw_MaterialStock', 'COLUMN', + 'ProjectId' +go + +create table Tw_OutputDetail +( + Id nvarchar(50) not null + constraint Tw_OutputDetail_pk + primary key, + OutputMasterId nvarchar(50), + PipelineComponentId nvarchar(50), + MaterialCode nvarchar(50), + PlanNum decimal(9, 2), + ActNum decimal(9, 2) +) +go + +exec sp_addextendedproperty 'MS_Description', N'ⵥϸ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_OutputDetail' +go + +exec sp_addextendedproperty 'MS_Description', N'ⵥϸid', 'SCHEMA', 'dbo', 'TABLE', 'Tw_OutputDetail', + 'COLUMN', 'Id' +go + +exec sp_addextendedproperty 'MS_Description', N'ⵥid', 'SCHEMA', 'dbo', 'TABLE', 'Tw_OutputDetail', 'COLUMN', + 'OutputMasterId' +go + +exec sp_addextendedproperty 'MS_Description', N'Ԥid', 'SCHEMA', 'dbo', 'TABLE', 'Tw_OutputDetail', 'COLUMN', + 'PipelineComponentId' +go + +exec sp_addextendedproperty 'MS_Description', N'ϱ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_OutputDetail', 'COLUMN', + 'MaterialCode' +go + +exec sp_addextendedproperty 'MS_Description', N'ƻ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_OutputDetail', 'COLUMN', + 'PlanNum' +go + +exec sp_addextendedproperty 'MS_Description', N'ʵ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_OutputDetail', 'COLUMN', + 'ActNum' +go + +create table Tw_OutputMaster +( + Id nvarchar(50) not null + constraint Tw_OutputMaster_pk + primary key, + ProjectId nvarchar(50), + InOutPlanMasterId nvarchar(50), + CusBillCode nvarchar(50), + WarehouseCode nvarchar(50), + Source int, + TypeInt int, + State int, + CreateMan nvarchar(50), + CreateDate datetime, + ReqUnitId nvarchar(50), + Category int +) +go + +exec sp_addextendedproperty 'MS_Description', N'ⵥ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_OutputMaster' +go + +exec sp_addextendedproperty 'MS_Description', N'', 'SCHEMA', 'dbo', 'TABLE', 'Tw_OutputMaster', 'COLUMN', 'Id' +go + +exec sp_addextendedproperty 'MS_Description', N'Ŀ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_OutputMaster', 'COLUMN', + 'ProjectId' +go + +exec sp_addextendedproperty 'MS_Description', N'ⵥ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_OutputMaster', 'COLUMN', + 'CusBillCode' +go + +exec sp_addextendedproperty 'MS_Description', N'ֿ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_OutputMaster', 'COLUMN', + 'WarehouseCode' +go + +exec sp_addextendedproperty 'MS_Description', N'1:;2', 'SCHEMA', 'dbo', 'TABLE', 'Tw_OutputMaster', + 'COLUMN', 'Source' +go + +exec sp_addextendedproperty 'MS_Description', N'', 'SCHEMA', 'dbo', 'TABLE', 'Tw_OutputMaster', 'COLUMN', 'TypeInt' +go + +exec sp_addextendedproperty 'MS_Description', N'״̬', 'SCHEMA', 'dbo', 'TABLE', 'Tw_OutputMaster', 'COLUMN', 'State' +go + +exec sp_addextendedproperty 'MS_Description', N'ϵλid', 'SCHEMA', 'dbo', 'TABLE', 'Tw_OutputMaster', 'COLUMN', + 'ReqUnitId' +go + +exec sp_addextendedproperty 'MS_Description', N'1 ܼ 2ܶ ', 'SCHEMA', 'dbo', 'TABLE', 'Tw_OutputMaster', + 'COLUMN', 'Category' +go + + +INSERT INTO dbo.Sys_Menu (MenuId, MenuName, Icon, Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed) +VALUES (N'9B828E92-733B-4AF9-9DD0-55ECD8B64AB8', N'Ϲ', null, N'', 16, N'0', N'Menu_HJGL', 0, 0, 1); +go + INSERT INTO dbo.Sys_Menu (MenuId, MenuName, Icon, Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed) + VALUES (N'E29C1839-3530-45EC-A752-B26A0027E2CD', N'', null, N'', 20, N'9B828E92-733B-4AF9-9DD0-55ECD8B64AB8', N'Menu_HJGL', 0, 0, 1); + go + INSERT INTO dbo.Sys_Menu (MenuId, MenuName, Icon, Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed) + VALUES (N'324C72AF-447A-4308-AFB7-ABF788C58240', N'', null, N'CLGL/InPlanMaster.aspx', 10, N'E29C1839-3530-45EC-A752-B26A0027E2CD', N'Menu_HJGL', 0, 1, 1); + go + INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) VALUES (N'E752513A-55FA-4001-9126-C236905AA1FD', N'324C72AF-447A-4308-AFB7-ABF788C58240', N'', 1); + go + INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) VALUES (N'1EC8735B-0726-4340-9312-27C5A05BE4AD', N'324C72AF-447A-4308-AFB7-ABF788C58240', N'', 2); + go + INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) VALUES (N'63A38163-DCA0-4444-8A50-40507D48EB4A', N'324C72AF-447A-4308-AFB7-ABF788C58240', N'ɾ', 3); + go + INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) VALUES (N'8F3CD189-C233-40C0-A096-6CDB820A6CA8', N'324C72AF-447A-4308-AFB7-ABF788C58240', N'޸', 4); + go + INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) VALUES (N'F06E072B-73F5-473E-B03E-8DA392E68BAC', N'324C72AF-447A-4308-AFB7-ABF788C58240', N'', 4); + go + INSERT INTO dbo.Sys_Menu (MenuId, MenuName, Icon, Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed) + VALUES (N'4A55351A-2440-4A2D-8509-3FFEE5FC8861', N'ⵥ', null, N'CLGL/InputMaster.aspx', 20, N'E29C1839-3530-45EC-A752-B26A0027E2CD', N'Menu_HJGL', 0, 1, 1); + + go + INSERT INTO dbo.Sys_Menu (MenuId, MenuName, Icon, Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed) + VALUES (N'16A22282-4966-4946-B0F8-855E1300AE2B', N'', null, N'', 30, N'9B828E92-733B-4AF9-9DD0-55ECD8B64AB8', N'Menu_HJGL', 0, 0, 1); + go + INSERT INTO dbo.Sys_Menu (MenuId, MenuName, Icon, Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed) + VALUES (N'E910F410-07FB-41C3-AA80-8E30D1563BC1', N'', null, N'CLGL/OutPlanMaster.aspx', 10, N'16A22282-4966-4946-B0F8-855E1300AE2B', N'Menu_HJGL', 0, 1, 1); + go + INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) VALUES (N'3B78F59D-AB75-42DD-B07D-AC952672D317', N'E910F410-07FB-41C3-AA80-8E30D1563BC1', N'', 1); + go + INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) VALUES (N'4EC606B1-5315-4779-8B53-C51EF94127E9', N'E910F410-07FB-41C3-AA80-8E30D1563BC1', N'', 2); + go + INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) VALUES (N'E41A9D51-C215-49DE-B5B1-7415FF85D910', N'E910F410-07FB-41C3-AA80-8E30D1563BC1', N'ɾ', 3); + go + INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) VALUES (N'79344E58-A7F2-4583-A1CD-058E4C7DD882', N'E910F410-07FB-41C3-AA80-8E30D1563BC1', N'޸', 4); + go + INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex) VALUES (N'052CA576-108B-4FBC-966B-2B228509E570', N'E910F410-07FB-41C3-AA80-8E30D1563BC1', N'', 4); + go + INSERT INTO dbo.Sys_Menu (MenuId, MenuName, Icon, Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed) + VALUES (N'BCCA4D81-410C-4746-B1E4-F882BC3A25F4', N'ⵥ', null, N'CLGL/OutputMaster.aspx', 20, N'16A22282-4966-4946-B0F8-855E1300AE2B', N'Menu_HJGL', 0, 1, 1); + + go + INSERT INTO dbo.Sys_Menu (MenuId, MenuName, Icon, Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed) + VALUES (N'9579C717-769E-4CC0-9E54-EE03D87C15A5', N'', null, N'', 40, N'9B828E92-733B-4AF9-9DD0-55ECD8B64AB8', N'Menu_HJGL', 0, 0, 1); + go + INSERT INTO dbo.Sys_Menu (MenuId, MenuName, Icon, Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed) + VALUES (N'803F9828-52FA-4EF7-99C7-ADA99DADE9FB', N'', null, N'CLGL/MaterialStock.aspx', 10, N'9579C717-769E-4CC0-9E54-EE03D87C15A5', N'Menu_HJGL', 0, 1, 1); + go + INSERT INTO dbo.Sys_Menu (MenuId, MenuName, Icon, Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed) + VALUES (N'D15E534F-98F3-4B8A-8656-EAF165DE917F', N'̵', null, N'CLGL/MaterialStock.aspx', 20, N'9579C717-769E-4CC0-9E54-EE03D87C15A5', N'Menu_HJGL', 0, 1, 1); +go + INSERT INTO dbo.Sys_Menu (MenuId, MenuName, Icon, Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed) + VALUES (N'C05EF3BE-AB13-4852-B2AA-1095BE4EEB2F', N'', null, N'CLGL/ArrivalStatistics.aspx', 30, N'9579C717-769E-4CC0-9E54-EE03D87C15A5', N'Menu_HJGL', 0, 1, 1); + + go + /* INSERT INTO dbo.Sys_Menu (MenuId, MenuName, Icon, Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed) + VALUES (N'818B8FAE-6939-44F0-B911-14FD717AF03C', N'鵵', null, N'', 50, N'9B828E92-733B-4AF9-9DD0-55ECD8B64AB8', N'Menu_HJGL', 0, 0, 1); +*/ \ No newline at end of file diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index da781075..41fcbb4c 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -262,6 +262,15 @@ + + + + + + + + + diff --git a/SGGL/BLL/CLGL/TwArrivalStatisticsService.cs b/SGGL/BLL/CLGL/TwArrivalStatisticsService.cs new file mode 100644 index 00000000..8eacd96f --- /dev/null +++ b/SGGL/BLL/CLGL/TwArrivalStatisticsService.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + public class TwArrivalStatisticsService + { + public static IEnumerable GetStatistics(string projectid,string materialCode) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var NeedOutMateriaList = from x in db.HJGL_PipeLineMat + join y in db.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode + join z in db.HJGL_Pipeline on x.PipelineId equals z.PipelineId + where z.ProjectId == projectid && (string.IsNullOrEmpty(materialCode) || x.MaterialCode .Contains( materialCode)) + group x by x.MaterialCode + into g + select new + { + g.Key, + NeedNum = g.Sum(x => x.Number) ?? 0, + }; + + var RealInMateriaList = from x in db.Tw_InputDetail + join y in db.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode + group x by x.MaterialCode + into g + where (string.IsNullOrEmpty(materialCode) || g.Key.Contains( materialCode)) + select new + { + g.Key, + RealNum = g.Sum(x => x.ActNum) ?? 0, + }; + + var StatisticsList =from x in NeedOutMateriaList + join y in RealInMateriaList on x.Key equals y.Key into gg + from y in gg.DefaultIfEmpty() + join z in db.HJGL_MaterialCodeLib on x.Key equals z.MaterialCode into zz + from z in zz.DefaultIfEmpty() + select new + { + MaterialCode = x.Key, + NeedNum = x.NeedNum, + RealNum = y==null?0:y.RealNum, + MaterialName = z.MaterialName, + MaterialSpec=z.MaterialSpec, + MaterialUnit=z.MaterialUnit, + }; + return StatisticsList.ToList(); + } + } + } + +} diff --git a/SGGL/BLL/CLGL/TwConst.cs b/SGGL/BLL/CLGL/TwConst.cs new file mode 100644 index 00000000..4c4bd62a --- /dev/null +++ b/SGGL/BLL/CLGL/TwConst.cs @@ -0,0 +1,57 @@ +using System.Collections.Generic; + +namespace BLL; + +public class TwConst +{ + public enum InOutType : int + { + 入库 = 1, + 出库 = 2, + } + public enum TypeInt : int + { + 采购入库 = 10, + 退料入库 = 20, + 其他入库 = 30, + 领料出库 = 40, + 补料出库 = 50, + 其他出库 = 60, + } + public enum Category : int + { + 全部 = 0, + 管件 = 1, + 管段 = 2, + } + public enum State : int + { + 审核被拒 = -1, + 待提交 = 0, + 待审核 = 1, + 已审核 = 2, + 已完成 = 3, + } + public static Dictionary TypeIntMap = new Dictionary + { + { "采购入库" ,(int)TypeInt.采购入库}, + { "退料入库" ,(int)TypeInt.退料入库}, + { "其他入库" ,(int)TypeInt.其他入库}, + { "领料出库" ,(int)TypeInt.领料出库}, + { "补料出库" ,(int)TypeInt.补料出库}, + { "其他出库" ,(int)TypeInt.其他出库} + }; + public static Dictionary StateMap = new Dictionary + { + { "待提交" ,(int)State.待提交}, + { "待审核" ,(int)State.待审核}, + { "已审核" ,(int)State.已审核}, + { "已完成" ,(int)State.已完成}, + { "审核被拒" ,(int)State.审核被拒}, + }; + public static Dictionary CategoryMap = new Dictionary + { + { "管件" ,(int)Category.管件}, + { "管段" ,(int)Category.管段}, + }; +} \ No newline at end of file diff --git a/SGGL/BLL/CLGL/TwInOutplandetailService.cs b/SGGL/BLL/CLGL/TwInOutplandetailService.cs new file mode 100644 index 00000000..60c2338a --- /dev/null +++ b/SGGL/BLL/CLGL/TwInOutplandetailService.cs @@ -0,0 +1,151 @@ +using FineUIPro; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + +namespace BLL +{ + + public static class TwInOutplandetailService + { + + #region 获取列表 + /// + /// 记录数 + /// + public static int Count + { + get; + set; + } + public static IQueryable GetByModle(Model.Tw_InOutDetailOutput table) + { + var q = from x in Funs.DB.Tw_InOutPlanDetail + join y in Funs.DB.HJGL_Pipeline_Component on x.PipelineComponentId equals y.PipelineComponentId into yy + from y in yy.DefaultIfEmpty() + join mat in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals mat.MaterialCode into mm + from mat in mm.DefaultIfEmpty() + where + (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && + (string.IsNullOrEmpty(table.InOutPlanMasterId) || x.InOutPlanMasterId.Contains(table.InOutPlanMasterId)) && + (string.IsNullOrEmpty(table.PipelineComponentId) || x.PipelineComponentId.Contains(table.PipelineComponentId)) && + (string.IsNullOrEmpty(table.MaterialCode) || x.MaterialCode.Contains(table.MaterialCode)) + select new Model.Tw_InOutDetailOutput + { + Id = x.Id, + InOutPlanMasterId = x.InOutPlanMasterId, + PipelineComponentId = x.PipelineComponentId, + MaterialCode = x.MaterialCode, + PlanNum = x.PlanNum, + ActNum = x.ActNum, + PipelineComponentCode = y.PipelineComponentCode, + MaterialName = mat.MaterialName, + } + ; + + return q; + } + + /// + /// 获取分页列表 + /// + /// + /// + /// + public static IEnumerable GetListData(Model.Tw_InOutDetailOutput table, Grid grid1) + { + var q = GetByModle(table); + Count = q.Count(); + if (Count == 0) + { + return null; + } + q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return from x in q + select x; + } + #endregion + + public static Model.Tw_InOutPlanDetail GetById(string Id) + { + return Funs.DB.Tw_InOutPlanDetail.FirstOrDefault(x => x.Id == Id); + } + + + public static void Add(Model.Tw_InOutPlanDetail newtable) + { + if (string.IsNullOrEmpty(newtable.Id)) + { + newtable.Id = SQLHelper.GetNewID(); + } + Model.Tw_InOutPlanDetail table = new Model.Tw_InOutPlanDetail + { + Id = newtable.Id, + InOutPlanMasterId = newtable.InOutPlanMasterId, + PipelineComponentId = newtable.PipelineComponentId, + MaterialCode = newtable.MaterialCode, + PlanNum = newtable.PlanNum, + ActNum = newtable.ActNum, + }; + Funs.DB.Tw_InOutPlanDetail.InsertOnSubmit(table); + Funs.DB.SubmitChanges(); + } + + /// + /// 批量添加计划明细 + /// + /// + /// + public static void AddList(IEnumerable list, string inoutPlanMasterId) + { + foreach (var item in list) + { + item.Id= SQLHelper.GetNewID(); + item.InOutPlanMasterId = inoutPlanMasterId; + Add(item); + } + } + public static void Update(Model.Tw_InOutPlanDetail newtable) + { + + Model.Tw_InOutPlanDetail table = Funs.DB.Tw_InOutPlanDetail.FirstOrDefault(x => x.Id == newtable.Id); + if (table != null) + { + table.Id = newtable.Id; + table.InOutPlanMasterId = newtable.InOutPlanMasterId; + table.PipelineComponentId = newtable.PipelineComponentId; + table.MaterialCode = newtable.MaterialCode; + table.PlanNum = newtable.PlanNum; + table.ActNum = newtable.ActNum; + Funs.DB.SubmitChanges(); + } + + } + public static void DeleteById(string Id) + { + + Model.Tw_InOutPlanDetail table = Funs.DB.Tw_InOutPlanDetail.FirstOrDefault(x => x.Id == Id); + if (table != null) + { + Funs.DB.Tw_InOutPlanDetail.DeleteOnSubmit(table); + Funs.DB.SubmitChanges(); + } + + } + + public static void DeleteByInOutPlanMasterId (string inoutPlanMasterId) + { + var list = Funs.DB.Tw_InOutPlanDetail.Where(x => x.InOutPlanMasterId == inoutPlanMasterId); + if (list != null) + { + Funs.DB.Tw_InOutPlanDetail.DeleteAllOnSubmit(list); + Funs.DB.SubmitChanges(); + } + } + + } +} \ No newline at end of file diff --git a/SGGL/BLL/CLGL/TwInOutplanmasterService.cs b/SGGL/BLL/CLGL/TwInOutplanmasterService.cs new file mode 100644 index 00000000..bc5c6677 --- /dev/null +++ b/SGGL/BLL/CLGL/TwInOutplanmasterService.cs @@ -0,0 +1,477 @@ +using EmitMapper; +using FineUIPro; +using Microsoft.Office.Interop.Word; +using MiniExcelLibs; +using Model; +using NPOI.Util; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; +using System.Text; +using System.Web.UI.WebControls; + + +namespace BLL +{ + + public static class TwInOutplanmasterService + { + + #region 获取列表 + /// + /// 记录数 + /// + public static int Count + { + get; + set; + } + public static IQueryable GetModle(Model.Tw_InOutMasterOutput table) + { + var q = from x in Funs.DB.Tw_InOutPlanMaster + join y in Funs.DB.HJGL_WeldTask on x.WeldTaskId equals y.WeldTaskId into yy + from y in yy.DefaultIfEmpty() + join person in Funs.DB.Person_Persons on x.CreateMan equals person.PersonId into persons + from person in persons.DefaultIfEmpty() + join unit in Funs.DB.Base_Unit on x.ReqUnitId equals unit.UnitId into units + from unit in units.DefaultIfEmpty() + where + (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && + (string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) && + (string.IsNullOrEmpty(table.CusBillCode) || x.CusBillCode.Contains(table.CusBillCode)) && + (string.IsNullOrEmpty(table.WarehouseCode) || x.WarehouseCode.Contains(table.WarehouseCode)) && + (string.IsNullOrEmpty(table.CreateMan) || x.CreateMan.Contains(table.CreateMan)) && + (string.IsNullOrEmpty(table.OutputMasterId) || x.OutputMasterId.Contains(table.OutputMasterId)) && + (string.IsNullOrEmpty(table.ReqUnitId) || x.ReqUnitId.Contains(table.ReqUnitId)) && + (string.IsNullOrEmpty(table.UnitWorkId) || x.WeldTaskId.Contains(table.UnitWorkId))&& + (table.InOutType == null || x.InOutType == table.InOutType) && + (table.TypeInt == null || x.TypeInt == table.TypeInt) && + (table.Category == null || x.Category == table.Category) && + (table.State == null || x.State == table.State) + select new Model.Tw_InOutMasterOutput + { + Id = x.Id, + ProjectId = x.ProjectId, + CusBillCode = x.CusBillCode, + WarehouseCode = x.WarehouseCode, + Source = x.Source, + InOutType = x.InOutType, + TypeInt = x.TypeInt, + State = x.State, + Category = x.Category, + CreateMan = x.CreateMan, + CreateManName = person.PersonName, + CreateDate = x.CreateDate, + OutputMasterId = x.OutputMasterId, + WeldTaskId = x.WeldTaskId, + ReqUnitId = x.ReqUnitId, + ReqUnitName = unit.UnitName, + UnitWorkId = y.UnitWorkId, + WeldTaskCode = y.TaskCode + } + ; + + return q; + } + + /// + /// 获取分页列表 + /// + /// + /// + /// + public static IEnumerable GetListData(Model.Tw_InOutMasterOutput table, Grid grid1) + { + + var q = GetModle(table); + Count = q.Count(); + if (Count == 0) + { + return null; + } + var result = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize).ToList(); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return from x in result + select new Model.Tw_InOutMasterOutput + { + Id = x.Id, + ProjectId = x.ProjectId, + CusBillCode = x.CusBillCode, + WarehouseCode = x.WarehouseCode, + Source = x.Source, + InOutType = x.InOutType, + TypeInt = x.TypeInt, + Category = x.Category, + State = x.State, + CreateMan = x.CreateMan, + CreateManName = x.CreateManName, + CreateDate = x.CreateDate, + OutputMasterId = x.OutputMasterId, + WeldTaskId = x.WeldTaskId, + ReqUnitId = x.ReqUnitId, + ReqUnitName = x.ReqUnitName, + UnitWorkId = x.UnitWorkId, + WeldTaskCode= x.WeldTaskId!=null? x.WeldTaskId.Contains('|')? Funs.DB.HJGL_WeldTask.FirstOrDefault(e => e.UnitWorkId == x.WeldTaskId.Split('|')[0].ToString() && e.UnitId == x.WeldTaskId.Split('|')[1].ToString() && e.TaskDate.Value.Date == Convert.ToDateTime(x.WeldTaskId.Split('|')[2].ToString()).Date)?.TaskCode :"":"", + CategoryString = TwConst.CategoryMap.FirstOrDefault(y => y.Value == x.Category).Key, + TypeString = TwConst.TypeIntMap.FirstOrDefault(y => y.Value == x.TypeInt).Key, + StateString = TwConst.StateMap.FirstOrDefault(y => y.Value == x.State).Key + }; + } + + public static List GetListData(Model.Tw_InOutMasterOutput table) + { + + var q = GetModle(table); + Count = q.Count(); + if (Count == 0) + { + return null; + } + var result = q.ToList(); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return (from x in result + select new Model.Tw_InOutMasterOutput + { + Id = x.Id, + ProjectId = x.ProjectId, + CusBillCode = x.CusBillCode, + WarehouseCode = x.WarehouseCode, + Source = x.Source, + InOutType = x.InOutType, + TypeInt = x.TypeInt, + Category = x.Category, + State = x.State, + CreateMan = x.CreateMan, + CreateManName = x.CreateManName, + CreateDate = x.CreateDate, + OutputMasterId = x.OutputMasterId, + WeldTaskId = x.WeldTaskId, + ReqUnitId = x.ReqUnitId, + ReqUnitName = x.ReqUnitName, + UnitWorkId = x.UnitWorkId, + WeldTaskCode = x.WeldTaskId != null ? x.WeldTaskId.Contains('|') ? Funs.DB.HJGL_WeldTask.FirstOrDefault(e => e.UnitWorkId == x.WeldTaskId.Split('|')[0].ToString() && e.UnitId == x.WeldTaskId.Split('|')[1].ToString() && e.TaskDate.Value.Date == Convert.ToDateTime(x.WeldTaskId.Split('|')[2].ToString()).Date)?.TaskCode : "" : "", + CategoryString = TwConst.CategoryMap.FirstOrDefault(y => y.Value == x.Category).Key, + TypeString = TwConst.TypeIntMap.FirstOrDefault(y => y.Value == x.TypeInt).Key, + StateString = TwConst.StateMap.FirstOrDefault(y => y.Value == x.State).Key + }).ToList(); + } + + #endregion + + /// + /// 导入数据 + /// + /// + /// + /// + /// + public static ResponeData ImportData(string path, string projectid, string creatUserId) + { + var responeData = new ResponeData(); + List temeplateDtoIns; + try + { + temeplateDtoIns = MiniExcel.Query(path, startCell: "A1").ToList(); + } + catch (Exception ex) + { + responeData.code = 0; + responeData.message = "模板错误:" + ex.ToString(); + return responeData; + } + + #region 数据校验 + if (temeplateDtoIns.Count == 0) + { + responeData.code = 0; + responeData.message = "导入数据为空!"; + return responeData; + } + var queryAll = new Tw_InOutMasterOutput() + { + ProjectId = projectid + }; + var warehouseCodeList = temeplateDtoIns.Select(x => x.WarehouseCode).Distinct().ToList(); //获取导入文件的仓库编号 + string errorWarehouseCode = ""; + foreach (var item in warehouseCodeList) + { + if (!DropListService.HJGL_WarehouseCode().Select(x=>x.Value== item).Any()) + { + errorWarehouseCode+=item+","; + } + } + + if (!string.IsNullOrEmpty(errorWarehouseCode)) + { + if (temeplateDtoIns.Count == 0) + { + responeData.code = 0; + responeData.message = errorWarehouseCode+"仓库不存在!"; + return responeData; + } + } + var materialCodeList = temeplateDtoIns.Select(x => x.MaterialCode).Distinct().ToList(); //获取导入文件的材料编码 + var IsExitMaterialCode= + from x in Funs.DB.HJGL_MaterialCodeLib + where materialCodeList.Contains(x.MaterialCode) + select x.MaterialCode; + if (IsExitMaterialCode.Count() < materialCodeList.Count) + { + var errorMaterialCode = materialCodeList.Except(IsExitMaterialCode.ToList()); + if (errorMaterialCode.Count() > 0) + { + responeData.code = 0; + responeData.message = string.Join(",", errorMaterialCode) + "材料不存在!"; + return responeData; + } + } + + var queryAllresult = GetModle(queryAll).Select(x => x.CusBillCode).Distinct().ToList();//查询所有的编号 + var CusBillCodeList = temeplateDtoIns.Select(x => x.CusBillCode).Distinct().ToList(); //获取导入文件的编号 + var IsContain = CusBillCodeList.Intersect(queryAllresult).ToList(); //判断导入文件中是有已存在的编号 + if (IsContain.Count>0) + { + responeData.code = 0; + responeData.message = string.Join(",", IsContain)+ "编号已存在!"; + return responeData; + } + #endregion + //根据申请单编号分组插入数据 + foreach (var CusBillCode in CusBillCodeList) + { + var CusBillCodeDtoIns = temeplateDtoIns.Where(x => x.CusBillCode == CusBillCode).ToList(); + + var mapper = + ObjectMapperManager.DefaultInstance.GetMapper, List>(); + var mapperDetail = + ObjectMapperManager.DefaultInstance.GetMapper, List>(); + //通过映射实体赋值 + var twInOutPlanMaster = mapper.Map(CusBillCodeDtoIns).FirstOrDefault(); + var twInOutPlanDetails = mapperDetail.Map(CusBillCodeDtoIns.Where(x => !string.IsNullOrEmpty(x.MaterialCode) && !string.IsNullOrEmpty(x.PlanNum)).ToList()); + + twInOutPlanMaster.Id = SQLHelper.GetNewID(); + twInOutPlanMaster.InOutType= (int)TwConst.InOutType.入库; + twInOutPlanMaster.State = (int)TwConst.State.待审核; + twInOutPlanMaster.TypeInt= (int)TwConst.TypeInt.采购入库; + twInOutPlanMaster.Category= (int)TwConst.Category.全部; + twInOutPlanMaster.ProjectId = projectid; + twInOutPlanMaster.CreateMan = creatUserId; + twInOutPlanMaster.CreateDate = DateTime.Now; + Add(twInOutPlanMaster); + TwInOutplandetailService.AddList(twInOutPlanDetails, twInOutPlanMaster.Id); //插入入库明细 + + } + return responeData; + + } + + public static Model.Tw_InOutPlanMaster GetById(string Id) + { + return Funs.DB.Tw_InOutPlanMaster.FirstOrDefault(x => x.Id == Id); + } + public static void Add(Model.Tw_InOutPlanMaster newtable) + { + + Model.Tw_InOutPlanMaster table = new Model.Tw_InOutPlanMaster + { + Id = newtable.Id, + ProjectId = newtable.ProjectId, + CusBillCode = newtable.CusBillCode, + WarehouseCode = newtable.WarehouseCode, + Source = newtable.Source, + Category = newtable.Category, + InOutType = newtable.InOutType, + TypeInt = newtable.TypeInt, + State = newtable.State, + CreateMan = newtable.CreateMan, + CreateDate = newtable.CreateDate, + OutputMasterId = newtable.OutputMasterId, + WeldTaskId = newtable.WeldTaskId, + ReqUnitId = newtable.ReqUnitId, + }; + Funs.DB.Tw_InOutPlanMaster.InsertOnSubmit(table); + Funs.DB.SubmitChanges(); + } + public static void Update(Model.Tw_InOutPlanMaster newtable) + { + + Model.Tw_InOutPlanMaster table = Funs.DB.Tw_InOutPlanMaster.FirstOrDefault(x => x.Id == newtable.Id); + if (table != null) + { + table.Id = newtable.Id; + table.ProjectId = newtable.ProjectId; + table.CusBillCode = newtable.CusBillCode; + table.WarehouseCode = newtable.WarehouseCode; + table.Category = newtable.Category; + table.Source = newtable.Source; + table.InOutType = newtable.InOutType; + table.TypeInt = newtable.TypeInt; + table.State = newtable.State; + table.CreateMan = newtable.CreateMan; + table.CreateDate = newtable.CreateDate; + table.OutputMasterId = newtable.OutputMasterId; + table.WeldTaskId = newtable.WeldTaskId; + table.ReqUnitId = newtable.ReqUnitId; + Funs.DB.SubmitChanges(); + } + + } + public static void DeleteById(string Id) + { + + Model.Tw_InOutPlanMaster table = Funs.DB.Tw_InOutPlanMaster.FirstOrDefault(x => x.Id == Id); + if (table != null) + { + TwInOutplandetailService.DeleteByInOutPlanMasterId(table.Id); + + Funs.DB.Tw_InOutPlanMaster.DeleteOnSubmit(table); + Funs.DB.SubmitChanges(); + + } + + } + /// + /// 根据出库单生成计划单 + /// + /// + /// + /// + public static string GenPlanMasterByOutputMasterId(string outputMasterId,TwConst.TypeInt typeInt) + { + string message = ""; + + #region 数据校验 + + //获取出库单 + var outMasterQuery = new Tw_InOutMasterOutput(); + outMasterQuery.Id = outputMasterId; + var outMaster = TwOutputmasterService.GetListData(outMasterQuery) .FirstOrDefault() ; + if (outMaster == null || outMaster.State != (int)TwConst.State.已完成) + { + message = "出库单状态错误,无法生成计划单!"; + return message; + } + //判断是否已经生成过计划单 + var queryIsExitInMaster = new Tw_InOutMasterOutput(); + queryIsExitInMaster.OutputMasterId = outMaster.Id; + queryIsExitInMaster.TypeInt= (int)typeInt; + var IsExitInMaster = GetModle(queryIsExitInMaster).FirstOrDefault(); + if (IsExitInMaster != null) + { + message = "该出库单已生成过计划单"; + return message; + } + //明细校验 + Tw_InOutDetailOutput query = new Tw_InOutDetailOutput(); + query.OutputMasterId = outputMasterId; + var details = TwOutputdetailService.GetByModle(query).ToList(); + switch (typeInt) + { + case TwConst.TypeInt.补料出库: + details = details.Where(x => x.PlanNum > x.ActNum).ToList(); + foreach (var item in details) + { + item.PlanNum = (item.PlanNum - item.ActNum); + } + if (details.Count==0) + { + message = "该出库单无需补料"; + return message; + } + break; + case TwConst.TypeInt.退料入库: + details = details.Where(x => x.PlanNum < x.ActNum).ToList(); + foreach (var item in details) + { + item.PlanNum = (item.ActNum - item.PlanNum); + } + if (details.Count == 0) + { + message = "该出库单无需退料"; + return message; + } + break; + } + #endregion + //生成计划单 + var planMasterModel = new Model.Tw_InOutMasterOutput() + { + Id = Guid.NewGuid().ToString(), + OutputMasterId = outMaster.Id, + ProjectId = outMaster.ProjectId, + WarehouseCode = outMaster.WarehouseCode, + Source = 2, + Category = outMaster.Category, + TypeInt = outMaster.TypeInt, + State = (int)TwConst.State.待审核, + CreateMan = outMaster.CreateMan, + CreateDate = DateTime.Now, + ReqUnitId = outMaster.ReqUnitId, + WeldTaskId = GetById(outMaster.InOutPlanMasterId).WeldTaskId + + }; + switch (typeInt) + { + case TwConst.TypeInt.补料出库: + planMasterModel.CusBillCode = GetCusBillCodeByTaskCode(outMaster.WeldTaskCode,TwConst.TypeInt.补料出库,(BLL.TwConst.Category)planMasterModel.Category); + planMasterModel.TypeInt= (int)TwConst.TypeInt.补料出库; + planMasterModel.InOutType= (int)TwConst.InOutType.出库; + break; + case TwConst.TypeInt.退料入库: + planMasterModel.CusBillCode = GetCusBillCodeByTaskCode(outMaster.WeldTaskCode, TwConst.TypeInt.退料入库, (BLL.TwConst.Category)planMasterModel.Category); + planMasterModel.TypeInt = (int)TwConst.TypeInt.退料入库; + planMasterModel.InOutType = (int)TwConst.InOutType.入库; + ; + break; + } + Add(planMasterModel); + //生成明细 + TwInOutplandetailService.AddList(details, planMasterModel.Id); + return message; + } + + public static string GetCusBillCodeByTaskCode(string taskCode,TwConst.TypeInt typeInt,TwConst.Category category ) + { + string cusBillCode = ""; + switch (typeInt ) + { + case TwConst.TypeInt.领料出库: + if (category== TwConst.Category.管段) + { + cusBillCode = taskCode + "-AP-P01"; + } + else if (category == TwConst.Category.管件) + { + cusBillCode = taskCode + "-AP-PF01"; + } + + break; + case TwConst.TypeInt.补料出库: + if (category == TwConst.Category.管段) + { + cusBillCode = taskCode + "-GI-P01-AP01"; + } + else if (category == TwConst.Category.管件) + { + cusBillCode = taskCode + "-GI-PF01-AP01"; + } + + break; + case TwConst.TypeInt.退料入库: + if (category == TwConst.Category.管段) + { + cusBillCode = taskCode + "-GI-P01-RE01"; + } + else if (category == TwConst.Category.管件) + { + cusBillCode = taskCode + "-GI-PF01-RE01"; + } + + break; + } + return cusBillCode; + } + } +} \ No newline at end of file diff --git a/SGGL/BLL/CLGL/TwInputdetailService.cs b/SGGL/BLL/CLGL/TwInputdetailService.cs new file mode 100644 index 00000000..a9cfabd5 --- /dev/null +++ b/SGGL/BLL/CLGL/TwInputdetailService.cs @@ -0,0 +1,124 @@ +using FineUIPro; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + +namespace BLL +{ + + public static class TwInputdetailService + { + + + + #region 获取列表 + /// + /// 记录数 + /// + public static int Count + { + get; + set; + } + public static IQueryable GetByModle(Model.Tw_InOutDetailOutput table) + { + var q = from x in Funs.DB.Tw_InputDetail + join y in Funs.DB.HJGL_Pipeline_Component on x.PipelineComponentId equals y.PipelineComponentId into yy + from y in yy.DefaultIfEmpty() + join mat in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals mat.MaterialCode into mm + from mat in mm.DefaultIfEmpty() + where + (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && + (string.IsNullOrEmpty(table.InputMasterId) || x.InputMasterId.Contains(table.InputMasterId)) && + (string.IsNullOrEmpty(table.PipelineComponentId) || x.PipelineComponentId.Contains(table.PipelineComponentId)) && + (string.IsNullOrEmpty(table.MaterialCode) || x.MaterialCode.Contains(table.MaterialCode)) + select new Model.Tw_InOutDetailOutput + { + Id = x.Id, + InputMasterId = x.InputMasterId, + PipelineComponentId = x.PipelineComponentId, + MaterialCode = x.MaterialCode, + PlanNum = x.PlanNum, + ActNum = x.ActNum, + PipelineComponentCode = y.PipelineComponentCode, + MaterialName = mat.MaterialName, + } + ; + + return q; + } + + /// + /// 获取分页列表 + /// + /// + /// + /// + public static IEnumerable GetListData(Model.Tw_InOutDetailOutput table, Grid grid1) + { + var q = GetByModle(table); + Count = q.Count(); + if (Count == 0) + { + return null; + } + q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return from x in q + select x; + } + #endregion + + public static Model.Tw_InputDetail GetById(string Id) + { + return Funs.DB.Tw_InputDetail.FirstOrDefault(x => x.Id == Id); + } + public static void Add(Model.Tw_InputDetail newtable) + { + + Model.Tw_InputDetail table = new Model.Tw_InputDetail + { + Id = newtable.Id, + InputMasterId = newtable.InputMasterId, + PipelineComponentId = newtable.PipelineComponentId, + MaterialCode = newtable.MaterialCode, + PlanNum = newtable.PlanNum, + ActNum = newtable.ActNum, + }; + Funs.DB.Tw_InputDetail.InsertOnSubmit(table); + Funs.DB.SubmitChanges(); + } + + public static void Update(Model.Tw_InputDetail newtable) + { + + Model.Tw_InputDetail table = Funs.DB.Tw_InputDetail.FirstOrDefault(x => x.Id == newtable.Id); + if (table != null) + { + table.Id = newtable.Id; + table.InputMasterId = newtable.InputMasterId; + table.PipelineComponentId = newtable.PipelineComponentId; + table.MaterialCode = newtable.MaterialCode; + table.PlanNum = newtable.PlanNum; + table.ActNum = newtable.ActNum; + Funs.DB.SubmitChanges(); + } + + } + public static void DeleteById(string Id) + { + + Model.Tw_InputDetail table = Funs.DB.Tw_InputDetail.FirstOrDefault(x => x.Id == Id); + if (table != null) + { + Funs.DB.Tw_InputDetail.DeleteOnSubmit(table); + Funs.DB.SubmitChanges(); + } + + } + + } +} \ No newline at end of file diff --git a/SGGL/BLL/CLGL/TwInputmasterService.cs b/SGGL/BLL/CLGL/TwInputmasterService.cs new file mode 100644 index 00000000..3f199d99 --- /dev/null +++ b/SGGL/BLL/CLGL/TwInputmasterService.cs @@ -0,0 +1,319 @@ +using FineUIPro; +using Model; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + +namespace BLL +{ + + public static class TwInputmasterService + { + #region 获取列表 + /// + /// 记录数 + /// + public static int Count + { + get; + set; + } + public static IQueryable GetModle(Model.Tw_InOutMasterOutput table) + { + var q = from x in Funs.DB.Tw_InputMaster + join person in Funs.DB.Person_Persons on x.CreateMan equals person.PersonId into persons + from person in persons.DefaultIfEmpty() + join unit in Funs.DB.Base_Unit on x.ReqUnitId equals unit.UnitId into units + from unit in units.DefaultIfEmpty() + where + (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && + (string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) && + (string.IsNullOrEmpty(table.CusBillCode) || x.CusBillCode.Contains(table.CusBillCode)) && + (string.IsNullOrEmpty(table.WarehouseCode) || x.WarehouseCode.Contains(table.WarehouseCode)) && + (string.IsNullOrEmpty(table.CreateMan) || x.CreateMan.Contains(table.CreateMan)) && + (string.IsNullOrEmpty(table.ReqUnitId) || x.ReqUnitId.Contains(table.ReqUnitId)) && + (table.TypeInt == null || x.TypeInt == table.TypeInt) && + (table.Category == null || x.Category == table.Category) && + (table.State == null || x.State == table.State) + select new Model.Tw_InOutMasterOutput + { + Id = x.Id, + ProjectId = x.ProjectId, + CusBillCode = x.CusBillCode, + InOutPlanMasterId = x.InOutPlanMasterId, + WarehouseCode = x.WarehouseCode, + Source = x.Source, + Category = x.Category, + TypeInt = x.TypeInt, + State = x.State, + CreateMan = x.CreateMan, + CreateManName = person.PersonName, + CreateDate = x.CreateDate, + ReqUnitId = x.ReqUnitId, + ReqUnitName = unit.UnitName, + }; + + return q; + } + + /// + /// 获取分页列表 + /// + /// + /// + /// + public static IEnumerable GetListData(Model.Tw_InOutMasterOutput table, Grid grid1) + { + var q = GetModle(table); + Count = q.Count(); + if (Count == 0) + { + return null; + } + var result = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize).ToList(); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return from x in result + select new Model.Tw_InOutMasterOutput + { + Id = x.Id, + ProjectId = x.ProjectId, + CusBillCode = x.CusBillCode, + InOutPlanMasterId = x.InOutPlanMasterId, + WarehouseCode = x.WarehouseCode, + Source = x.Source, + TypeInt = x.TypeInt, + State = x.State, + CreateMan = x.CreateMan, + CreateManName = x.CreateManName, + CreateDate = x.CreateDate, + ReqUnitId = x.ReqUnitId, + ReqUnitName = x.ReqUnitName, + Category = x.Category, + CategoryString = TwConst.CategoryMap.FirstOrDefault(y => y.Value == x.Category).Key, + TypeString = TwConst.TypeIntMap.FirstOrDefault(y => y.Value == x.TypeInt).Key, + StateString = TwConst.StateMap.FirstOrDefault(y => y.Value == x.State).Key + }; + } + + public static List GetListData(Model.Tw_InOutMasterOutput table ) + { + var q = GetModle(table); + Count = q.Count(); + if (Count == 0) + { + return null; + } + var result = q.ToList(); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return (from x in result + select new Model.Tw_InOutMasterOutput + { + Id = x.Id, + ProjectId = x.ProjectId, + CusBillCode = x.CusBillCode, + InOutPlanMasterId = x.InOutPlanMasterId, + WarehouseCode = x.WarehouseCode, + Source = x.Source, + TypeInt = x.TypeInt, + State = x.State, + CreateMan = x.CreateMan, + CreateManName = x.CreateManName, + CreateDate = x.CreateDate, + ReqUnitId = x.ReqUnitId, + ReqUnitName = x.ReqUnitName, + Category = x.Category, + CategoryString = TwConst.CategoryMap.FirstOrDefault(y => y.Value == x.Category).Key, + TypeString = TwConst.TypeIntMap.FirstOrDefault(y => y.Value == x.TypeInt).Key, + StateString = TwConst.StateMap.FirstOrDefault(y => y.Value == x.State).Key + }).ToList(); + } + #endregion + + public static Model.Tw_InputMaster GetById(string Id) + { + return Funs.DB.Tw_InputMaster.FirstOrDefault(x => x.Id == Id); + } + + + public static void Add(Model.Tw_InputMaster newtable) + { + + Model.Tw_InputMaster table = new Model.Tw_InputMaster + { + Id = newtable.Id, + ProjectId = newtable.ProjectId, + InOutPlanMasterId = newtable.InOutPlanMasterId, + CusBillCode = newtable.CusBillCode, + WarehouseCode = newtable.WarehouseCode, + Category = newtable.Category, + Source = newtable.Source, + TypeInt = newtable.TypeInt, + State = newtable.State, + CreateMan = newtable.CreateMan, + CreateDate = newtable.CreateDate, + ReqUnitId = newtable.ReqUnitId, + }; + Funs.DB.Tw_InputMaster.InsertOnSubmit(table); + Funs.DB.SubmitChanges(); + } + + public static void Update(Model.Tw_InputMaster newtable) + { + + Model.Tw_InputMaster table = Funs.DB.Tw_InputMaster.FirstOrDefault(x => x.Id == newtable.Id); + if (table != null) + { + table.Id = newtable.Id; + table.ProjectId = newtable.ProjectId; + table.InOutPlanMasterId = newtable.InOutPlanMasterId; + table.CusBillCode = newtable.CusBillCode; + table.WarehouseCode = newtable.WarehouseCode; + table.Category = newtable.Category; + table.Source = newtable.Source; + table.TypeInt = newtable.TypeInt; + table.State = newtable.State; + table.CreateMan = newtable.CreateMan; + table.CreateDate = newtable.CreateDate; + table.ReqUnitId = newtable.ReqUnitId; + Funs.DB.SubmitChanges(); + } + + } + public static void DeleteById(string Id) + { + + Model.Tw_InputMaster table = Funs.DB.Tw_InputMaster.FirstOrDefault(x => x.Id == Id); + if (table != null) + { + Funs.DB.Tw_InputMaster.DeleteOnSubmit(table); + Funs.DB.SubmitChanges(); + } + + } + + /// + /// 根据计划单生成入库单 + /// + public static void GenInMasterByPlanId(string planId) + { + //获取计划单 + var planQueryModel = new Tw_InOutMasterOutput(); + planQueryModel.Id = planId; + var plan = TwInOutplanmasterService.GetListData(planQueryModel).FirstOrDefault(); + if (plan == null || plan.State!= (int)TwConst.State.已审核) + { + return; + } + //判断是否已经生成过入库单 + var queryIsExitInMaster = new Tw_InOutMasterOutput(); + queryIsExitInMaster.InOutPlanMasterId = planId; + queryIsExitInMaster.TypeInt = plan.TypeInt; + queryIsExitInMaster.Category = plan.Category; + var IsExitInMaster = GetModle(queryIsExitInMaster).FirstOrDefault(); + if (IsExitInMaster != null) + { + return; + } + //生成入库单 + var master = new Model.Tw_InputMaster() + { + Id = Guid.NewGuid().ToString(), + InOutPlanMasterId = plan.Id, + ProjectId = plan.ProjectId, + WarehouseCode = plan.WarehouseCode, + Source = plan.Source, + TypeInt = plan.TypeInt, + Category = plan.Category, + State = (int)TwConst.State.已完成, + CreateMan = plan.CreateMan, + CreateDate = DateTime.Now, + ReqUnitId = plan.ReqUnitId, + }; + if ((TwConst.TypeInt)plan.TypeInt!= TwConst.TypeInt.采购入库) + { + master.CusBillCode = GetCusBillCodeByTaskCode(plan.WeldTaskCode, (TwConst.TypeInt)plan.TypeInt, + (BLL.TwConst.Category)plan.Category); + + } + Add(master); + //生成明细 + Tw_InOutDetailOutput query = new Tw_InOutDetailOutput(); + query.InOutPlanMasterId= planId; + var details = TwInOutplandetailService.GetByModle(query).ToList(); + foreach (var detail in details) + { + var detailTable = new Model.Tw_InputDetail() + { + Id = Guid.NewGuid().ToString(), + InputMasterId = master.Id, + MaterialCode = detail.MaterialCode, + PlanNum = detail.PlanNum, + ActNum = detail.PlanNum, + }; + TwInputdetailService.Add(detailTable); + TwMaterialstockService.UpdateStockNum(master.ProjectId, detail.MaterialCode, master.WarehouseCode, TwConst.InOutType.入库, detailTable.ActNum); + + } + plan.State= (int)TwConst.State.已完成; + TwInOutplanmasterService.Update(plan); + } + /// + /// 根据计划单撤销入库单 + /// + /// + public static void RevokeGenInMasterByPlanId(string planId) + { + //校验计划单状态 + var plan = TwInOutplanmasterService.GetById(planId); + if (plan == null || plan.State != (int)TwConst.State.已完成) + { + return; + } + //获取入库单 + Tw_InOutMasterOutput query = new Tw_InOutMasterOutput(); + query.InOutPlanMasterId = planId; + var master = GetModle(query).FirstOrDefault(); + if (master == null) + { + return; + } + DeleteById(master.Id); //删除入库单 + //删除明细 + Tw_InOutDetailOutput queryDetail = new Tw_InOutDetailOutput(); + queryDetail.InputMasterId = master.Id; + var details = TwInputdetailService.GetByModle(queryDetail).ToList(); + foreach (var detail in details) + { + TwInputdetailService.DeleteById(detail.Id); + //撤销入库,即减去库存 + TwMaterialstockService.UpdateStockNum(master.ProjectId,detail.MaterialCode, master.WarehouseCode,TwConst.InOutType.出库, detail.ActNum); + } + plan.State = (int)TwConst.State.已审核; + TwInOutplanmasterService.Update(plan); + + } + public static string GetCusBillCodeByTaskCode(string taskCode, TwConst.TypeInt typeInt, TwConst.Category category) + { + string cusBillCode = ""; + switch (typeInt) + { + case TwConst.TypeInt.退料入库: + if (category == TwConst.Category.管段) + { + cusBillCode = taskCode + "-GI-P01-RE01"; + } + else if (category == TwConst.Category.管件) + { + cusBillCode = taskCode + "-GI-PF01-RE01"; + } + + break; + } + return cusBillCode; + } + + } +} \ No newline at end of file diff --git a/SGGL/BLL/CLGL/TwMaterialstockService.cs b/SGGL/BLL/CLGL/TwMaterialstockService.cs new file mode 100644 index 00000000..d0ac9799 --- /dev/null +++ b/SGGL/BLL/CLGL/TwMaterialstockService.cs @@ -0,0 +1,157 @@ +using FineUIPro; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + +namespace BLL +{ + + public static class TwMaterialstockService + { + + + + #region 获取列表 + /// + /// 记录数 + /// + public static int Count + { + get; + set; + } + public static IQueryable GetTw_MaterialStockByModle(Model.Tw_MaterialStockOutput table) + { + var q = from x in Funs.DB.Tw_MaterialStock + join mat in Funs.DB.HJGL_MaterialCodeLib on x.PipeLineMatCode equals mat.MaterialCode into mm + from mat in mm.DefaultIfEmpty() + where + (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && + (string.IsNullOrEmpty(table.WarehouseCode) || x.WarehouseCode.Contains(table.WarehouseCode)) && + (string.IsNullOrEmpty(table.PipeLineMatCode) || x.PipeLineMatCode.Contains(table.PipeLineMatCode)) && + (string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) + select new Model.Tw_MaterialStockOutput + { + Id = x.Id, + WarehouseCode = x.WarehouseCode, + PipeLineMatCode = x.PipeLineMatCode, + StockNum = x.StockNum, + ProjectId = x.ProjectId, + MaterialName = mat.MaterialName, + MaterialSpec = mat.MaterialSpec, + MaterialUnit = mat.MaterialUnit, + } + ; + + return q; + } + + /// + /// 获取分页列表 + /// + /// + /// + /// + public static IEnumerable GetListData(Model.Tw_MaterialStockOutput table, Grid grid1) + { + var q = GetTw_MaterialStockByModle(table); + Count = q.Count(); + if (Count == 0) + { + return null; + } + q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return from x in q + select x; + } + #endregion + + public static Model.Tw_MaterialStock GetTw_MaterialStockById(string Id) + { + return Funs.DB.Tw_MaterialStock.FirstOrDefault(x => x.Id == Id); + } + + public static void AddTw_MaterialStock(Model.Tw_MaterialStock newtable) + { + + Model.Tw_MaterialStock table = new Model.Tw_MaterialStock + { + Id = newtable.Id, + WarehouseCode = newtable.WarehouseCode, + PipeLineMatCode = newtable.PipeLineMatCode, + StockNum = newtable.StockNum, + ProjectId = newtable.ProjectId, + }; + Funs.DB.Tw_MaterialStock.InsertOnSubmit(table); + Funs.DB.SubmitChanges(); + } + + public static void UpdateTw_MaterialStock(Model.Tw_MaterialStock newtable) + { + + Model.Tw_MaterialStock table = Funs.DB.Tw_MaterialStock.FirstOrDefault(x => x.Id == newtable.Id); + if (table != null) + { + table.Id = newtable.Id; + table.WarehouseCode = newtable.WarehouseCode; + table.PipeLineMatCode = newtable.PipeLineMatCode; + table.StockNum = newtable.StockNum; + table.ProjectId = newtable.ProjectId; + Funs.DB.SubmitChanges(); + } + + } + public static void DeleteTw_MaterialStockById(string Id) + { + + Model.Tw_MaterialStock table = Funs.DB.Tw_MaterialStock.FirstOrDefault(x => x.Id == Id); + if (table != null) + { + Funs.DB.Tw_MaterialStock.DeleteOnSubmit(table); + Funs.DB.SubmitChanges(); + } + + } + + /// + /// 根据项目编码,材料编码,仓库编码,数量增减库存 + /// + /// + /// + /// + /// + /// + public static void UpdateStockNum(string ProjectId, string MaterialCode, string WarehouseCode,TwConst.InOutType inOutType , decimal? StockNum) + { + Model.Tw_MaterialStock table = Funs.DB.Tw_MaterialStock.FirstOrDefault(x => x.ProjectId == ProjectId && x.PipeLineMatCode == MaterialCode && x.WarehouseCode == WarehouseCode); + //如果是入库,则库存数量加上,如果是出库,则库存数量减去 + if (inOutType==TwConst.InOutType.出库) + { + StockNum=-StockNum;//出库,库存数量减去 + } + if (table != null) + { + table.StockNum = table.StockNum ?? 0; + table.StockNum += StockNum; + Funs.DB.SubmitChanges(); + } + else + { + Model.Tw_MaterialStock newtable = new Model.Tw_MaterialStock + { + Id = Guid.NewGuid().ToString(), + ProjectId = ProjectId, + PipeLineMatCode = MaterialCode, + WarehouseCode = WarehouseCode, + StockNum = StockNum??0, + }; + Funs.DB.Tw_MaterialStock.InsertOnSubmit(newtable); + Funs.DB.SubmitChanges(); + } + } + } +} \ No newline at end of file diff --git a/SGGL/BLL/CLGL/TwOutputdetailService..cs b/SGGL/BLL/CLGL/TwOutputdetailService..cs new file mode 100644 index 00000000..7918960b --- /dev/null +++ b/SGGL/BLL/CLGL/TwOutputdetailService..cs @@ -0,0 +1,125 @@ +using FineUIPro; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + +namespace BLL +{ + + public static class TwOutputdetailService + { + + #region 获取列表 + /// + /// 记录数 + /// + public static int Count + { + get; + set; + } + public static IQueryable GetByModle(Model.Tw_InOutDetailOutput table) + { + var q = from x in Funs.DB.Tw_OutputDetail + join y in Funs.DB.HJGL_Pipeline_Component on x.PipelineComponentId equals y.PipelineComponentId into yy + from y in yy.DefaultIfEmpty() + join mat in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals mat.MaterialCode into mm + from mat in mm.DefaultIfEmpty() + where + (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && + (string.IsNullOrEmpty(table.OutputMasterId) || x.OutputMasterId.Contains(table.OutputMasterId)) && + (string.IsNullOrEmpty(table.PipelineComponentId) || x.PipelineComponentId.Contains(table.PipelineComponentId)) && + (string.IsNullOrEmpty(table.MaterialCode) || x.MaterialCode.Contains(table.MaterialCode)) + select new Model.Tw_InOutDetailOutput + { + Id = x.Id, + OutputMasterId = x.OutputMasterId, + PipelineComponentId = x.PipelineComponentId, + MaterialCode = x.MaterialCode, + PlanNum = x.PlanNum, + ActNum = x.ActNum, + PipelineComponentCode = y.PipelineComponentCode, + MaterialName = mat.MaterialName, + } + ; + + return q; + } + + /// + /// 获取分页列表 + /// + /// + /// + /// + public static IEnumerable GetListData(Model.Tw_InOutDetailOutput table, Grid grid1) + { + var q = GetByModle(table); + Count = q.Count(); + if (Count == 0) + { + return null; + } + q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return from x in q + select x; + } + #endregion + + public static Model.Tw_OutputDetail GetById(string Id) + { + return Funs.DB.Tw_OutputDetail.FirstOrDefault(x => x.Id == Id); + } + + + public static void Add(Model.Tw_OutputDetail newtable) + { + + Model.Tw_OutputDetail table = new Model.Tw_OutputDetail + { + Id = newtable.Id, + OutputMasterId = newtable.OutputMasterId, + PipelineComponentId = newtable.PipelineComponentId, + MaterialCode = newtable.MaterialCode, + PlanNum = newtable.PlanNum, + ActNum = newtable.ActNum, + }; + Funs.DB.Tw_OutputDetail.InsertOnSubmit(table); + Funs.DB.SubmitChanges(); + } + + + public static void Update(Model.Tw_OutputDetail newtable) + { + + Model.Tw_OutputDetail table = Funs.DB.Tw_OutputDetail.FirstOrDefault(x => x.Id == newtable.Id); + if (table != null) + { + table.Id = newtable.Id; + table.OutputMasterId = newtable.OutputMasterId; + table.PipelineComponentId = newtable.PipelineComponentId; + table.MaterialCode = newtable.MaterialCode; + table.PlanNum = newtable.PlanNum; + table.ActNum = newtable.ActNum; + Funs.DB.SubmitChanges(); + } + + } + public static void DeleteById(string Id) + { + + Model.Tw_OutputDetail table = Funs.DB.Tw_OutputDetail.FirstOrDefault(x => x.Id == Id); + if (table != null) + { + Funs.DB.Tw_OutputDetail.DeleteOnSubmit(table); + Funs.DB.SubmitChanges(); + } + + } + + } +} \ No newline at end of file diff --git a/SGGL/BLL/CLGL/TwOutputmasterService.cs b/SGGL/BLL/CLGL/TwOutputmasterService.cs new file mode 100644 index 00000000..cc1edff1 --- /dev/null +++ b/SGGL/BLL/CLGL/TwOutputmasterService.cs @@ -0,0 +1,329 @@ +using FineUIPro; +using Model; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + +namespace BLL +{ + /// + /// 入库单逻辑层 + /// + public static class TwOutputmasterService + { + #region 获取列表 + /// + /// 记录数 + /// + public static int Count + { + get; + set; + } + public static IQueryable GetModle(Model.Tw_InOutMasterOutput table) + { + var q = from x in Funs.DB.Tw_OutputMaster + join y in Funs.DB.Tw_InOutPlanMaster on x.InOutPlanMasterId equals y.Id into yy + from y in yy.DefaultIfEmpty() + //join z in Funs.DB.HJGL_WeldTask on y.WeldTaskId equals z.WeldTaskId into zz + //from z in zz.DefaultIfEmpty() + join person in Funs.DB.Person_Persons on x.CreateMan equals person.PersonId into persons + from person in persons.DefaultIfEmpty() + join unit in Funs.DB.Base_Unit on x.ReqUnitId equals unit.UnitId into units + from unit in units.DefaultIfEmpty() + where + (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && + (string.IsNullOrEmpty(table.InOutPlanMasterId) || x.InOutPlanMasterId .Contains(table.InOutPlanMasterId)) && + (string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) && + (string.IsNullOrEmpty(table.CusBillCode) || x.CusBillCode.Contains(table.CusBillCode)) && + (string.IsNullOrEmpty(table.WarehouseCode) || x.WarehouseCode.Contains(table.WarehouseCode)) && + (string.IsNullOrEmpty(table.CreateMan) || x.CreateMan.Contains(table.CreateMan)) && + (string.IsNullOrEmpty(table.ReqUnitId) || x.ReqUnitId.Contains(table.ReqUnitId)) && + (string.IsNullOrEmpty(table.UnitWorkId) || y.WeldTaskId.Contains(table.UnitWorkId)) && + (table.TypeInt == null || x.TypeInt == table.TypeInt) && + (table.Category == null || x.Category == table.Category) && + (table.State == null || x.State == table.State) + select new Model.Tw_InOutMasterOutput + { + Id = x.Id, + ProjectId = x.ProjectId, + CusBillCode = x.CusBillCode, + InOutPlanMasterId = x.InOutPlanMasterId, + WarehouseCode = x.WarehouseCode, + Category = x.Category, + Source = x.Source, + TypeInt = x.TypeInt, + State = x.State, + CreateMan = x.CreateMan, + CreateManName = person.PersonName, + CreateDate = x.CreateDate, + ReqUnitId = x.ReqUnitId, + ReqUnitName = unit.UnitName, + WeldTaskId = y.WeldTaskId, + }; + + return q; + } + + /// + /// 获取分页列表 + /// + /// + /// + /// + public static IEnumerable GetListData(Model.Tw_InOutMasterOutput table, Grid grid1) + { + var q = GetModle(table); + Count = q.Count(); + if (Count == 0) + { + return null; + } + var result = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize).ToList(); + return from x in result + select new Model.Tw_InOutMasterOutput + { + Id = x.Id, + ProjectId = x.ProjectId, + CusBillCode = x.CusBillCode, + WarehouseCode = x.WarehouseCode, + InOutPlanMasterId = x.InOutPlanMasterId, + Source = x.Source, + TypeInt = x.TypeInt, + State = x.State, + Category= x.Category, + CreateMan = x.CreateMan, + CreateManName = x.CreateManName, + CreateDate = x.CreateDate, + ReqUnitId = x.ReqUnitId, + ReqUnitName = x.ReqUnitName, + TypeString = TwConst.TypeIntMap.FirstOrDefault(y => y.Value == x.TypeInt).Key, + StateString = TwConst.StateMap.FirstOrDefault(y => y.Value == x.State).Key, + CategoryString = TwConst.CategoryMap.FirstOrDefault(y => y.Value == x.Category).Key, + WeldTaskId = x.WeldTaskId, + WeldTaskCode = x.WeldTaskId != null ? x.WeldTaskId.Contains('|') ? Funs.DB.HJGL_WeldTask.FirstOrDefault(e => e.UnitWorkId == x.WeldTaskId.Split('|')[0].ToString() && e.UnitId == x.WeldTaskId.Split('|')[1].ToString() && e.TaskDate.Value.Date == Convert.ToDateTime(x.WeldTaskId.Split('|')[2].ToString()).Date)?.TaskCode : "" : "", + + }; + } + + public static List GetListData(Model.Tw_InOutMasterOutput table) + { + var q = GetModle(table); + Count = q.Count(); + if (Count == 0) + { + return null; + } + var result = q.ToList(); + return (from x in result + select new Model.Tw_InOutMasterOutput + { + Id = x.Id, + ProjectId = x.ProjectId, + CusBillCode = x.CusBillCode, + InOutPlanMasterId = x.InOutPlanMasterId, + WarehouseCode = x.WarehouseCode, + Source = x.Source, + TypeInt = x.TypeInt, + State = x.State, + Category = x.Category, + CreateMan = x.CreateMan, + CreateManName = x.CreateManName, + CreateDate = x.CreateDate, + ReqUnitId = x.ReqUnitId, + ReqUnitName = x.ReqUnitName, + TypeString = TwConst.TypeIntMap.FirstOrDefault(y => y.Value == x.TypeInt).Key, + StateString = TwConst.StateMap.FirstOrDefault(y => y.Value == x.State).Key, + CategoryString = TwConst.CategoryMap.FirstOrDefault(y => y.Value == x.Category).Key, + WeldTaskId = x.WeldTaskId, + WeldTaskCode = x.WeldTaskId != null ? x.WeldTaskId.Contains('|') ? Funs.DB.HJGL_WeldTask.FirstOrDefault(e => e.UnitWorkId == x.WeldTaskId.Split('|')[0].ToString() && e.UnitId == x.WeldTaskId.Split('|')[1].ToString() && e.TaskDate.Value.Date == Convert.ToDateTime(x.WeldTaskId.Split('|')[2].ToString()).Date)?.TaskCode : "" : "", + + }).ToList(); + } + + #endregion + + public static Model.Tw_OutputMaster GetTw_OutputMasterById(string Id) + { + return Funs.DB.Tw_OutputMaster.FirstOrDefault(x => x.Id == Id); + } + + public static void Add(Model.Tw_OutputMaster newtable) + { + + Model.Tw_OutputMaster table = new Model.Tw_OutputMaster + { + Id = newtable.Id, + ProjectId = newtable.ProjectId, + InOutPlanMasterId = newtable.InOutPlanMasterId, + CusBillCode = newtable.CusBillCode, + WarehouseCode = newtable.WarehouseCode, + Category = newtable.Category, + Source = newtable.Source, + TypeInt = newtable.TypeInt, + State = newtable.State, + CreateMan = newtable.CreateMan, + CreateDate = newtable.CreateDate, + ReqUnitId = newtable.ReqUnitId, + }; + Funs.DB.Tw_OutputMaster.InsertOnSubmit(table); + Funs.DB.SubmitChanges(); + } + + public static void Update(Model.Tw_OutputMaster newtable) + { + + Model.Tw_OutputMaster table = Funs.DB.Tw_OutputMaster.FirstOrDefault(x => x.Id == newtable.Id); + if (table != null) + { + table.Id = newtable.Id; + table.ProjectId = newtable.ProjectId; + table.InOutPlanMasterId = newtable.InOutPlanMasterId; + table.CusBillCode = newtable.CusBillCode; + table.WarehouseCode = newtable.WarehouseCode; + table.Category = newtable.Category; + table.Source = newtable.Source; + table.TypeInt = newtable.TypeInt; + table.State = newtable.State; + table.CreateMan = newtable.CreateMan; + table.CreateDate = newtable.CreateDate; + table.ReqUnitId = newtable.ReqUnitId; + Funs.DB.SubmitChanges(); + } + + } + public static void DeleteById(string Id) + { + + Model.Tw_OutputMaster table = Funs.DB.Tw_OutputMaster.FirstOrDefault(x => x.Id == Id); + if (table != null) + { + Funs.DB.Tw_OutputMaster.DeleteOnSubmit(table); + Funs.DB.SubmitChanges(); + } + + } + + /// + /// 根据计划单生成出库单 + /// + public static void GenOutMasterByPlanId(string planId, List detailLists) + { + //获取出库单 + var planQueryModel = new Tw_InOutMasterOutput(); + planQueryModel.Id = planId; + var plan = TwInOutplanmasterService.GetListData(planQueryModel).FirstOrDefault(); + if (plan == null || plan.State != (int)TwConst.State.已审核) + { + return; + } + //判断是否已经生成过出库单 + var queryIsExitInMaster = new Tw_InOutMasterOutput(); + queryIsExitInMaster.InOutPlanMasterId = planId; + queryIsExitInMaster.TypeInt= plan.TypeInt; + var IsExitInMaster = GetModle(queryIsExitInMaster).FirstOrDefault(); + if (IsExitInMaster != null) + { + return; + } + //生成出库单 + var master = new Model.Tw_OutputMaster() + { + Id = Guid.NewGuid().ToString(), + InOutPlanMasterId = plan.Id, + ProjectId = plan.ProjectId, + CusBillCode = GetCusBillCodeByTaskCode(plan.WeldTaskCode, (TwConst.TypeInt)plan.TypeInt, (BLL.TwConst.Category)plan.Category), + WarehouseCode = plan.WarehouseCode, + Category = plan.Category, + Source = plan.Source, + TypeInt = plan.TypeInt, + State = (int)TwConst.State.已完成, + CreateMan = plan.CreateMan, + CreateDate = DateTime.Now, + ReqUnitId = plan.ReqUnitId, + }; + Add(master); + //生成出库单明细 + foreach (var detail in detailLists) + { + var detailTable = new Model.Tw_OutputDetail() + { + Id = Guid.NewGuid().ToString(), + OutputMasterId = master.Id, + MaterialCode = detail.MaterialCode, + PlanNum = detail.PlanNum, + ActNum = detail.ActNum, + }; + TwOutputdetailService.Add(detailTable); + TwMaterialstockService.UpdateStockNum(master.ProjectId, detail.MaterialCode, master.WarehouseCode, TwConst.InOutType.出库, detailTable.ActNum); + + } + plan.State = (int)TwConst.State.已完成; + TwInOutplanmasterService.Update(plan); + } + /// + /// 根据计划单撤销出库单 + /// + /// + public static void RevokeGenOutMasterByPlanId(string planId) + { + Tw_InOutMasterOutput query = new Tw_InOutMasterOutput(); + query.InOutPlanMasterId = planId; + var master = GetModle(query).FirstOrDefault(); + if (master == null) + { + return; + } + DeleteById(master.Id); //删除出库单 + //删除明细 + Tw_InOutDetailOutput queryDetail = new Tw_InOutDetailOutput(); + queryDetail.OutputMasterId = master.Id; + var details = TwOutputdetailService.GetByModle(queryDetail).ToList(); + foreach (var detail in details) + { + TwOutputdetailService.DeleteById(detail.Id); + //撤销出库,即增加库存 + TwMaterialstockService.UpdateStockNum(master.ProjectId, detail.MaterialCode, master.WarehouseCode, TwConst.InOutType.入库, detail.ActNum); + } + + + } + + public static string GetCusBillCodeByTaskCode(string taskCode, TwConst.TypeInt typeInt, TwConst.Category category) + { + string cusBillCode = ""; + switch (typeInt) + { + case TwConst.TypeInt.领料出库: + if (category == TwConst.Category.管段) + { + cusBillCode = taskCode + "-GI-P01"; + } + else if (category == TwConst.Category.管件) + { + cusBillCode = taskCode + "-GI-PF01"; + } + + break; + case TwConst.TypeInt.补料出库: + if (category == TwConst.Category.管段) + { + cusBillCode = taskCode + "-GI-P01-SI01"; + } + else if (category == TwConst.Category.管件) + { + cusBillCode = taskCode + "-GI-PF01-SI01"; + } + + break; + + } + return cusBillCode; + } + + + } +} \ No newline at end of file diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index 05bfc034..5e60407f 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -4861,6 +4861,31 @@ namespace BLL #endregion #endregion + + #region 材料管理 + public const string Tw_InPlanMasteTemplateUrl = "File\\Excel\\DataIn\\材料入库导入模板.xlsx"; + /// + /// 入库申请 + /// + public const string Tw_InPlanMasterMenuId = "324C72AF-447A-4308-AFB7-ABF788C58240"; + /// + /// 入库单管理 + /// + public const string Tw_InputMasterMenuId = "4A55351A-2440-4A2D-8509-3FFEE5FC8861"; + /// + /// 出库申请 + /// + public const string Tw_OutPlanMasterMenuId = "E910F410-07FB-41C3-AA80-8E30D1563BC1"; + /// + /// 出库单管理 + /// + public const string Tw_OutputMasterMenuId = "BCCA4D81-410C-4746-B1E4-F882BC3A25F4"; + /// + /// 库存管理 + /// + public const string Tw_MaterialStockMenuId = "803F9828-52FA-4EF7-99C7-ADA99DADE9FB"; + #endregion + #region 合同附件Id /// /// 招标文件台账模板 diff --git a/SGGL/BLL/DropListService.cs b/SGGL/BLL/DropListService.cs index 7874419e..2717abb6 100644 --- a/SGGL/BLL/DropListService.cs +++ b/SGGL/BLL/DropListService.cs @@ -240,7 +240,13 @@ namespace BLL list[1] = new ListItem("预制", "预制"); return list; } - + public static ListItem[] HJGL_WarehouseCode() + { + ListItem[] list = new ListItem[2]; + list[0] = new ListItem("现场安装", "现场安装"); + list[1] = new ListItem("工厂预制", "工厂预制"); + return list; + } /// /// 机动化程度 /// diff --git a/SGGL/BLL/HJGL/WeldingManage/WeldTaskService.cs b/SGGL/BLL/HJGL/WeldingManage/WeldTaskService.cs index e3aa4165..2015b8dd 100644 --- a/SGGL/BLL/HJGL/WeldingManage/WeldTaskService.cs +++ b/SGGL/BLL/HJGL/WeldingManage/WeldTaskService.cs @@ -1,6 +1,9 @@ -using System; +using Model; +using System; using System.Collections.Generic; using System.Linq; +using System.Linq.Expressions; +using System.Numerics; namespace BLL { @@ -29,7 +32,7 @@ namespace BLL ///获取焊接任务单编号 /// /// - public static string GetTaskCodeByDate(string projectId, string date) + public static string GetTaskCodeByDate(string projectId, string date,string unitworkid,string unitid) { string code = string.Empty; var list = (from x in Funs.DB.HJGL_WeldTask where x.ProjectId == projectId && x.TaskDate == Convert.ToDateTime(date) orderby x.TaskCode descending select x.TaskCode).Distinct().ToList(); @@ -62,6 +65,7 @@ namespace BLL { code = date + "-001"; } + code = code.Replace("-", "") + "-" + UnitService.GetUnitCodeByUnitId(unitid) + "-" + UnitWorkService.getUnitWorkByUnitWorkId(unitworkid)?.UnitWorkCode; return code; } @@ -305,6 +309,113 @@ namespace BLL } } - + public static void GenOutPlanmasterByWeldTaskId(string unitworkid,string unitid,DateTime date,string Personid) + { + Model.SGGLDB db = Funs.DB; + Model.View_HJGL_WeldingTask weldTask = db.View_HJGL_WeldingTask.FirstOrDefault(e => e.UnitWorkId==unitworkid && e.UnitId==unitid&& e.TaskDate.Value.Date==date.Date); + if (weldTask==null) + { + return; + } + string WeldTaskId= unitworkid+"|"+unitid+ "|" + string.Format("{0:yyyyMMMMdd}", date); + //判断是否已经生成过出库计划单 + var queryIsExitInMaster = new Tw_InOutMasterOutput(); + queryIsExitInMaster.WeldTaskId = WeldTaskId; + queryIsExitInMaster.InOutType=(int)TwConst.InOutType.出库; + queryIsExitInMaster.TypeInt = (int)TwConst.TypeInt.领料出库; + var IsExitInMaster = TwInOutplanmasterService.GetModle(queryIsExitInMaster).FirstOrDefault(); + if (IsExitInMaster != null) + { + return; + } + var pipelineList = db.View_HJGL_WeldingTask.Where(e => e.UnitWorkId == unitworkid && e.UnitId == unitid && e.TaskDate.Value.Date == date.Date).Select(x=>x.PipelineId).Distinct().ToList(); + + //var outMateriaList = db.HJGL_PipeLineMat.Where(x => pipelineList.Contains(x.PipelineId)) + // .GroupBy(x => x.MaterialCode).Select(x => new + // { + // x.Key, + // planNum = x.Sum(y => y.Number)??0, + // }).ToList(); + var outMateriaList = from x in db.HJGL_PipeLineMat + join y in db.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode + where pipelineList.Contains(x.PipelineId) + group x by new { x.MaterialCode, y.MaterialUnit } + into g + select new + { + g.Key.MaterialCode, + planNum = g.Sum(x => x.Number) ?? 0, + MaterialName = g.Key.MaterialUnit, + }; + + var outPlanDetailListPiece = outMateriaList.Where(x => x.MaterialName.Contains("个"));//管件 + var outPlanDetailListOthere = outMateriaList.Where(x => x.MaterialName.Contains("米"));//管段 + var weldTaskCode = GetWeldTaskById(weldTask.WeldTaskId)?.TaskCode; + if (outPlanDetailListPiece.Any()) + { + Model.Tw_InOutPlanMaster table = new Model.Tw_InOutPlanMaster + { + Id = Guid.NewGuid().ToString(), + ProjectId = weldTask.ProjectId, + // CusBillCode = string.Format("{0:yyyyMMdd}", DateTime.Now) + UnitService.GetUnitCodeByUnitId(weldTask.UnitId) + "-" + UnitWorkService.getUnitWorkByUnitWorkId(weldTask.UnitWorkId)?.UnitWorkCode + "AP-PF01", + CusBillCode=TwInOutplanmasterService.GetCusBillCodeByTaskCode(weldTaskCode,TwConst.TypeInt.领料出库,TwConst.Category.管件), + WarehouseCode = PipelineService.GetPipeArea().Where(x => x.Value == PipelineService.GetPipelineByPipelineId(weldTask.PipelineId).PipeArea).Select(x => x.Text).FirstOrDefault(), + Source = 1, + InOutType = (int)TwConst.InOutType.出库, + TypeInt = (int)TwConst.TypeInt.领料出库, + State = (int)TwConst.State.待审核, + Category = (int)TwConst.Category.管件, + CreateMan = Personid, + CreateDate = DateTime.Now, + WeldTaskId = WeldTaskId, + ReqUnitId = weldTask.UnitId, + }; + TwInOutplanmasterService.Add(table); + foreach (var item in outPlanDetailListPiece) + { + Model.Tw_InOutPlanDetail detail = new Model.Tw_InOutPlanDetail + { + Id = Guid.NewGuid().ToString(), + InOutPlanMasterId = table.Id, + MaterialCode = item.MaterialCode, + PlanNum = item.planNum, + }; + TwInOutplandetailService.Add(detail); + } + } + if (outPlanDetailListOthere.Any()) + { + Model.Tw_InOutPlanMaster table = new Model.Tw_InOutPlanMaster + { + Id = Guid.NewGuid().ToString(), + ProjectId = weldTask.ProjectId, + CusBillCode =TwInOutplanmasterService.GetCusBillCodeByTaskCode(weldTaskCode, TwConst.TypeInt.领料出库, TwConst.Category.管段), + WarehouseCode = PipelineService.GetPipeArea().Where(x => x.Value == PipelineService.GetPipelineByPipelineId(weldTask.PipelineId).PipeArea).Select(x => x.Text).FirstOrDefault(), + Source = 1, + InOutType = (int)TwConst.InOutType.出库, + TypeInt = (int)TwConst.TypeInt.领料出库, + State = (int)TwConst.State.待审核, + Category = (int)TwConst.Category.管段, + CreateMan = Personid, + CreateDate = DateTime.Now, + WeldTaskId = WeldTaskId, + ReqUnitId = weldTask.UnitId, + }; + TwInOutplanmasterService.Add(table); + foreach (var item in outPlanDetailListOthere) + { + Model.Tw_InOutPlanDetail detail = new Model.Tw_InOutPlanDetail + { + Id = Guid.NewGuid().ToString(), + InOutPlanMasterId = table.Id, + MaterialCode = item.MaterialCode, + PlanNum = item.planNum, + }; + TwInOutplandetailService.Add(detail); + } + } + + + } } } diff --git a/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx new file mode 100644 index 00000000..89d31dcb --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx @@ -0,0 +1,125 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ArrivalStatistics.aspx.cs" Inherits="FineUIPro.Web.CLGL.ArrivalStatistics" %> + + + + + + + 到货统计分析 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + --%> + + + + + + + + + + + + + + + + + + <%-- + + + --%> + + + + + diff --git a/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.cs b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.cs new file mode 100644 index 00000000..05deb577 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.cs @@ -0,0 +1,159 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CLGL +{ + public partial class ArrivalStatistics : PageBase + { + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); + // 绑定表格 + this.BindGrid(); + } + } + + #region 绑定数据 + /// + /// 绑定数据 + /// + private void BindGrid() + { + var tb = BLL.TwArrivalStatisticsService.GetStatistics(this.CurrUser.LoginProjectId, txtMaterialCode.Text.Trim()); + //tb = GetFilteredTable(Grid1.FilteredData, tb); + Grid1.DataSource = tb; + Grid1.DataBind(); + } + #endregion + + #region GV 数据操作 + /// + /// 过滤表头 + /// + /// + /// + //protected void Grid1_FilterChange(object sender, EventArgs e) + //{ + // this.BindGrid(); + //} + + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + this.Grid1.PageIndex = e.NewPageIndex; + this.BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + this.Grid1.SortDirection = e.SortDirection; + this.Grid1.SortField = e.SortField; + this.BindGrid(); + } + + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue); + this.BindGrid(); + } + #endregion + + #region 关闭弹出窗 + /// + /// 关闭弹出窗 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + #endregion + + + + #region 导出按钮 + /// 导出按钮 + /// + /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + Response.ClearContent(); + string filename = Funs.GetNewFileName(); + Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("材料库存表" + filename, System.Text.Encoding.UTF8) + ".xls"); + Response.ContentType = "application/excel"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + this.Grid1.PageSize = 500; + this.BindGrid(); + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + + /// + /// 导出方法 + /// + /// + /// + private string GetGridTableHtml(Grid grid) + { + StringBuilder sb = new StringBuilder(); + sb.Append(""); + sb.Append(""); + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + sb.AppendFormat("", column.HeaderText); + } + sb.Append(""); + foreach (GridRow row in grid.Rows) + { + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + string html = row.Values[column.ColumnIndex].ToString(); + if (column.ColumnID == "tfNumber") + { + html = (row.FindControl("lblNumber") as System.Web.UI.WebControls.Label).Text; + } + sb.AppendFormat("", html); + } + + sb.Append(""); + } + + sb.Append("
{0}
{0}
"); + + return sb.ToString(); + } + #endregion + + protected void btnSearch_Click(object sender, EventArgs e) + { + BindGrid(); + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.designer.cs new file mode 100644 index 00000000..e8989120 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.designer.cs @@ -0,0 +1,143 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CLGL +{ + + + public partial class ArrivalStatistics + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// txtMaterialCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtMaterialCode; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSearch; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// lblNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblNumber; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + } +} diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx new file mode 100644 index 00000000..e34da2f2 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx @@ -0,0 +1,188 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InPlanMaster.aspx.cs" Inherits="FineUIPro.Web.CLGL.InPlanMaster" %> + + + + + + + + 出入库计划主表 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.cs b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.cs new file mode 100644 index 00000000..acbeab6c --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.cs @@ -0,0 +1,390 @@ +using BLL; +using FineUIPro.Web.HSSE.EduTrain; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CLGL +{ + public partial class InPlanMaster : PageBase + { + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.GetButtonPower(); + InitDrpList(); + // 绑定表格 + this.BindGrid(); + } + } + + #region 绑定数据 + private void InitDrpList() + { + this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); + drpWarehouse.DataTextField = "Text"; + drpWarehouse.DataValueField = "Value"; + drpWarehouse.DataSource = BLL.DropListService .HJGL_WarehouseCode(); + drpWarehouse.DataBind(); + Funs.FineUIPleaseSelect(this.drpWarehouse); + drpTypeInt.DataTextField = "Key"; + drpTypeInt.DataValueField = "Value"; + drpTypeInt.DataSource = BLL.TwConst.TypeIntMap.Where(x=>x.Key.Contains("入库")); + drpTypeInt.DataBind(); + Funs.FineUIPleaseSelect(this.drpTypeInt); + drpStates.DataTextField = "Key"; + drpStates.DataValueField = "Value"; + drpStates.DataSource = BLL.TwConst.StateMap; + drpStates.DataBind(); + Funs.FineUIPleaseSelect(this.drpStates); + + } + /// + /// 绑定数据 + /// + private void BindGrid() + { + Model.Tw_InOutMasterOutput table = new Model.Tw_InOutMasterOutput(); + table.ProjectId=this.CurrUser.LoginProjectId; + table.InOutType = (int?)TwConst.InOutType.入库; + if (drpTypeInt.SelectedValue != Const._Null) + { + table.TypeInt = Convert.ToInt32(drpTypeInt.SelectedValue); + } + if (drpStates.SelectedValue != Const._Null) + { + table.State = Convert.ToInt32(drpStates.SelectedValue); + } + if (drpWarehouse.SelectedValue != Const._Null) + { + table.WarehouseCode = drpWarehouse.SelectedValue; + } + var tb = BLL.TwInOutplanmasterService.GetListData(table, Grid1); + Grid1.RecordCount = TwInOutplanmasterService.Count; + Grid1.DataSource = tb; + Grid1.DataBind(); + + Grid2.DataSource=null; + Grid2.DataBind(); + } + private void BindDetailGrid(string inOutPlanMasterId) + { + Model.Tw_InOutDetailOutput table = new Model.Tw_InOutDetailOutput(); + table.InOutPlanMasterId = inOutPlanMasterId; + var tb = BLL.TwInOutplandetailService.GetListData(table, Grid2); + Grid2.DataSource = tb; + Grid2.DataBind(); + } + #endregion + + #region GV 数据操作 + /// + /// 过滤表头 + /// + /// + /// + //protected void Grid1_FilterChange(object sender, EventArgs e) + //{ + // this.BindGrid(); + //} + + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + this.Grid1.PageIndex = e.NewPageIndex; + this.BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + this.Grid1.SortDirection = e.SortDirection; + this.Grid1.SortField = e.SortField; + this.BindGrid(); + } + protected void Grid1_RowClick(object sender, GridRowClickEventArgs e) + { + if (e.RowIndex >= 0) + { + string ID = Grid1.DataKeys[e.RowIndex][0].ToString(); + BindDetailGrid(ID); + } + } + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue); + this.BindGrid(); + } + #endregion + + #region 数据编辑事件 + protected void btnSearch_Click(object sender, EventArgs e) + { + BindGrid(); + } + + + /// + /// 新增 + /// + /// + /// + protected void btnImport_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InPlanMasterDataIn.aspx?", "导入 - "))); + } + + /// + /// 编辑按钮 + /// + /// + /// + protected void btnEdit_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string ID = Grid1.SelectedRowID; + var model = BLL.TwInOutplanmasterService.GetById(ID); + if (model != null) ///已上报时不能删除 + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InPlanMasterEdit.aspx?Id={0}", ID, "编辑 - "))); + } + } + + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.btnEdit_Click(null, null); + } + + /// + /// 批量删除 + /// + /// + /// + protected void btnDelete_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var model = BLL.TwInOutplanmasterService.GetById(rowID); + if (model.State == (int)TwConst.State.已审核|| model.State == (int)TwConst.State.已完成) + { + Alert.ShowInTop("请选择有效的计划!", MessageBoxIcon.Warning); + return; + } + else + { + BLL.TwInOutplanmasterService.DeleteById(rowID); + BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + + + } + } + protected void btnPassMaster_OnClick(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string planId = Grid1.SelectedRowID; + var planMaster = BLL.TwInOutplanmasterService.GetById(planId); + if (planMaster.State != (int)TwConst.State.待审核) + { + Alert.ShowInTop("请选择有效的计划!", MessageBoxIcon.Warning); + return; + } + else + { + planMaster.State = (int)TwConst.State.已审核; + TwInOutplanmasterService.Update(planMaster); + ShowNotify("审核通过!", MessageBoxIcon.Success); + BindGrid(); + } + + } + protected void btnGenInMaster_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string planId = Grid1.SelectedRowID; + var planMaster = BLL.TwInOutplanmasterService.GetById(planId); + if ( planMaster.State != (int)TwConst.State.已审核) + { + Alert.ShowInTop("请选择有效的计划!", MessageBoxIcon.Warning); + return; + } + else + { + TwInputmasterService.GenInMasterByPlanId(planId); + BindGrid(); + ShowNotify("生成入库单成功!", MessageBoxIcon.Success); + } + + } + + protected void btnRevokeGenInMaster_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string planId = Grid1.SelectedRowID; + var planMaster = BLL.TwInOutplanmasterService.GetById(planId); + if (planMaster.State != (int)TwConst.State.已完成) + { + Alert.ShowInTop("请选择有效的计划!", MessageBoxIcon.Warning); + return; + } + else + { + TwInputmasterService.RevokeGenInMasterByPlanId(planId); + BindGrid(); + ShowNotify("撤销入库单成功!",MessageBoxIcon.Success); + } + + } + #endregion + + #region 关闭弹出窗 + /// + /// 关闭弹出窗 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + #endregion + + #region 获取权限按钮 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.Tw_InPlanMasterMenuId); + if (buttonList.Count > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnImport.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnMenuEdit.Hidden = false; + this.btnGenInMaster.Hidden = false; + this.btnRevokeGenInMaster.Hidden = false; + this.btnPassMaster.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuDelete.Hidden = false; + } + + if (buttonList.Contains(BLL.Const.BtnAuditing)) + { + this.btnPassMaster.Hidden = false; + } + } + } + #endregion + + #region 导出按钮 + /// 导出按钮 + /// + /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + Response.ClearContent(); + string filename = Funs.GetNewFileName(); + Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("出入库计划主表" + filename, System.Text.Encoding.UTF8) + ".xls"); + Response.ContentType = "application/excel"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + this.Grid1.PageSize = 500; + this.BindGrid(); + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + + /// + /// 导出方法 + /// + /// + /// + private string GetGridTableHtml(Grid grid) + { + StringBuilder sb = new StringBuilder(); + sb.Append(""); + sb.Append(""); + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + sb.AppendFormat("", column.HeaderText); + } + sb.Append(""); + foreach (GridRow row in grid.Rows) + { + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + string html = row.Values[column.ColumnIndex].ToString(); + if (column.ColumnID == "tfNumber") + { + html = (row.FindControl("lblNumber") as System.Web.UI.WebControls.Label).Text; + } + sb.AppendFormat("", html); + } + + sb.Append(""); + } + + sb.Append("
{0}
{0}
"); + + return sb.ToString(); + } + #endregion + + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.designer.cs new file mode 100644 index 00000000..5dabba52 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.designer.cs @@ -0,0 +1,269 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CLGL +{ + + + public partial class InPlanMaster + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Panel2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel2; + + /// + /// Panel4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel4; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// drpWarehouse 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpWarehouse; + + /// + /// drpTypeInt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpTypeInt; + + /// + /// drpStates 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpStates; + + /// + /// btnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSearch; + + /// + /// btnPassMaster 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnPassMaster; + + /// + /// btnGenInMaster 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnGenInMaster; + + /// + /// btnRevokeGenInMaster 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnRevokeGenInMaster; + + /// + /// btnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnImport; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// lblNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblNumber; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// panelBottomRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelBottomRegion; + + /// + /// Panel3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel3; + + /// + /// Grid2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid2; + + /// + /// Label1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label1; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + } +} diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMasterDataIn.aspx b/SGGL/FineUIPro.Web/CLGL/InPlanMasterDataIn.aspx new file mode 100644 index 00000000..fff90342 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMasterDataIn.aspx @@ -0,0 +1,35 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InPlanMasterDataIn.aspx.cs" Inherits="FineUIPro.Web.CLGL.InPlanMasterDataIn" %> + + + + + + + 导入 + + +
+ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMasterDataIn.aspx.cs b/SGGL/FineUIPro.Web/CLGL/InPlanMasterDataIn.aspx.cs new file mode 100644 index 00000000..f96d6564 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMasterDataIn.aspx.cs @@ -0,0 +1,146 @@ +using BLL; +using Model; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CLGL +{ + public partial class InPlanMasterDataIn : PageBase + { + #region 加载 + + + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + + } + } + + #endregion + + #region 导入 + + /// + /// 导入 + /// + /// + /// + protected void btnImport_Click(object sender, EventArgs e) + { + var message = string.Empty; + errorInfos = string.Empty; + if (fuAttachUrl.HasFile == false) + { + ShowNotify("请选择Excel文件!", MessageBoxIcon.Warning); + return; + } + + var IsXls = Path.GetExtension(fuAttachUrl.FileName).Trim().ToLower(); + if (IsXls != ".xlsx") + { + ShowNotify("只能选择Excel文件!", MessageBoxIcon.Warning); + return; + } + if (!string.IsNullOrEmpty(errorInfos)) errorInfos = string.Empty; + var rootPath = Server.MapPath("~/"); + var initFullPath = rootPath + initPath; + if (!Directory.Exists(initFullPath)) Directory.CreateDirectory(initFullPath); + //指定上传文件名称 + hdFileName.Text = Funs.GetNewFileName() + IsXls; + //上传文件路径 + var filePath = initFullPath + hdFileName.Text; + //文件上传服务器 + fuAttachUrl.PostedFile.SaveAs(filePath); + //文件上传服务器后的名称 + var fileName = rootPath + initPath + hdFileName.Text; + + ResponeData responeData; + responeData = TwInOutplanmasterService.ImportData(fileName, this.CurrUser.LoginProjectId, this.CurrUser.PersonId); + + + if (responeData.code == 1) + { + ShowNotify("数据导入成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + else + { + Alert alert = new Alert(); + alert.Message = responeData.message; + alert.MessageBoxIcon = MessageBoxIcon.Error; + alert.Show(); + } + } + + #endregion + + #region 定义项 + + /// + /// 上传预设的虚拟路径 + /// + private readonly string initPath = Const.ExcelUrl; //"File\\Excel\\DataIn\\"; + + /// + /// 错误集合 + /// + public static string errorInfos = string.Empty; + + #endregion + + #region 模板下载 + + /// + /// 模板下载 + /// + /// + /// + protected void btnDownLoad_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Confirm.GetShowReference("确定要下载模板吗?", string.Empty, + MessageBoxIcon.Question, PageManager1.GetCustomEventReference(false, "Confirm_OK"), + PageManager1.GetCustomEventReference("Confirm_Cancel"))); + } + + /// + /// 下载导入模板 + /// + /// + /// + protected void PageManager1_CustomEvent(object sender, CustomEventArgs e) + { + if (e.EventArgument == "Confirm_OK") + { + var rootPath = Server.MapPath("~/"); + var uploadfilepath = rootPath + Const.Tw_InPlanMasteTemplateUrl; + var filePath = Const.Tw_InPlanMasteTemplateUrl; + var fileName = Path.GetFileName(filePath); + var info = new FileInfo(uploadfilepath); + var fileSize = info.Length; + Response.ClearContent(); + Response.AddHeader("Content-Disposition", + "attachment;filename=" + HttpUtility.UrlEncode(fileName, Encoding.UTF8)); + Response.ContentType = "excel/plain"; + Response.ContentEncoding = Encoding.UTF8; + Response.AddHeader("Content-Length", fileSize.ToString().Trim()); + Response.TransmitFile(uploadfilepath, 0, fileSize); + Response.End(); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMasterDataIn.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/InPlanMasterDataIn.aspx.designer.cs new file mode 100644 index 00000000..336a62e3 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMasterDataIn.aspx.designer.cs @@ -0,0 +1,98 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CLGL +{ + + + public partial class InPlanMasterDataIn + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnImport; + + /// + /// btnDownLoad 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDownLoad; + + /// + /// fuAttachUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FileUpload fuAttachUrl; + + /// + /// hdFileName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdFileName; + } +} diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx b/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx new file mode 100644 index 00000000..63ff0925 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx @@ -0,0 +1,179 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InPlanMasterEdit.aspx.cs" Inherits="FineUIPro.Web.CLGL.InPlanMasterEdit" %> + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx.cs b/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx.cs new file mode 100644 index 00000000..06b25c7e --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CLGL +{ + public partial class InPlanMasterEdit : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx.designer.cs new file mode 100644 index 00000000..39eed8c9 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx.designer.cs @@ -0,0 +1,323 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CLGL +{ + + + public partial class InPlanMasterEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// Form2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form2; + + /// + /// TbCreate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar TbCreate; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnEditProcess 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnEditProcess; + + /// + /// TbApprove 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar TbApprove; + + /// + /// btnAgree 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAgree; + + /// + /// btnDisgree 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDisgree; + + /// + /// Panel4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel4; + + /// + /// txtProjectName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtProjectName; + + /// + /// txtContractNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtContractNum; + + /// + /// txtSellerName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtSellerName; + + /// + /// PanelOrderIn 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel PanelOrderIn; + + /// + /// txtOrderInDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtOrderInDate; + + /// + /// txtInvoiceDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtInvoiceDate; + + /// + /// txtOrderCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtOrderCode; + + /// + /// PanelOrderOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel PanelOrderOut; + + /// + /// txtOrderOutDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtOrderOutDate; + + /// + /// txtMaterialRequisitionUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtMaterialRequisitionUnit; + + /// + /// txtInvoiceNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtInvoiceNumber; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// lblPageIndex 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblPageIndex; + + /// + /// Label1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label1; + + /// + /// Label2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label2; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// txtSumUnitPrice 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtSumUnitPrice; + + /// + /// txtSumTax 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtSumTax; + + /// + /// txtSumAmount 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtSumAmount; + + /// + /// txtAmountInWords 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtAmountInWords; + + /// + /// Form_approve 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form_approve; + + /// + /// txtApproveIdea 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtApproveIdea; + + /// + /// Grid2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid2; + + /// + /// Label3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label3; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + } +} diff --git a/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx b/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx new file mode 100644 index 00000000..3e77af5f --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx @@ -0,0 +1,174 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InputMaster.aspx.cs" Inherits="FineUIPro.Web.CLGL.InputMaster" %> + + + + + + + + 入库单主表 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx.cs b/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx.cs new file mode 100644 index 00000000..60229a5c --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx.cs @@ -0,0 +1,285 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CLGL +{ + public partial class InputMaster : PageBase + { + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.GetButtonPower(); + InitDrpList(); + // 绑定表格 + this.BindGrid(); + } + } + + #region 绑定数据 + private void InitDrpList() + { + this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); + drpWarehouse.DataTextField = "Text"; + drpWarehouse.DataValueField = "Value"; + drpWarehouse.DataSource = BLL.DropListService.HJGL_WarehouseCode(); + drpWarehouse.DataBind(); + Funs.FineUIPleaseSelect(this.drpWarehouse); + drpTypeInt.DataTextField = "Key"; + drpTypeInt.DataValueField = "Value"; + drpTypeInt.DataSource = BLL.TwConst.TypeIntMap.Where(x => x.Key.Contains("入库")); + drpTypeInt.DataBind(); + Funs.FineUIPleaseSelect(this.drpTypeInt); + + } + /// + /// 绑定数据 + /// + private void BindGrid() + { + Model.Tw_InOutMasterOutput table = new Model.Tw_InOutMasterOutput(); + table.ProjectId = this.CurrUser.LoginProjectId; + if (drpTypeInt.SelectedValue != Const._Null) + { + table.TypeInt = Convert.ToInt32(drpTypeInt.SelectedValue); + } + if (drpWarehouse.SelectedValue != Const._Null) + { + table.WarehouseCode = drpWarehouse.SelectedValue; + } + var tb = BLL.TwInputmasterService.GetListData(table, Grid1); + Grid1.RecordCount = TwInputmasterService.Count; + Grid1.DataSource = tb; + Grid1.DataBind(); + + Grid2.DataSource = null; + Grid2.DataBind(); + } + private void BindDetailGrid(string inputMasterId) + { + Model.Tw_InOutDetailOutput table = new Model.Tw_InOutDetailOutput(); + table.InputMasterId = inputMasterId; + var tb = BLL.TwInputdetailService.GetListData(table, Grid2); + Grid2.DataSource = tb; + Grid2.DataBind(); + } + #endregion + + #region GV 数据操作 + /// + /// 过滤表头 + /// + /// + /// + //protected void Grid1_FilterChange(object sender, EventArgs e) + //{ + // this.BindGrid(); + //} + + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + this.Grid1.PageIndex = e.NewPageIndex; + this.BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + this.Grid1.SortDirection = e.SortDirection; + this.Grid1.SortField = e.SortField; + this.BindGrid(); + } + protected void Grid1_RowClick(object sender, GridRowClickEventArgs e) + { + if (e.RowIndex >= 0) + { + string ID = Grid1.DataKeys[e.RowIndex][0].ToString(); + BindDetailGrid(ID); + } + } + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue); + this.BindGrid(); + } + #endregion + + #region 数据编辑事件 + protected void btnSearch_Click(object sender, EventArgs e) + { + BindGrid(); + } + + /// + /// 编辑按钮 + /// + /// + /// + protected void btnEdit_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string ID = Grid1.SelectedRowID; + var model = BLL.TwInputmasterService.GetById(ID); + if (model != null) ///已上报时不能删除 + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InPlanMasterEdit.aspx?Id={0}", ID, "编辑 - "))); + } + } + + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.btnEdit_Click(null, null); + } + + /// + /// 批量删除 + /// + /// + /// + protected void btnDelete_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var model = BLL.TwInputmasterService.GetById(rowID); + if (model != null) + { + BLL.TwInputmasterService.DeleteById(rowID); + } + } + + BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + #endregion + + #region 关闭弹出窗 + /// + /// 关闭弹出窗 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + #endregion + + #region 获取权限按钮 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.Tw_InputMasterMenuId); + if (buttonList.Count > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnMenuEdit.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + //this.btnMenuDelete.Hidden = false; + } + } + } + #endregion + + #region 导出按钮 + /// 导出按钮 + /// + /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + Response.ClearContent(); + string filename = Funs.GetNewFileName(); + Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("出入库计划主表" + filename, System.Text.Encoding.UTF8) + ".xls"); + Response.ContentType = "application/excel"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + this.Grid1.PageSize = 500; + this.BindGrid(); + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + + /// + /// 导出方法 + /// + /// + /// + private string GetGridTableHtml(Grid grid) + { + StringBuilder sb = new StringBuilder(); + sb.Append(""); + sb.Append(""); + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + sb.AppendFormat("", column.HeaderText); + } + sb.Append(""); + foreach (GridRow row in grid.Rows) + { + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + string html = row.Values[column.ColumnIndex].ToString(); + if (column.ColumnID == "tfNumber") + { + html = (row.FindControl("lblNumber") as System.Web.UI.WebControls.Label).Text; + } + sb.AppendFormat("", html); + } + + sb.Append(""); + } + + sb.Append("
{0}
{0}
"); + + return sb.ToString(); + } + #endregion + + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx.designer.cs new file mode 100644 index 00000000..cfe36810 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx.designer.cs @@ -0,0 +1,224 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CLGL +{ + + + public partial class InputMaster + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Panel2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel2; + + /// + /// Panel4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel4; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// drpWarehouse 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpWarehouse; + + /// + /// drpTypeInt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpTypeInt; + + /// + /// btnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSearch; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// lblNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblNumber; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// panelBottomRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelBottomRegion; + + /// + /// Panel3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel3; + + /// + /// Grid2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid2; + + /// + /// Label1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label1; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + } +} diff --git a/SGGL/FineUIPro.Web/CLGL/InputMasterEdit.aspx b/SGGL/FineUIPro.Web/CLGL/InputMasterEdit.aspx new file mode 100644 index 00000000..1840c8db --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InputMasterEdit.aspx @@ -0,0 +1,16 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InputMasterEdit.aspx.cs" Inherits="FineUIPro.Web.CLGL.InputMasterEdit" %> + + + + + + + + + +
+
+
+
+ + diff --git a/SGGL/FineUIPro.Web/CLGL/InputMasterEdit.aspx.cs b/SGGL/FineUIPro.Web/CLGL/InputMasterEdit.aspx.cs new file mode 100644 index 00000000..bdc64846 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InputMasterEdit.aspx.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CLGL +{ + public partial class InputMasterEdit : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/InputMasterEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/InputMasterEdit.aspx.designer.cs new file mode 100644 index 00000000..4de47930 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InputMasterEdit.aspx.designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// 此代码是由工具生成的。 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CLGL +{ + + + public partial class InputMasterEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + } +} diff --git a/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx b/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx new file mode 100644 index 00000000..105a2c02 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx @@ -0,0 +1,122 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MaterialStock.aspx.cs" Inherits="FineUIPro.Web.CLGL.MaterialStock" %> + + + + + + + + 材料库存表 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<%-- + + --%> + + + + + + + + + + + + + + + + + +<%-- + + + --%> + + + + diff --git a/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx.cs b/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx.cs new file mode 100644 index 00000000..4f0467ce --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx.cs @@ -0,0 +1,223 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CLGL +{ + public partial class MaterialStock : PageBase + { + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); + // 绑定表格 + this.BindGrid(); + } + } + + #region 绑定数据 + /// + /// 绑定数据 + /// + private void BindGrid() + { + Model.Tw_MaterialStockOutput table = new Model.Tw_MaterialStockOutput(); + table.ProjectId = this.CurrUser.LoginProjectId; + var tb = BLL.TwMaterialstockService.GetListData(table, Grid1); + Grid1.RecordCount = TwMaterialstockService.Count; + //tb = GetFilteredTable(Grid1.FilteredData, tb); + Grid1.DataSource = tb; + Grid1.DataBind(); + } + #endregion + + #region GV 数据操作 + /// + /// 过滤表头 + /// + /// + /// + //protected void Grid1_FilterChange(object sender, EventArgs e) + //{ + // this.BindGrid(); + //} + + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + this.Grid1.PageIndex = e.NewPageIndex; + this.BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + this.Grid1.SortDirection = e.SortDirection; + this.Grid1.SortField = e.SortField; + this.BindGrid(); + } + + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue); + this.BindGrid(); + } + #endregion + + #region 数据编辑事件 + /// + /// 新增 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("Tw_MaterialStockEdit.aspx?Id={0}", string.Empty, "增加 - "))); + } + + /// + /// 编辑按钮 + /// + /// + /// + protected void btnEdit_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string ID = Grid1.SelectedRowID; + var model = BLL.TwMaterialstockService.GetTw_MaterialStockById(ID); + if (model != null) ///已上报时不能删除 + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("Tw_MaterialStockEdit.aspx?Id={0}", ID, "编辑 - "))); + } + } + + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.btnEdit_Click(null, null); + } + + /// + /// 批量删除 + /// + /// + /// + protected void btnDelete_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var model = BLL.TwMaterialstockService.GetTw_MaterialStockById(rowID); + if (model != null) + { + BLL.TwMaterialstockService.DeleteTw_MaterialStockById(rowID); + } + } + + BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + #endregion + + #region 关闭弹出窗 + /// + /// 关闭弹出窗 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + #endregion + + + + #region 导出按钮 + /// 导出按钮 + /// + /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + Response.ClearContent(); + string filename = Funs.GetNewFileName(); + Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("材料库存表" + filename, System.Text.Encoding.UTF8) + ".xls"); + Response.ContentType = "application/excel"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + this.Grid1.PageSize = 500; + this.BindGrid(); + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + + /// + /// 导出方法 + /// + /// + /// + private string GetGridTableHtml(Grid grid) + { + StringBuilder sb = new StringBuilder(); + sb.Append(""); + sb.Append(""); + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + sb.AppendFormat("", column.HeaderText); + } + sb.Append(""); + foreach (GridRow row in grid.Rows) + { + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + string html = row.Values[column.ColumnIndex].ToString(); + if (column.ColumnID == "tfNumber") + { + html = (row.FindControl("lblNumber") as System.Web.UI.WebControls.Label).Text; + } + sb.AppendFormat("", html); + } + + sb.Append(""); + } + + sb.Append("
{0}
{0}
"); + + return sb.ToString(); + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx.designer.cs new file mode 100644 index 00000000..5ff38c1d --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx.designer.cs @@ -0,0 +1,116 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CLGL +{ + + + public partial class MaterialStock + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// lblNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblNumber; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + } +} diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx new file mode 100644 index 00000000..c0b2e035 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx @@ -0,0 +1,206 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OutPlanMaster.aspx.cs" Inherits="FineUIPro.Web.CLGL.OutPlanMaster" %> + + + + + + 申请单 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%> + + + + + + + diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.cs b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.cs new file mode 100644 index 00000000..dc350b6b --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.cs @@ -0,0 +1,523 @@ +using Apache.NMS.ActiveMQ.Threads; +using BLL; +using FineUIPro.Web.HSSE.EduTrain; +using FineUIPro.Web.ProjectData; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using System.Web; + +namespace FineUIPro.Web.CLGL +{ + public partial class OutPlanMaster : PageBase + { + public int pageSize = PipelineService.pageSize; + + protected void Page_Load(object sender, EventArgs e) + { + + if (!IsPostBack) + { + this.GetButtonPower(); + InitDrpList(); + this.InitTreeMenu(); + + } + } + + + private void InitDrpList() + { + drpWarehouse.DataTextField = "Text"; + drpWarehouse.DataValueField = "Value"; + drpWarehouse.DataSource = BLL.DropListService.HJGL_WarehouseCode(); + drpWarehouse.DataBind(); + Funs.FineUIPleaseSelect(this.drpWarehouse); + drpTypeInt.DataTextField = "Key"; + drpTypeInt.DataValueField = "Value"; + drpTypeInt.DataSource = BLL.TwConst.TypeIntMap.Where(x => x.Key.Contains("出库")); ; + drpTypeInt.DataBind(); + Funs.FineUIPleaseSelect(this.drpTypeInt); + drpStates.DataTextField = "Key"; + drpStates.DataValueField = "Value"; + drpStates.DataSource = BLL.TwConst.StateMap; + drpStates.DataBind(); + Funs.FineUIPleaseSelect(this.drpStates); + + } + #region 数据绑定 + /// + /// 管线数据 + /// + private void BindGrid() + { + Model.Tw_InOutMasterOutput table = new Model.Tw_InOutMasterOutput(); + table.ProjectId = this.CurrUser.LoginProjectId; + table.InOutType = (int?)TwConst.InOutType.出库; + if (drpTypeInt.SelectedValue != Const._Null) + { + table.TypeInt = Convert.ToInt32(drpTypeInt.SelectedValue); + } + if (drpStates.SelectedValue != Const._Null) + { + table.State = Convert.ToInt32(drpStates.SelectedValue); + } + if (drpWarehouse.SelectedValue != Const._Null) + { + table.WarehouseCode = drpWarehouse.SelectedValue; + } + if (!string.IsNullOrEmpty(tvControlItem.SelectedNodeID)) + { + table.UnitWorkId = tvControlItem.SelectedNodeID; + } + var tb = BLL.TwInOutplanmasterService.GetListData(table, Grid1); + Grid1.RecordCount = TwInOutplanmasterService.Count; + Grid1.DataSource = tb; + Grid1.DataBind(); + + Grid2.DataSource = null; + Grid2.DataBind(); + } + + private void BindDetailGrid(string inOutPlanMasterId) + { + Model.Tw_InOutDetailOutput table = new Model.Tw_InOutDetailOutput(); + table.InOutPlanMasterId = inOutPlanMasterId; + var tb = BLL.TwInOutplandetailService.GetListData(table, Grid2); + Grid2.DataSource = tb; + Grid2.DataBind(); + } + #endregion + + #region 排序 + + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + BindGrid(); + } + + #endregion + + #region 加载树装置-单位-工作区 + + /// + /// 加载树 + /// + private void InitTreeMenu() + { + this.tvControlItem.Nodes.Clear(); + + TreeNode rootNode1 = new TreeNode(); + rootNode1.NodeID = "1"; + rootNode1.Text = "建筑工程"; + rootNode1.CommandName = "建筑工程"; + rootNode1.Selectable = false; + this.tvControlItem.Nodes.Add(rootNode1); + + TreeNode rootNode2 = new TreeNode(); + rootNode2.NodeID = "2"; + rootNode2.Text = "安装工程"; + rootNode2.CommandName = "安装工程"; + rootNode2.Expanded = true; + this.tvControlItem.Nodes.Add(rootNode2); + + var pUnits = (from x in Funs.DB.Project_ProjectUnit where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList(); + // 获取当前用户所在单位 + var currUnit = pUnits.FirstOrDefault(x => x.UnitId == this.CurrUser.UnitId); + + var unitWorkList = (from x in Funs.DB.WBS_UnitWork + where x.ProjectId == this.CurrUser.LoginProjectId + && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null + select x).ToList(); + + List unitWork1 = null; + List unitWork2 = null; + + //// 当前为施工单位,只能操作本单位的数据 + //if (currUnit != null && currUnit.UnitType == Const.ProjectUnitType_2) + //{ + // unitWork1 = (from x in unitWorkList + // where x.UnitId == this.CurrUser.UnitId && x.ProjectType == "1" + // select x).ToList(); + // unitWork2 = (from x in unitWorkList + // where x.UnitId == this.CurrUser.UnitId && x.ProjectType == "2" + // select x).ToList(); + //} + //else + //{ + unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList(); + unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList(); + //} + + if (unitWork1.Count() > 0) + { + foreach (var q in unitWork1) + { + int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId select x).Count(); + var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId); + TreeNode tn1 = new TreeNode(); + tn1.NodeID = q.UnitWorkId; + tn1.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线"; + tn1.ToolTip = "施工单位:" + unitNamesUnitIds; + tn1.EnableClickEvent = true; + rootNode1.Nodes.Add(tn1); + } + } + if (unitWork2.Count() > 0) + { + foreach (var q in unitWork2) + { + int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId select x).Count(); + var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId); + TreeNode tn2 = new TreeNode(); + tn2.NodeID = q.UnitWorkId; + tn2.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线"; + tn2.ToolTip = "施工单位:" + unitNamesUnitIds; + tn2.EnableClickEvent = true; + rootNode2.Nodes.Add(tn2); + } + } + } + /// + /// 点击TreeView + /// + /// + /// + protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) + { + this.BindGrid(); + + } + + /// + /// 树查询 + /// + /// + /// + protected void btnTreeFind_Click(object sender, EventArgs e) + { + this.InitTreeMenu(); + //this.BindGrid3(this.tvControlItem.SelectedNodeID); + } + + #endregion + + #region 维护事件 + protected void Grid1_RowClick(object sender, GridRowClickEventArgs e) + { + if (e.RowIndex >= 0) + { + string ID = Grid1.DataKeys[e.RowIndex][0].ToString(); + BindDetailGrid(ID); + } + } + + protected void btnSearch_Click(object sender, EventArgs e) + { + BindGrid(); + } + /// + /// 增加 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.HJGL_WeldJointMenuId, Const.BtnAdd)) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InOutPlanMasterEdit.aspx?}", "新增 - "))); + } + else + { + ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + } + } + + protected void btnMenuInOutPlanMasterDelete_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.HJGL_WeldJointMenuId, Const.BtnDelete)) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var model = BLL.TwInOutplanmasterService.GetById(rowID); + if (model.State == (int)TwConst.State.已审核 || model.State == (int)TwConst.State.已完成) + { + Alert.ShowInTop("请选择有效的计划!", MessageBoxIcon.Warning); + return; + } + else + { + BLL.TwInOutplanmasterService.DeleteById(rowID); + + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + BindGrid(); + } + } + else + { + ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + } + } + + protected void btnGenInOutMaster_Click(object sender, EventArgs e) + { + + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string planId = Grid1.SelectedRowID; + var planMaster = BLL.TwInOutplanmasterService.GetById(planId); + if (planMaster.State != (int)TwConst.State.已审核) + { + Alert.ShowInTop("请选择有效的计划!", MessageBoxIcon.Warning); + return; + } + else + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OutPlanMasterEdit.aspx?Id={0}", Grid1.SelectedRowID, "编辑 - "))); + + } + } + + protected void btnRevokeGenInOutMaster_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string planId = Grid1.SelectedRowID; + TwOutputmasterService.RevokeGenOutMasterByPlanId(planId); + + } + + protected void btnMenuInOutPlanMasterEdit_Click(object sender, EventArgs e) + { + + } + #endregion + + #region 报表打印 + /// + /// 报表打印 + /// + /// + /// + protected void btnPrint_Click(object sender, EventArgs e) + { + string pipelineId = this.tvControlItem.SelectedNodeID; + var q = BLL.PipelineService.GetPipelineByPipelineId(pipelineId); + + if (q != null) + { + var jotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == pipelineId select x).Count(); + var weldJotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == pipelineId && x.WeldingDailyId != null select x).Count(); + if (jotCount == weldJotCount) + { + string varValue = string.Empty; + var project = BLL.ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId); + if (project != null) + { + varValue = project.ProjectName; + var unitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(q.UnitWorkId); + if (unitWork != null) + { + varValue = varValue + "|" + unitWork.UnitWorkName; + } + } + List listStr = new List(); + listStr.Add(new SqlParameter("@IsoId", pipelineId)); + listStr.Add(new SqlParameter("@Flag", "0")); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = BLL.SQLHelper.GetDataTableRunProc("HJGL_spJointWorkRecordNew", parameter); + string page = Funs.GetPagesCountByPageSize(11, 16, tb.Rows.Count).ToString(); + + + varValue = varValue + "|" + page; + + if (!string.IsNullOrEmpty(varValue)) + { + varValue = HttpUtility.UrlEncodeUnicode(varValue); + } + if (tb.Rows.Count <= 11) + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.HJGL_JointInfoReport1Id, pipelineId, varValue, this.CurrUser.LoginProjectId))); + } + else + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.HJGL_JointInfoReport1Id, pipelineId, varValue, this.CurrUser.LoginProjectId))); + } + } + else + { + ShowNotify("请选择焊接完成管线!", MessageBoxIcon.Warning); + return; + } + } + + else + { + ShowNotify("请选择管线!", MessageBoxIcon.Warning); + return; + } + } + #endregion + + #region 关闭弹出窗口及刷新页面 + /// + /// 关闭弹出窗口 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + //this.InitTreeMenu();//加载树 + //this.BindGrid3(this.tvControlItem.SelectedNodeID); + } + + protected void Window2_Close(object sender, WindowCloseEventArgs e) + { + throw new NotImplementedException(); + } + + #endregion + + #region 选项卡改变事件 + /// + /// 选项卡改变事件 + /// + /// + /// + protected void TabStrip1_TabIndexChanged(object sender, EventArgs e) + { + if (this.TabStrip1.ActiveTabIndex == 0) + { + + + } + else if (this.TabStrip1.ActiveTabIndex == 1) + { + + } + } + + + #endregion + + #region 导出 + /// + /// 导出方法 + /// + /// + /// + private string GetGridTableHtml(Grid grid) + { + StringBuilder sb = new StringBuilder(); + sb.Append(""); + sb.Append(""); + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + if (column.HeaderText != "序号") + { + sb.AppendFormat("", column.HeaderText); + } + } + sb.Append(""); + foreach (GridRow row in grid.Rows) + { + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + string html = row.Values[column.ColumnIndex].ToString(); + if (column.ColumnID != "tfNumber") + { + //html = (row.FindControl("lblNumber") as AspNet.Label).Text; + sb.AppendFormat("", html); + } + //sb.AppendFormat("", html); + } + + sb.Append(""); + } + + sb.Append("
{0}
{0}{0}
"); + + return sb.ToString(); + } + + #endregion + + #region 获取权限按钮 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.Tw_InPlanMasterMenuId); + if (buttonList.Count > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + // this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnGenInOutMaster.Hidden = false; + this.btnRevokeGenInOutMaster.Hidden = false; + this.btnPrint.Hidden = false; + // this.btnMenuInOutPlanMasterEdit.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuInOutPlanMasterDelete.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnAuditing)) + { + this.btnPassMaster.Hidden = false; + } + } + } + #endregion + + + protected void btnPassMaster_OnClick(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string planId = Grid1.SelectedRowID; + var planMaster = BLL.TwInOutplanmasterService.GetById(planId); + if (planMaster.State != (int)TwConst.State.待审核) + { + Alert.ShowInTop("请选择有效的计划!", MessageBoxIcon.Warning); + return; + } + else + { + planMaster.State = (int)TwConst.State.已审核; + TwInOutplanmasterService.Update(planMaster); + BindGrid(); + ShowNotify("审核通过!", MessageBoxIcon.Success); + } + + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.designer.cs new file mode 100644 index 00000000..941753d6 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.designer.cs @@ -0,0 +1,305 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CLGL +{ + + + public partial class OutPlanMaster + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// tvPipeCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox tvPipeCode; + + /// + /// hdUnitWorkId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdUnitWorkId; + + /// + /// btnTreeFind 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnTreeFind; + + /// + /// tvControlItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree tvControlItem; + + /// + /// Panel2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel2; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Toolbar3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar3; + + /// + /// drpWarehouse 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpWarehouse; + + /// + /// drpTypeInt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpTypeInt; + + /// + /// drpStates 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpStates; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSearch; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnPassMaster 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnPassMaster; + + /// + /// btnGenInOutMaster 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnGenInOutMaster; + + /// + /// btnRevokeGenInOutMaster 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnRevokeGenInOutMaster; + + /// + /// btnPrint 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnPrint; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// lblNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblNumber; + + /// + /// panelBottomRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelBottomRegion; + + /// + /// TabStrip1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TabStrip TabStrip1; + + /// + /// TabDetail 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tab TabDetail; + + /// + /// Grid2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid2; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuInOutPlanMasterDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuInOutPlanMasterDelete; + } +} diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx new file mode 100644 index 00000000..ee7c24ba --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx @@ -0,0 +1,93 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OutPlanMasterEdit.aspx.cs" Inherits="FineUIPro.Web.CLGL.OutPlanMasterEdit" %> + + + + + + + + + + +
+
+ + + + + + + + <%-- + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx.cs b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx.cs new file mode 100644 index 00000000..7c1852fb --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx.cs @@ -0,0 +1,107 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using BLL; +using Model; +using Newtonsoft.Json.Linq; + +namespace FineUIPro.Web.CLGL +{ + public partial class OutPlanMasterEdit : PageBase + { + public string Id + { + get + { + return (string)ViewState["Id"]; + } + set + { + ViewState["Id"] = value; + } + } + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Id = Request.QueryString["Id"]; + if (!string.IsNullOrEmpty(Id)) + { + var model= TwInOutplanmasterService.GetById(Id); + txtCusBillCode.Text = model.CusBillCode; + txtWarehouseCode.Text = model.WarehouseCode; + txtCreateDate.Text =string.Format("{0:yyyy-MM-dd}", model.CreateDate); + txtCreateMan.Text = Person_PersonsService.GetPersonsNameById(model.CreateMan); + txtReqUnitName.Text = UnitService.GetUnitNameByUnitId(model.ReqUnitId); + + + var queryModel = new Model.Tw_InOutDetailOutput() + { + InOutPlanMasterId = Id + + }; + var detailList= TwInOutplandetailService.GetByModle(queryModel).ToList(); + foreach (var item in detailList) + { + item.ActNum=item.PlanNum; + + } + Grid1.DataSource=detailList; + Grid1.DataBind(); + } + + } + } + /// + /// 保存明细项 + /// + private List SaveDetail(string InOutPlanMasterId) + { + + //根据列表中的明细项添加 + List detailLists = new List(); + JArray teamGroupData = Grid1.GetMergedData(); + foreach (JObject teamGroupRow in teamGroupData) + { + JObject values = teamGroupRow.Value("values"); + int rowIndex = teamGroupRow.Value("index"); + Model.Tw_OutputDetail newDetail = new Model.Tw_OutputDetail + { + Id = SQLHelper.GetNewID(), + OutputMasterId = InOutPlanMasterId, + //ProNoticeCId= values.Value("ProNoticeCId"), + MaterialCode = values.Value("MaterialCode"), + PlanNum = values.Value("PlanNum"), + ActNum = values.Value("ActNum"), + }; + + detailLists.Add(newDetail); + } + return detailLists; + } + protected void btnEditProcess_Click(object sender, EventArgs e) + { + throw new NotImplementedException(); + } + + protected void btnSave_Click(object sender, EventArgs e) + { + TwOutputmasterService.GenOutMasterByPlanId(Id, SaveDetail(Id)); + ShowNotify("保存成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + } + + protected void btnAgree_Click(object sender, EventArgs e) + { + throw new NotImplementedException(); + } + + protected void btnDisgree_Click(object sender, EventArgs e) + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx.designer.cs new file mode 100644 index 00000000..b3b6a39d --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx.designer.cs @@ -0,0 +1,152 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CLGL +{ + + + public partial class OutPlanMasterEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// Form2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form2; + + /// + /// TbCreate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar TbCreate; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// Panel4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel4; + + /// + /// txtProjectName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtProjectName; + + /// + /// txtCusBillCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCusBillCode; + + /// + /// txtWarehouseCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtWarehouseCode; + + /// + /// PanelOrderIn 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel PanelOrderIn; + + /// + /// txtCreateMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCreateMan; + + /// + /// txtCreateDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCreateDate; + + /// + /// txtReqUnitName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtReqUnitName; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// tbActNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox tbActNum; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + } +} diff --git a/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx b/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx new file mode 100644 index 00000000..831582c6 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx @@ -0,0 +1,212 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OutputMaster.aspx.cs" Inherits="FineUIPro.Web.CLGL.OutputMaster" %> + + + + + 申请单 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx.cs b/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx.cs new file mode 100644 index 00000000..1645952b --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx.cs @@ -0,0 +1,537 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CLGL +{ + public partial class OutputMaster : PageBase + { + public int pageSize = PipelineService.pageSize; + + protected void Page_Load(object sender, EventArgs e) + { + + if (!IsPostBack) + { + this.GetButtonPower(); + InitDrpList(); + this.InitTreeMenu(); + + } + } + + + private void InitDrpList() + { + drpWarehouse.DataTextField = "Text"; + drpWarehouse.DataValueField = "Value"; + drpWarehouse.DataSource = BLL.DropListService.HJGL_WarehouseCode(); + drpWarehouse.DataBind(); + Funs.FineUIPleaseSelect(this.drpWarehouse); + drpTypeInt.DataTextField = "Key"; + drpTypeInt.DataValueField = "Value"; + drpTypeInt.DataSource = BLL.TwConst.TypeIntMap.Where(x => x.Key.Contains("出库")); + drpTypeInt.DataBind(); + Funs.FineUIPleaseSelect(this.drpTypeInt); + drpStates.DataTextField = "Key"; + drpStates.DataValueField = "Value"; + drpStates.DataSource = BLL.TwConst.StateMap; + drpStates.DataBind(); + Funs.FineUIPleaseSelect(this.drpStates); + + } + #region 数据绑定 + /// + /// 管线数据 + /// + private void BindGrid() + { + Model.Tw_InOutMasterOutput table = new Model.Tw_InOutMasterOutput(); + table.ProjectId = this.CurrUser.LoginProjectId; + table.InOutType = (int?)TwConst.InOutType.出库; + if (drpTypeInt.SelectedValue != Const._Null) + { + table.TypeInt = Convert.ToInt32(drpTypeInt.SelectedValue); + } + if (drpStates.SelectedValue != Const._Null) + { + table.State = Convert.ToInt32(drpStates.SelectedValue); + } + if (drpWarehouse.SelectedValue != Const._Null) + { + table.WarehouseCode = drpWarehouse.SelectedValue; + } + + if (!string .IsNullOrEmpty(tvControlItem.SelectedNodeID)) + { + table.UnitWorkId=tvControlItem.SelectedNodeID; + } + var tb = BLL.TwOutputmasterService.GetListData(table, Grid1); + Grid1.RecordCount = TwOutputmasterService.Count; + Grid1.DataSource = tb; + Grid1.DataBind(); + + Grid2.DataSource = null; + Grid2.DataBind(); + } + + private void BindDetailGrid(string outputMasterId) + { + Model.Tw_InOutDetailOutput table = new Model.Tw_InOutDetailOutput(); + table.OutputMasterId = outputMasterId; + var tb = BLL.TwOutputdetailService.GetListData(table, Grid2); + Grid2.DataSource = tb; + Grid2.DataBind(); + for (int i = 0; i < Grid2.Rows.Count; i++) + { + var model = Grid2.Rows[i].DataItem as Model.Tw_InOutDetailOutput; + if (model.ActNum> model.PlanNum) + { + Grid2.Rows[i].RowCssClass = "yellow"; + } + else if (model.ActNum < model.PlanNum) + { + Grid2.Rows[i].RowCssClass = "red"; + } + + } + + } + #endregion + + #region 排序 + + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + BindGrid(); + } + + #endregion + + #region 加载树装置-单位-工作区 + + /// + /// 加载树 + /// + private void InitTreeMenu() + { + this.tvControlItem.Nodes.Clear(); + + TreeNode rootNode1 = new TreeNode(); + rootNode1.NodeID = "1"; + rootNode1.Text = "建筑工程"; + rootNode1.CommandName = "建筑工程"; + rootNode1.Selectable = false; + this.tvControlItem.Nodes.Add(rootNode1); + + TreeNode rootNode2 = new TreeNode(); + rootNode2.NodeID = "2"; + rootNode2.Text = "安装工程"; + rootNode2.CommandName = "安装工程"; + rootNode2.Expanded = true; + this.tvControlItem.Nodes.Add(rootNode2); + + var pUnits = (from x in Funs.DB.Project_ProjectUnit where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList(); + // 获取当前用户所在单位 + var currUnit = pUnits.FirstOrDefault(x => x.UnitId == this.CurrUser.UnitId); + + var unitWorkList = (from x in Funs.DB.WBS_UnitWork + where x.ProjectId == this.CurrUser.LoginProjectId + && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null + select x).ToList(); + + List unitWork1 = null; + List unitWork2 = null; + + //// 当前为施工单位,只能操作本单位的数据 + //if (currUnit != null && currUnit.UnitType == Const.ProjectUnitType_2) + //{ + // unitWork1 = (from x in unitWorkList + // where x.UnitId == this.CurrUser.UnitId && x.ProjectType == "1" + // select x).ToList(); + // unitWork2 = (from x in unitWorkList + // where x.UnitId == this.CurrUser.UnitId && x.ProjectType == "2" + // select x).ToList(); + //} + //else + //{ + unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList(); + unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList(); + //} + + if (unitWork1.Count() > 0) + { + foreach (var q in unitWork1) + { + int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId select x).Count(); + var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId); + TreeNode tn1 = new TreeNode(); + tn1.NodeID = q.UnitWorkId; + tn1.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线"; + tn1.ToolTip = "施工单位:" + unitNamesUnitIds; + tn1.EnableClickEvent = true; + rootNode1.Nodes.Add(tn1); + } + } + if (unitWork2.Count() > 0) + { + foreach (var q in unitWork2) + { + int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId select x).Count(); + var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId); + TreeNode tn2 = new TreeNode(); + tn2.NodeID = q.UnitWorkId; + tn2.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线"; + tn2.ToolTip = "施工单位:" + unitNamesUnitIds; + tn2.EnableClickEvent = true; + rootNode2.Nodes.Add(tn2); + } + } + } + /// + /// 点击TreeView + /// + /// + /// + protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) + { + this.BindGrid(); + + } + + /// + /// 树查询 + /// + /// + /// + protected void btnTreeFind_Click(object sender, EventArgs e) + { + this.InitTreeMenu(); + } + + #endregion + + #region 维护事件 + protected void Grid1_RowClick(object sender, GridRowClickEventArgs e) + { + if (e.RowIndex >= 0) + { + string ID = Grid1.DataKeys[e.RowIndex][0].ToString(); + BindDetailGrid(ID); + } + } + + /// + /// Grid双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.Tw_OutputMasterMenuId, BLL.Const.BtnModify)) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InOutPlanMasterEdit.aspx?Id={0}", Grid1.SelectedRowID, "编辑 - "))); + } + else + { + ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + } + } + + /// + /// 增加 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.Tw_OutputMasterMenuId, Const.BtnAdd)) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InOutPlanMasterEdit.aspx?}", "新增 - "))); + } + else + { + ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + } + } + + protected void btnMenuInOutPlanMasterDelete_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.Tw_OutputMasterMenuId, Const.BtnDelete)) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning); + return; + } + + bool isShow = true; + if (Grid1.SelectedRowIndexArray.Length > 1) + { + isShow = false; + } + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + ShowNotify("删除成功!", MessageBoxIcon.Success); + + } + + this.InitTreeMenu(); + } + else + { + ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + } + } + protected void btnGenInPlanMaster_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.Tw_OutputMasterMenuId, Const.BtnModify)) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning); + return; + } + + string message= TwInOutplanmasterService.GenPlanMasterByOutputMasterId(Grid1.SelectedRowID, TwConst.TypeInt.退料入库); + if (string .IsNullOrEmpty(message)) + { + ShowNotify("生成通知单成功!", MessageBoxIcon.Success); + } + else + { + ShowNotify(message, MessageBoxIcon.Warning); + } + } + else + { + ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + } + } + + protected void btnGenOutPlanMaster_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.Tw_OutputMasterMenuId, Const.BtnModify)) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning); + return; + } + + string message = TwInOutplanmasterService.GenPlanMasterByOutputMasterId(Grid1.SelectedRowID, TwConst.TypeInt.补料出库); + if (string.IsNullOrEmpty(message)) + { + ShowNotify("生成通知单成功!", MessageBoxIcon.Success); + } + else + { + ShowNotify(message, MessageBoxIcon.Warning); + } + } + else + { + ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + } + } + protected void btnSearch_Click(object sender, EventArgs e) + { + BindGrid(); + } + protected void btnMenuInOutPlanMasterEdit_Click(object sender, EventArgs e) + { + + } + #endregion + + #region 报表打印 + /// + /// 报表打印 + /// + /// + /// + protected void btnPrint_Click(object sender, EventArgs e) + { + string pipelineId = this.tvControlItem.SelectedNodeID; + var q = BLL.PipelineService.GetPipelineByPipelineId(pipelineId); + + if (q != null) + { + var jotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == pipelineId select x).Count(); + var weldJotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == pipelineId && x.WeldingDailyId != null select x).Count(); + if (jotCount == weldJotCount) + { + string varValue = string.Empty; + var project = BLL.ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId); + if (project != null) + { + varValue = project.ProjectName; + var unitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(q.UnitWorkId); + if (unitWork != null) + { + varValue = varValue + "|" + unitWork.UnitWorkName; + } + } + List listStr = new List(); + listStr.Add(new SqlParameter("@IsoId", pipelineId)); + listStr.Add(new SqlParameter("@Flag", "0")); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = BLL.SQLHelper.GetDataTableRunProc("HJGL_spJointWorkRecordNew", parameter); + string page = Funs.GetPagesCountByPageSize(11, 16, tb.Rows.Count).ToString(); + + + varValue = varValue + "|" + page; + + if (!string.IsNullOrEmpty(varValue)) + { + varValue = HttpUtility.UrlEncodeUnicode(varValue); + } + if (tb.Rows.Count <= 11) + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.HJGL_JointInfoReport1Id, pipelineId, varValue, this.CurrUser.LoginProjectId))); + } + else + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.HJGL_JointInfoReport1Id, pipelineId, varValue, this.CurrUser.LoginProjectId))); + } + } + else + { + ShowNotify("请选择焊接完成管线!", MessageBoxIcon.Warning); + return; + } + } + + else + { + ShowNotify("请选择管线!", MessageBoxIcon.Warning); + return; + } + } + #endregion + + #region 关闭弹出窗口及刷新页面 + /// + /// 关闭弹出窗口 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + //this.InitTreeMenu();//加载树 + //this.BindGrid3(this.tvControlItem.SelectedNodeID); + } + + protected void Window2_Close(object sender, WindowCloseEventArgs e) + { + throw new NotImplementedException(); + } + + #endregion + + #region 选项卡改变事件 + /// + /// 选项卡改变事件 + /// + /// + /// + protected void TabStrip1_TabIndexChanged(object sender, EventArgs e) + { + if (this.TabStrip1.ActiveTabIndex == 0) + { + + + } + else if (this.TabStrip1.ActiveTabIndex == 1) + { + + } + } + + + #endregion + + #region 导出 + /// + /// 导出方法 + /// + /// + /// + private string GetGridTableHtml(Grid grid) + { + StringBuilder sb = new StringBuilder(); + sb.Append(""); + sb.Append(""); + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + if (column.HeaderText != "序号") + { + sb.AppendFormat("", column.HeaderText); + } + } + sb.Append(""); + foreach (GridRow row in grid.Rows) + { + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + string html = row.Values[column.ColumnIndex].ToString(); + if (column.ColumnID != "tfNumber") + { + //html = (row.FindControl("lblNumber") as AspNet.Label).Text; + sb.AppendFormat("", html); + } + //sb.AppendFormat("", html); + } + + sb.Append(""); + } + + sb.Append("
{0}
{0}{0}
"); + + return sb.ToString(); + } + + #endregion + + #region 获取权限按钮 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.Tw_InPlanMasterMenuId); + if (buttonList.Count > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnPrint.Hidden = false; + //this.btnMenuInOutPlanMasterEdit.Hidden = false; + this.btnGenInPlanMaster.Hidden = false; + this.btnGenOutPlanMaster.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + //this.btnMenuInOutPlanMasterDelete.Hidden = false; + } + } + } + #endregion + + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx.designer.cs new file mode 100644 index 00000000..33371802 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx.designer.cs @@ -0,0 +1,296 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CLGL +{ + + + public partial class OutputMaster + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// tvPipeCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox tvPipeCode; + + /// + /// hdUnitWorkId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdUnitWorkId; + + /// + /// btnTreeFind 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnTreeFind; + + /// + /// tvControlItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree tvControlItem; + + /// + /// Panel2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel2; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Toolbar3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar3; + + /// + /// drpWarehouse 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpWarehouse; + + /// + /// drpTypeInt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpTypeInt; + + /// + /// drpStates 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpStates; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSearch; + + /// + /// btnGenInPlanMaster 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnGenInPlanMaster; + + /// + /// btnGenOutPlanMaster 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnGenOutPlanMaster; + + /// + /// btnPrint 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnPrint; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// lblNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblNumber; + + /// + /// panelBottomRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelBottomRegion; + + /// + /// TabStrip1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TabStrip TabStrip1; + + /// + /// TabDetail 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tab TabDetail; + + /// + /// Grid2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid2; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuInOutPlanMasterEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuInOutPlanMasterEdit; + + /// + /// btnMenuInOutPlanMasterDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuInOutPlanMasterDelete; + } +} diff --git a/SGGL/FineUIPro.Web/CLGL/OutputMasterEdit.aspx b/SGGL/FineUIPro.Web/CLGL/OutputMasterEdit.aspx new file mode 100644 index 00000000..6cedb01d --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/OutputMasterEdit.aspx @@ -0,0 +1,21 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OutputMasterEdit.aspx.cs" Inherits="FineUIPro.Web.CLGL.OutputMasterEdit" %> + + + + + + + + + +
+
+
+
+ +id'); + } + + + + diff --git a/SGGL/FineUIPro.Web/CLGL/OutputMasterEdit.aspx.cs b/SGGL/FineUIPro.Web/CLGL/OutputMasterEdit.aspx.cs new file mode 100644 index 00000000..8cc24785 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/OutputMasterEdit.aspx.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CLGL +{ + public partial class OutputMasterEdit : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/OutputMasterEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/OutputMasterEdit.aspx.designer.cs new file mode 100644 index 00000000..5c0ddb44 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/OutputMasterEdit.aspx.designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CLGL +{ + + + public partial class OutputMasterEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + } +} diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/材料入库导入模板.xlsx b/SGGL/FineUIPro.Web/File/Excel/DataIn/材料入库导入模板.xlsx new file mode 100644 index 00000000..307d9e25 Binary files /dev/null and b/SGGL/FineUIPro.Web/File/Excel/DataIn/材料入库导入模板.xlsx differ diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 8507c67d..8b074840 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -304,6 +304,17 @@ + + + + + + + + + + + @@ -7995,6 +8006,83 @@ WorkStage.aspx + + ArrivalStatistics.aspx + ASPXCodeBehind + + + ArrivalStatistics.aspx + + + OutPlanMaster.aspx + ASPXCodeBehind + + + OutPlanMaster.aspx + + + OutPlanMasterEdit.aspx + ASPXCodeBehind + + + OutPlanMasterEdit.aspx + + + InPlanMaster.aspx + ASPXCodeBehind + + + InPlanMaster.aspx + + + InPlanMasterDataIn.aspx + ASPXCodeBehind + + + InPlanMasterDataIn.aspx + + + InPlanMasterEdit.aspx + ASPXCodeBehind + + + InPlanMasterEdit.aspx + + + InputMaster.aspx + ASPXCodeBehind + + + InputMaster.aspx + + + InputMasterEdit.aspx + ASPXCodeBehind + + + InputMasterEdit.aspx + + + MaterialStock.aspx + ASPXCodeBehind + + + MaterialStock.aspx + + + OutputMaster.aspx + ASPXCodeBehind + + + OutputMaster.aspx + + + OutputMasterEdit.aspx + ASPXCodeBehind + + + OutputMasterEdit.aspx + main2.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx index f36eef1e..2dd18a8b 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx @@ -93,7 +93,7 @@ - + diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs index 89b58748..e19c6f55 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs @@ -105,7 +105,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage Tree_hJGL_Pipelines = new List(); this.txtTaskDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now.AddDays(1)); - this.txtTaskCode.Text = BLL.WeldTaskService.GetTaskCodeByDate(this.CurrUser.LoginProjectId, this.txtTaskDate.Text); BLL.Base_WeldingLocationServie.InitWeldingLocationDropDownList(drpWeldingLocation, true); ///焊接属性 this.drpJointAttribute.DataTextField = "Text"; @@ -123,6 +122,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage string strList = Request.Params["strList"]; List list = Funs.GetStrListByStr(strList, '|'); + if (list.Count() == 3) { this.UnitWorkId = list[0]; @@ -134,6 +134,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage Model.WBS_UnitWork UnitWork = BLL.UnitWorkService.getUnitWorkByUnitWorkId(this.UnitWorkId); BLL.UnitService.InitUnitDropDownListByUnitIds(this.drpUnit, UnitWork.UnitId, false);//单位 this.drpUnit.SelectedValue = unitId; + this.txtTaskCode.Text = BLL.WeldTaskService.GetTaskCodeByDate(this.CurrUser.LoginProjectId, this.txtTaskDate.Text, list[0], drpUnit.SelectedValue); + if (!string.IsNullOrEmpty(TaskDate)) { txtTaskDate.Text = TaskDate; @@ -166,6 +168,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage Model.WBS_UnitWork UnitWork = BLL.UnitWorkService.getUnitWorkByUnitWorkId(this.UnitWorkId); BLL.UnitService.InitUnitDropDownListByUnitIds(this.drpUnit, UnitWork.UnitId, false);//单位 + this.txtTaskCode.Text = BLL.WeldTaskService.GetTaskCodeByDate(this.CurrUser.LoginProjectId, this.txtTaskDate.Text, list[0], drpUnit.SelectedValue); + if (!string.IsNullOrEmpty(TaskDate)) { txtTaskDate.Text = TaskDate; @@ -661,9 +665,13 @@ namespace FineUIPro.Web.HJGL.WeldingManage protected void txtTaskDate_TextChanged(object sender, EventArgs e) { - this.txtTaskCode.Text = BLL.WeldTaskService.GetTaskCodeByDate(this.CurrUser.LoginProjectId, this.txtTaskDate.Text); + this.txtTaskCode.Text = BLL.WeldTaskService.GetTaskCodeByDate(this.CurrUser.LoginProjectId, this.txtTaskDate.Text, UnitWorkId, drpUnit.SelectedValue); } + protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e) + { + this.txtTaskCode.Text = BLL.WeldTaskService.GetTaskCodeByDate(this.CurrUser.LoginProjectId, this.txtTaskDate.Text, UnitWorkId, drpUnit.SelectedValue); + } protected void drpJointAttribute_SelectedIndexChanged(object sender, EventArgs e) { BindGrid(); @@ -720,5 +728,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage } } } + + } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx index 9b248fb7..a3fd5ef3 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx @@ -1,4 +1,5 @@ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WeldMatMatch.aspx.cs" Inherits="FineUIPro.Web.HJGL.WeldingManage.WeldMatMatch" %> + <%@ Register Src="~/Controls/_3DLook.ascx" TagName="_3DLook" TagPrefix="uc1" %> @@ -35,21 +36,21 @@ - + - + - - + - + @@ -62,31 +63,127 @@ + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - @@ -101,9 +198,9 @@ FieldType="String" HeaderText="所需量" HeaderTextAlign="Center" TextAlign="Left"> - + + TextAlign="Center"> @@ -124,28 +221,27 @@ FieldType="String" HeaderText="类型" HeaderTextAlign="Center" TextAlign="Left"> - + - + -