From c3e1045d40c208ca4e9d5a6de36aee290beec835 Mon Sep 17 00:00:00 2001 From: yhw0507 Date: Mon, 20 Feb 2023 09:57:33 +0800 Subject: [PATCH 1/4] =?UTF-8?q?20230220=E5=8D=B1=E9=99=A9=E6=BA=90?= =?UTF-8?q?=E8=BE=A8=E8=AF=86=E6=96=B0=E5=A2=9E=E9=A1=B5=E9=9D=A2=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E9=A1=B9=E4=B8=8D=E5=91=88=E7=8E=B0=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SGGL/FineUIPro.Web/ErrLog.txt | 82 ------------------- SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 2 +- .../HSSE/Hazard/HazardTemplate.aspx.cs | 4 +- .../HSSE/Hazard/ShowHazardList.aspx.cs | 4 +- 4 files changed, 5 insertions(+), 87 deletions(-) diff --git a/SGGL/FineUIPro.Web/ErrLog.txt b/SGGL/FineUIPro.Web/ErrLog.txt index 83c803aa..e69de29b 100644 --- a/SGGL/FineUIPro.Web/ErrLog.txt +++ b/SGGL/FineUIPro.Web/ErrLog.txt @@ -1,82 +0,0 @@ -System.InvalidOperationException: 可为空的对象必须具有一个值。 - 在 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) - 在 System.Nullable`1.get_Value() - 在 BLL.HJGL_MaterialService.isInStockByPipeline(String pipelineid, String projectid) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\BLL\HJGL\PreDesign\HJGL_MaterialService.cs:行号 284 -System.InvalidOperationException: 可为空的对象必须具有一个值。 - 在 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) - 在 System.Nullable`1.get_Value() - 在 BLL.HJGL_MaterialService.isInStockByPipeline(String pipelineid, String projectid) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\BLL\HJGL\PreDesign\HJGL_MaterialService.cs:行号 284 -System.InvalidOperationException: 可为空的对象必须具有一个值。 - 在 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) - 在 System.Nullable`1.get_Value() - 在 BLL.HJGL_MaterialService.isInStockByPipeline(String pipelineid, String projectid) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\BLL\HJGL\PreDesign\HJGL_MaterialService.cs:行号 284 -System.InvalidOperationException: 可为空的对象必须具有一个值。 - 在 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) - 在 System.Nullable`1.get_Value() - 在 BLL.HJGL_MaterialService.isInStockByPipeline(String pipelineid, String projectid) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\BLL\HJGL\PreDesign\HJGL_MaterialService.cs:行号 284 -System.InvalidOperationException: 可为空的对象必须具有一个值。 - 在 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) - 在 System.Nullable`1.get_Value() - 在 BLL.HJGL_MaterialService.isInStockByPipeline(String pipelineid, String projectid) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\BLL\HJGL\PreDesign\HJGL_MaterialService.cs:行号 284 -System.InvalidOperationException: 可为空的对象必须具有一个值。 - 在 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) - 在 System.Nullable`1.get_Value() - 在 BLL.HJGL_MaterialService.isInStockByPipeline(String pipelineid, String projectid) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\BLL\HJGL\PreDesign\HJGL_MaterialService.cs:行号 284 -System.InvalidOperationException: 可为空的对象必须具有一个值。 - 在 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) - 在 System.Nullable`1.get_Value() - 在 BLL.HJGL_MaterialService.isInStockByPipeline(String pipelineid, String projectid) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\BLL\HJGL\PreDesign\HJGL_MaterialService.cs:行号 284 -System.InvalidOperationException: 可为空的对象必须具有一个值。 - 在 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) - 在 System.Nullable`1.get_Value() - 在 BLL.HJGL_MaterialService.isInStockByPipeline(String pipelineid, String projectid) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\BLL\HJGL\PreDesign\HJGL_MaterialService.cs:行号 284 -System.InvalidOperationException: 可为空的对象必须具有一个值。 - 在 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) - 在 System.Nullable`1.get_Value() - 在 BLL.HJGL_MaterialService.isInStockByPipeline(String pipelineid, String projectid) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\BLL\HJGL\PreDesign\HJGL_MaterialService.cs:行号 284 -System.InvalidOperationException: 可为空的对象必须具有一个值。 - 在 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) - 在 System.Nullable`1.get_Value() - 在 BLL.HJGL_MaterialService.isInStockByPipeline(String pipelineid, String projectid) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\BLL\HJGL\PreDesign\HJGL_MaterialService.cs:行号 284 -System.InvalidOperationException: 可为空的对象必须具有一个值。 - 在 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) - 在 System.Nullable`1.get_Value() - 在 BLL.HJGL_MaterialService.isInStockByPipeline(String pipelineid, String projectid) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\BLL\HJGL\PreDesign\HJGL_MaterialService.cs:行号 284 -System.InvalidOperationException: 可为空的对象必须具有一个值。 - 在 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) - 在 System.Nullable`1.get_Value() - 在 BLL.HJGL_MaterialService.isInStockByPipeline(String pipelineid, String projectid) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\BLL\HJGL\PreDesign\HJGL_MaterialService.cs:行号 284 - -错误信息开始=====> -错误类型:FormatException -错误信息:输入字符串的格式不正确。 -错误堆栈: - 在 System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt) - 在 System.String.System.IConvertible.ToDouble(IFormatProvider provider) - 在 System.Convert.ToDouble(Object value) - 在 FineUIPro.RenderField.VQscVYXUOqxsrrrlgEYaXHIhTAZB(GridRow ) - 在 (GridColumn , GridRow ) - 在 FineUIPro.GridRow.BkpgFeAELTFlAvoTrOBrConfcLJbA() - 在 (GridRow ) - 在 FineUIPro.Grid.BkpgFeAELTFlAvoTrOBrConfcLJbA(Int32 , Object ) - 在 (Grid , Int32 , Object ) - 在 FineUIPro.Grid.LDChsdiaqdhUTcxBcQPMKyQFfjEDB(DataTable , Boolean ) - 在 (Grid , DataTable , Boolean ) - 在 FineUIPro.Grid.DataBind(Boolean keepCurrentData) - 在 (Grid , Boolean ) - 在 FineUIPro.Grid.DataBind() - 在 FineUIPro.Web.HJGL.WeldingManage.SelectTaskWeldJoint.BindGrid() 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\FineUIPro.Web\HJGL\WeldingManage\SelectTaskWeldJoint.aspx.cs:行号 339 - 在 FineUIPro.Web.HJGL.WeldingManage.SelectTaskWeldJoint.tvControlItem_NodeCommand(Object sender, TreeCommandEventArgs e) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\FineUIPro.Web\HJGL\WeldingManage\SelectTaskWeldJoint.aspx.cs:行号 296 - 在 FineUIPro.Tree.OnNodeCommand(TreeCommandEventArgs e) - 在 (Tree , TreeCommandEventArgs ) - 在 FineUIPro.Tree.RaisePostBackEvent(String eventArgument) - 在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) - 在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) - 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) -出错时间:02/17/2023 15:15:39 -出错文件:http://localhost:4909/HJGL/WeldingManage/SelectTaskWeldJoint.aspx?strList=51f17d4a-92b5-4bbc-8935-fa0fced13bcb%7C1af885ff-b778-46c6-a13d-a21b304ac835%7C2022-12-01 -IP地址:::1 -操作人员:JT - -出错时间:02/17/2023 15:15:39 - diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 022e88aa..db0bb242 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -12804,7 +12804,7 @@ True 0 / - http://localhost:4909/ + http://localhost:8899/ False False diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/HazardTemplate.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Hazard/HazardTemplate.aspx.cs index e16118e3..f38c0ac7 100644 --- a/SGGL/FineUIPro.Web/HSSE/Hazard/HazardTemplate.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/HazardTemplate.aspx.cs @@ -256,11 +256,11 @@ namespace FineUIPro.Web.HSSE.Hazard } string strSql = @"SELECT H.HazardId,T.HazardListTypeId,T.HazardListTypeCode,T.HazardListTypeName,H.HazardCode,H.HazardItems,H.DefectsType," + @" H.MayLeadAccidents,H.HelperMethod,H.HazardJudge_L,H.HazardJudge_E,H.HazardJudge_C,H.HazardJudge_D,Const0007.ConstText AS HazardLevel," - + @" H.ControlMeasures,H.CompileMan,H.CompileDate,H.AuditMan,H.AuditDate,H.IsPass,U.PersonName AS CompileManName,UR.UserName AS AuditManName" + + @" H.ControlMeasures,H.CompileMan,H.CompileDate,H.AuditMan,H.AuditDate,H.IsPass,U.PersonName AS CompileManName,UR.PersonName AS AuditManName" + @" FROM Technique_HazardList AS H" + @" LEFT JOIN Technique_HazardListType AS T ON T.HazardListTypeId = H.HazardListTypeId" + @" LEFT JOIN Person_Persons AS U ON U.PersonId = H.CompileMan" - + @" LEFT JOIN Person_Persons AS UR ON UR.UserId = H.AuditMan" + + @" LEFT JOIN Person_Persons AS UR ON UR.PersonId = H.AuditMan" + @" LEFT JOIN Sys_Const AS Const0007 ON Const0007.ConstValue = H.HazardLevel and Const0007.GroupId = '" + ConstValue.Group_0007 + "'" + @" WHERE T.HazardListTypeId = @HazardListTypeId "; List listStr = new List diff --git a/SGGL/FineUIPro.Web/HSSE/Hazard/ShowHazardList.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Hazard/ShowHazardList.aspx.cs index 5a28cfa0..37934c87 100644 --- a/SGGL/FineUIPro.Web/HSSE/Hazard/ShowHazardList.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/Hazard/ShowHazardList.aspx.cs @@ -100,11 +100,11 @@ namespace FineUIPro.Web.HSSE.Hazard { string strSql = @"SELECT H.HazardId,T.HazardListTypeId,T.HazardListTypeCode,T.HazardListTypeName,H.HazardCode,H.HazardItems,H.DefectsType," + @" H.MayLeadAccidents,H.HelperMethod,H.HazardJudge_L,H.HazardJudge_E,H.HazardJudge_C,H.HazardJudge_D,Const0007.ConstText AS HazardLevel," - + @" H.ControlMeasures,H.CompileMan,H.CompileDate,H.AuditMan,H.AuditDate,H.IsPass,U.PersonName AS CompileManName,UR.UserName AS AuditManName" + + @" H.ControlMeasures,H.CompileMan,H.CompileDate,H.AuditMan,H.AuditDate,H.IsPass,U.PersonName AS CompileManName,UR.PersonName AS AuditManName" + @" FROM Technique_HazardList AS H" + @" LEFT JOIN Technique_HazardListType AS T ON T.HazardListTypeId = H.HazardListTypeId" + @" LEFT JOIN Person_Persons AS U ON U.PersonId = H.CompileMan" - + @" LEFT JOIN Person_Persons AS UR ON UR.UserId = H.AuditMan" + + @" LEFT JOIN Person_Persons AS UR ON UR.PersonId = H.AuditMan" + @" LEFT JOIN Sys_Const AS Const0007 ON Const0007.ConstValue = H.HazardLevel and Const0007.GroupId = '" + ConstValue.Group_0007 + "'" + @" WHERE T.HazardListTypeId = @HazardListTypeId "; List listStr = new List(); From ef6bbc170eda109cc3f66c3f6bc26319c756cc94 Mon Sep 17 00:00:00 2001 From: fly-l <1420031550@qq.com> Date: Mon, 20 Feb 2023 10:49:51 +0800 Subject: [PATCH 2/4] =?UTF-8?q?2023-02-20=20001=20=E7=84=8A=E6=8E=A5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DataBase/版本日志/SGGLDB_V2023-02-20.sql | 136 +++++++++++ .../1-5焊接管理(Menu_HJGL).sql | 2 +- SGGL/BLL/BLL.csproj | 1 + SGGL/BLL/HJGL/DataImport/DataImportService.cs | 22 +- .../HJGL/PreDesign/HJGL_MaterialService.cs | 146 +++++++++--- .../HJGL_ComponentJointService.cs | 193 ++++++++++++++++ .../WeldingManage/PipelineComponentService.cs | 62 ++++- .../BLL/HJGL/WeldingManage/PipelineService.cs | 144 ++++++++++-- .../HJGL/WeldingManage/WeldingDailyService.cs | 79 ++++--- .../CQMS/PersonManage/WelderManage.aspx | 13 ++ .../CQMS/PersonManage/WelderManage.aspx.cs | 6 +- .../WelderManage.aspx.designer.cs | 109 +++++---- .../File/Fastreport/组件打印.frx | 4 +- SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 8 + .../HJGL/DataImport/TDMImport.aspx | 4 +- .../HJGL/InfoQuery/JointQuery.aspx.cs | 4 +- .../HJGL/PersonManage/WelderManage.aspx | 13 ++ .../HJGL/PersonManage/WelderManage.aspx.cs | 11 +- .../WelderManage.aspx.designer.cs | 103 ++++++--- .../HJGL/PreDesign/PipelingDivide.aspx | 14 +- .../HJGL/PreDesign/PrePipeline.aspx | 10 + .../HJGL/PreDesign/PrePipeline.aspx.cs | 24 +- .../PreDesign/PrePipeline.aspx.designer.cs | 18 ++ .../PreDesign/PrePipelineQRCodeIn.aspx.cs | 31 +++ .../WeldingManage/SelectTaskWeldJoint.aspx.cs | 3 + .../HJGL/WeldingManage/WeldJointList.aspx | 25 +- .../WeldJointList.aspx.designer.cs | 63 ++--- .../HJGL/WeldingManage/WeldMatMatch.aspx | 12 +- .../HJGL/WeldingManage/WeldMatMatch.aspx.cs | 145 +++++++----- .../WeldMatMatch.aspx.designer.cs | 27 +++ .../HJGL/WeldingManage/WeldMatMatchGet.aspx | 61 +++++ .../WeldingManage/WeldMatMatchGet.aspx.cs | 84 +++++++ .../WeldMatMatchGet.aspx.designer.cs | 98 ++++++++ .../HJGL/WeldingManage/WeldReportEdit.aspx | 18 +- .../HJGL/WeldingManage/WeldReportEdit.aspx.cs | 35 +-- .../HJGL/WeldingManage/WeldingPlan.aspx | 10 +- SGGL/Model/Model.cs | 217 ++++++++++++++++++ 37 files changed, 1649 insertions(+), 306 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_V2023-02-20.sql create mode 100644 SGGL/BLL/HJGL/WeldingManage/HJGL_ComponentJointService.cs create mode 100644 SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatchGet.aspx create mode 100644 SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatchGet.aspx.cs create mode 100644 SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatchGet.aspx.designer.cs diff --git a/DataBase/版本日志/SGGLDB_V2023-02-20.sql b/DataBase/版本日志/SGGLDB_V2023-02-20.sql new file mode 100644 index 00000000..00247de1 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-02-20.sql @@ -0,0 +1,136 @@ + alter table HJGL_Pipeline_Component add ProductionState int + Go + update HJGL_WeldJoint set WeldingMode=task.WeldingMode + from HJGL_WeldJoint as joint ,HJGL_WeldTask as task + where task.WeldJointId =joint.WeldJointId and task.WeldingMode !='' + Go + update Sys_Menu set SortIndex='105' where MenuId='7FE911EF-616A-4F04-AACD-E53E633A9E86' + Go +/****** Object: Table [dbo].[HJGL_Pipeline_ComponentJoint] Script Date: 2023/2/18 16:21:52 ******/ +SET ANSI_NULLS ON +GO + +SET QUOTED_IDENTIFIER ON +GO + +SET ANSI_PADDING ON +GO + +CREATE TABLE [dbo].[HJGL_Pipeline_ComponentJoint]( + [Id] [varchar](50) NOT NULL, + [PipelineComponentId] [varchar](50) NULL, + [PipelineComponentCode] [varchar](50) NULL, + [WeldJointId] [varchar](50) NULL, + [WeldJointCode] [varchar](50) NULL, + [State] [int] NULL, + CONSTRAINT [PK_HJGL_Pipeline_ComponentJoint] PRIMARY KEY CLUSTERED +( + [Id] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + +SET ANSI_PADDING OFF +GO + + +SET ANSI_NULLS ON +GO +SET QUOTED_IDENTIFIER ON +GO + /* + create by shuke.li 2020-9-15 + */ + create function [dbo].[SplitString] + ( + @Input nvarchar(max), --input string to be separated + @Separator nvarchar(max)=',', --a string that delimit the substrings in the input string + @RemoveEmptyEntries bit=1 --the return value does not include array elements that contain an empty string + ) + returns @TABLE table + ( + [Id] int identity(1,1), + [Value] nvarchar(max) + ) + as + begin + declare @Index int, @Entry nvarchar(max) + set @Index = charindex(@Separator,@Input) + + while (@Index>0) + begin + set @Entry=ltrim(rtrim(substring(@Input, 1, @Index-1))) + + if (@RemoveEmptyEntries=0) or (@RemoveEmptyEntries=1 and @Entry<>'') + begin + insert into @TABLE([Value]) Values(@Entry) + end + + set @Input = substring(@Input, @Index+datalength(@Separator)/2, len(@Input)) + set @Index = charindex(@Separator, @Input) + end + + set @Entry=ltrim(rtrim(@Input)) + if (@RemoveEmptyEntries=0) or (@RemoveEmptyEntries=1 and @Entry<>'') + begin + insert into @TABLE([Value]) Values(@Entry) + end + return +end +GO + + + +DECLARE +@PipelineComponentId varchar( 50 ), +@PipelineComponentCode varchar( 100 ), +@PipelineId varchar( 100 ), +@QRCode varchar( max ), +@QRCodeItem varchar( 100 ) +DECLARE cursor_name CURSOR FOR -- α + + select PipelineComponentId ,PipelineComponentCode,PipelineId, QRCode from HJGL_Pipeline_Component where QRCode !='' + +OPEN cursor_name -- α +FETCH NEXT FROM cursor_name INTO @PipelineComponentId,@PipelineComponentCode,@PipelineId ,@QRCode -- ץȡһα +WHILE @@FETCH_STATUS = 0 --(-1 ʧܣ -2 ȡвڣ + BEGIN + + DECLARE QRCodeList CURSOR FOR -- α + select value from [dbo].[SplitString](@QRCode, ';', 0) + OPEN QRCodeList -- α + FETCH NEXT FROM QRCodeList INTO @QRCodeItem -- ץȡһα + WHILE @@FETCH_STATUS = 0 --(-1 ʧܣ -2 ȡвڣ + BEGIN + DECLARE @jointcount int; + DECLARE @WeldJointId varchar( 100 ) ; + DECLARE @WeldJointCode varchar( 100 ) + set @jointcount= (select COUNT (*) from HJGL_WeldJoint where PipelineId =@PipelineId and WeldJointCode = SUBSTRING(@QRCodeItem,2,LEN(@QRCodeItem)-1) ) + set @WeldJointId= (select WeldJointId from HJGL_WeldJoint where PipelineId =@PipelineId and WeldJointCode =SUBSTRING(@QRCodeItem,2,LEN(@QRCodeItem)-1)) + set @WeldJointCode= (select WeldJointCode from HJGL_WeldJoint where PipelineId =@PipelineId and WeldJointCode =SUBSTRING(@QRCodeItem,2,LEN(@QRCodeItem)-1)) + --print @QRCodeItem + if @jointcount>0 + begin + DECLARE @ComponentJointcount int; + set @ComponentJointcount=(select COUNT (*) from HJGL_Pipeline_ComponentJoint where WeldJointId= @WeldJointId) + if @ComponentJointcount>0 + begin + print 'º'+@WeldJointCode + update HJGL_Pipeline_ComponentJoint set PipelineComponentId=@PipelineComponentId,PipelineComponentCode =@PipelineComponentCode where Id in (select Id from HJGL_Pipeline_ComponentJoint where WeldJointId= @WeldJointId ); + end + else + begin + print '뺸'+@WeldJointCode + insert into HJGL_Pipeline_ComponentJoint values(NEWID(),@PipelineComponentId,@PipelineComponentCode,@WeldJointId,@WeldJointCode,0) + end + end + FETCH NEXT FROM QRCodeList INTO @QRCodeItem + END + CLOSE QRCodeList -- رα + DEALLOCATE QRCodeList -- ͷα + + FETCH NEXT FROM cursor_name INTO @PipelineComponentId,@PipelineComponentCode,@PipelineId ,@QRCode + END +CLOSE cursor_name -- رα +DEALLOCATE cursor_name -- ͷα \ No newline at end of file diff --git a/DataBase/菜单初始化脚本/1-5焊接管理(Menu_HJGL).sql b/DataBase/菜单初始化脚本/1-5焊接管理(Menu_HJGL).sql index eea50c9a..4c762b12 100644 --- a/DataBase/菜单初始化脚本/1-5焊接管理(Menu_HJGL).sql +++ b/DataBase/菜单初始化脚本/1-5焊接管理(Menu_HJGL).sql @@ -252,7 +252,7 @@ GO -------------------------------------------------------------------------------------------------------------------------------- --6.ȴ/Ӳȹ INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) -VALUES('7FE911EF-616A-4F04-AACD-E53E633A9E86','ȴ/Ӳȹ','',60,'0','Menu_HJGL',0,0,1) +VALUES('7FE911EF-616A-4F04-AACD-E53E633A9E86','ȴ/Ӳȹ','',105,'0','Menu_HJGL',0,0,1) GO INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index d0267b34..c07abc78 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -372,6 +372,7 @@ + diff --git a/SGGL/BLL/HJGL/DataImport/DataImportService.cs b/SGGL/BLL/HJGL/DataImport/DataImportService.cs index db3a28ab..51721ab3 100644 --- a/SGGL/BLL/HJGL/DataImport/DataImportService.cs +++ b/SGGL/BLL/HJGL/DataImport/DataImportService.cs @@ -104,15 +104,19 @@ namespace BLL { string url = Funs.RootPath + filePah.Replace('/', '\\'); FileInfo info = new FileInfo(url); - long fileSize = info.Length; - System.Web.HttpContext.Current.Response.BufferOutput = true; - System.Web.HttpContext.Current.Response.Clear(); - System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; - System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); - System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString()); - System.Web.HttpContext.Current.Response.TransmitFile(url, 0, fileSize); - System.Web.HttpContext.Current.Response.Flush(); - System.Web.HttpContext.Current.Response.Close(); + if (info.Exists) + { + long fileSize = info.Length; + System.Web.HttpContext.Current.Response.BufferOutput = true; + System.Web.HttpContext.Current.Response.Clear(); + System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; + System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString()); + System.Web.HttpContext.Current.Response.TransmitFile(url, 0, fileSize); + System.Web.HttpContext.Current.Response.Flush(); + System.Web.HttpContext.Current.Response.Close(); + } + } catch (System.Exception ex) { diff --git a/SGGL/BLL/HJGL/PreDesign/HJGL_MaterialService.cs b/SGGL/BLL/HJGL/PreDesign/HJGL_MaterialService.cs index 3a270e0b..28d90280 100644 --- a/SGGL/BLL/HJGL/PreDesign/HJGL_MaterialService.cs +++ b/SGGL/BLL/HJGL/PreDesign/HJGL_MaterialService.cs @@ -108,23 +108,57 @@ namespace BLL /// public static DataTable GetSHOPStockDt( string projectid) { - string strSql = @" select - mat.MaterialCode, - lib.MaterialName, - lib.MaterialSpec, - lib.MaterialUnit, - sum( mat.Num)+ISNULL( aa.Num,0) as MaterialNum - from HJGL_MaterialManage mat - left join HJGL_MaterialCodeLib lib on mat.MaterialCode=lib.MaterialCode - left join (SELECT lib.MaterialCode,lib.MaterialName,lib.MaterialUnit, - lib.MaterialSpec,lib.MaterialMade,-sum( pipe.Number) as num - FROM dbo.HJGL_PipeLineMat pipe - LEFT JOIN dbo.HJGL_MaterialCodeLib lib ON lib.MaterialCode = pipe.MaterialCode - LEFT JOIN HJGL_Pipeline line ON pipe.PipelineId=line.PipelineId - WHERE line.PipeArea=@PipeArea and line.State=1 - group by lib.MaterialCode,lib.MaterialName,lib.MaterialUnit, lib.MaterialSpec,lib.MaterialMade) as aa on mat.MaterialCode=aa.MaterialCode - where mat.projectid=@projectid - group by mat.MaterialCode,lib.MaterialName,lib.MaterialSpec,lib.MaterialMade,lib.MaterialUnit,aa.num + string strSql = @" SELECT mat.MaterialCode, + lib.MaterialName, + lib.MaterialSpec, + lib.MaterialUnit, + sum( mat.Num)+ISNULL( aa.Num, + 0) AS MaterialNum + FROM HJGL_MaterialManage mat + LEFT JOIN HJGL_MaterialCodeLib lib + ON mat.MaterialCode=lib.MaterialCode + LEFT JOIN + (SELECT stockused.MaterialCode, + stockused.MaterialName, + stockused.MaterialUnit, + stockused.MaterialSpec, + stockused.MaterialMade, + -sum( stockused.num) AS num + FROM + (SELECT lib.MaterialCode, + lib.MaterialName, + lib.MaterialUnit, + lib.MaterialSpec, + lib.MaterialMade, + -sum( pipe.Number) AS num + FROM dbo.HJGL_PipeLineMat pipe + LEFT JOIN HJGL_Pipeline_ComponentJoint comjoint + ON comjoint.PipelineComponentCode =pipe.PrefabricatedComponents + LEFT JOIN HJGL_MaterialCodeLib lib + ON lib.MaterialCode = pipe.MaterialCode + WHERE comjoint.State=1 + GROUP BY lib.MaterialCode,lib.MaterialName,lib.MaterialUnit, lib.MaterialSpec,lib.MaterialMade + UNION + SELECT lib.MaterialCode, + lib.MaterialName, + lib.MaterialUnit, + lib.MaterialSpec, + lib.MaterialMade, + -sum( pipe.Number) AS num + FROM dbo.HJGL_PipeLineMat pipe + LEFT JOIN HJGL_MaterialCodeLib lib + ON lib.MaterialCode = pipe.MaterialCode + LEFT JOIN HJGL_Pipeline line + ON pipe.PipelineId=line.PipelineId + LEFT JOIN View_HJGL_WeldJoint weldjoint + ON weldjoint.PipelineId=line.PipelineId + WHERE weldjoint.JointAttribute='安装口' + AND weldjoint .WeldingDailyId !='' + GROUP BY lib.MaterialCode,lib.MaterialName,lib.MaterialUnit, lib.MaterialSpec,lib.MaterialMade ) AS stockused + GROUP BY stockused.MaterialCode,stockused.MaterialName,stockused.MaterialUnit,stockused.MaterialSpec,stockused.MaterialMade ) AS aa + ON mat.MaterialCode=aa.MaterialCode + WHERE mat.projectid=@projectid + GROUP BY mat.MaterialCode,lib.MaterialName,lib.MaterialSpec,lib.MaterialMade,lib.MaterialUnit,aa.num "; List listStr = new List(); @@ -136,26 +170,61 @@ namespace BLL } public static DataTable GetFIELDStockDt(string projectid) { - string strSql = @" select - mat.MaterialCode, + string strSql = @" + SELECT mat.MaterialCode, + lib.MaterialName, + lib.MaterialSpec, + lib.MaterialUnit, + sum( mat.Num)+ISNULL( aa.Num, + 0) AS MaterialNum + FROM Material_Material mat + LEFT JOIN HJGL_MaterialCodeLib lib + ON mat.MaterialCode=lib.MaterialCode + LEFT JOIN Material_Inspection Ins + ON mat.InspectionId=Ins.InspectionId + LEFT JOIN + (SELECT stockused.MaterialCode, + stockused.MaterialName, + stockused.MaterialUnit, + stockused.MaterialSpec, + stockused.MaterialMade, + -sum( stockused.num) AS num + FROM + (SELECT lib.MaterialCode, lib.MaterialName, - lib.MaterialSpec, lib.MaterialUnit, - sum( mat.Num)+ISNULL( aa.Num,0) as MaterialNum - from Material_Material mat - left join HJGL_MaterialCodeLib lib on mat.MaterialCode=lib.MaterialCode - left join Material_Inspection Ins on mat.InspectionId=Ins.InspectionId - left join (SELECT lib.MaterialCode,lib.MaterialName,lib.MaterialUnit, - lib.MaterialSpec,lib.MaterialMade,-sum( pipe.Number) as num - FROM dbo.HJGL_PipeLineMat pipe - LEFT JOIN dbo.HJGL_MaterialCodeLib lib ON lib.MaterialCode = pipe.MaterialCode - LEFT JOIN HJGL_Pipeline line ON pipe.PipelineId=line.PipelineId - WHERE line.PipeArea=@PipeArea - group by lib.MaterialCode,lib.MaterialName,lib.MaterialUnit, lib.MaterialSpec,lib.MaterialMade) as aa on mat.MaterialCode=aa.MaterialCode - where mat.projectid=@Projectid and Ins.State=@State - group by mat.MaterialCode,lib.MaterialName,lib.MaterialSpec,lib.MaterialMade,lib.MaterialUnit,aa.num - - "; + lib.MaterialSpec, + lib.MaterialMade, + -sum( pipe.Number) AS num + FROM dbo.HJGL_PipeLineMat pipe + LEFT JOIN HJGL_Pipeline_ComponentJoint comjoint + ON comjoint.PipelineComponentCode =pipe.PrefabricatedComponents + LEFT JOIN HJGL_MaterialCodeLib lib + ON lib.MaterialCode = pipe.MaterialCode + WHERE comjoint.State=1 + GROUP BY lib.MaterialCode,lib.MaterialName,lib.MaterialUnit, lib.MaterialSpec,lib.MaterialMade + UNION + SELECT lib.MaterialCode, + lib.MaterialName, + lib.MaterialUnit, + lib.MaterialSpec, + lib.MaterialMade, + -sum( pipe.Number) AS num + FROM dbo.HJGL_PipeLineMat pipe + LEFT JOIN HJGL_MaterialCodeLib lib + ON lib.MaterialCode = pipe.MaterialCode + LEFT JOIN HJGL_Pipeline line + ON pipe.PipelineId=line.PipelineId + LEFT JOIN View_HJGL_WeldJoint weldjoint + ON weldjoint.PipelineId=line.PipelineId + WHERE weldjoint.JointAttribute='安装口' + AND weldjoint .WeldingDailyId !='' + GROUP BY lib.MaterialCode,lib.MaterialName,lib.MaterialUnit, lib.MaterialSpec,lib.MaterialMade ) AS stockused + GROUP BY stockused.MaterialCode,stockused.MaterialName,stockused.MaterialUnit,stockused.MaterialSpec,stockused.MaterialMade ) AS aa + ON mat.MaterialCode=aa.MaterialCode + WHERE mat.projectid=@Projectid + AND Ins.State=@State + GROUP BY mat.MaterialCode,lib.MaterialName,lib.MaterialSpec,lib.MaterialMade,lib.MaterialUnit,aa.num "; List listStr = new List(); listStr.Add(new SqlParameter("@Projectid", projectid)); listStr.Add(new SqlParameter("@PipeArea", BLL.PipelineService.PipeArea_SHOP)); @@ -284,12 +353,13 @@ namespace BLL if ((decimal)item.Number > StockNum) //实际大于库存 { state = false; //库存不足 + return state; } } else { state = false; //库存不足 - + return state; } } @@ -297,14 +367,14 @@ namespace BLL else { state = false; //库存不足 - + return state; } } else { state = false; //库存不足 - + return state; } } diff --git a/SGGL/BLL/HJGL/WeldingManage/HJGL_ComponentJointService.cs b/SGGL/BLL/HJGL/WeldingManage/HJGL_ComponentJointService.cs new file mode 100644 index 00000000..bb1997c3 --- /dev/null +++ b/SGGL/BLL/HJGL/WeldingManage/HJGL_ComponentJointService.cs @@ -0,0 +1,193 @@ +using FineUIPro; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + +namespace BLL +{ + + public static class HJGL_PipelineComponentjointService + { + public static Model.SGGLDB db = Funs.DB; + + + #region 获取列表 + /// + /// 记录数 + /// + public static int count + { + get; + set; + } + public static List GetHJGL_Pipeline_ComponentJointByModle(Model.HJGL_Pipeline_ComponentJoint table) + { + var q = from x in db.HJGL_Pipeline_ComponentJoint + where + (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && + (string.IsNullOrEmpty(table.PipelineComponentId) || x.PipelineComponentId.Contains(table.PipelineComponentId)) && + (string.IsNullOrEmpty(table.PipelineComponentCode) || x.PipelineComponentCode.Contains(table.PipelineComponentCode)) && + (string.IsNullOrEmpty(table.WeldJointId) || x.WeldJointId.Contains(table.WeldJointId)) && + (string.IsNullOrEmpty(table.WeldJointCode) || x.WeldJointCode.Contains(table.WeldJointCode)) + select x + ; + + return q.ToList(); + } + + /// 获取分页列表 + /// + /// 页码 + /// 每页数量 + /// + public static IEnumerable getListData(Model.HJGL_Pipeline_ComponentJoint table, Grid Grid1) + { + var q = GetHJGL_Pipeline_ComponentJointByModle(table); + count = q.Count(); + if (count == 0) + { + return null; + } + // q= q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList(); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return from x in q + select new + { + x.Id, + x.PipelineComponentId, + x.PipelineComponentCode, + x.WeldJointId, + x.WeldJointCode, + x.State, + + }; + } + #endregion + + public static Model.HJGL_Pipeline_ComponentJoint GetHJGL_Pipeline_ComponentJointById(string Id) + { + return db.HJGL_Pipeline_ComponentJoint.FirstOrDefault(x => x.Id == Id); + } + public static Model.HJGL_Pipeline_ComponentJoint GetHJGL_Pipeline_ComponentJointByWeldJointId(string WeldJointId) + { + return db.HJGL_Pipeline_ComponentJoint.FirstOrDefault(x => x.WeldJointId == WeldJointId); + } + + public static void AddHJGL_Pipeline_ComponentJoint(Model.HJGL_Pipeline_ComponentJoint newtable) + { + + Model.HJGL_Pipeline_ComponentJoint table = new Model.HJGL_Pipeline_ComponentJoint + { + Id = newtable.Id, + PipelineComponentId = newtable.PipelineComponentId, + PipelineComponentCode = newtable.PipelineComponentCode, + WeldJointId = newtable.WeldJointId, + WeldJointCode = newtable.WeldJointCode, + State = newtable.State, + }; + db.HJGL_Pipeline_ComponentJoint.InsertOnSubmit(table); + db.SubmitChanges(); + } + + public static void AddBulkHJGL_Pipeline_ComponentJoint(List newtables) + { + + db.HJGL_Pipeline_ComponentJoint.InsertAllOnSubmit(newtables); + db.SubmitChanges(); + } + + + public static void UpdateHJGL_Pipeline_ComponentJoint(Model.HJGL_Pipeline_ComponentJoint newtable) + { + + Model.HJGL_Pipeline_ComponentJoint table = db.HJGL_Pipeline_ComponentJoint.FirstOrDefault(x => x.Id == newtable.Id); + if (table != null) + { + table.Id = newtable.Id; + table.PipelineComponentId = newtable.PipelineComponentId; + table.PipelineComponentCode = newtable.PipelineComponentCode; + table.WeldJointId = newtable.WeldJointId; + table.WeldJointCode = newtable.WeldJointCode; + table.State = newtable.State; + db.SubmitChanges(); + } + + } + /// + /// 根据焊口号更改状态 + /// + /// + public static void UpdateStateByWeldJointId(string WeldJointId,DateTime TaskDate) + { + + Model.HJGL_Pipeline_ComponentJoint table = db.HJGL_Pipeline_ComponentJoint.FirstOrDefault(x => x.WeldJointId == WeldJointId); + if (table != null) + { + table.State =1; + db.SubmitChanges(); + GetProductionByPipelineComponentId(table.PipelineComponentId, TaskDate); + } + + } + public static void GetProductionByPipelineComponentId(string PipelineComponentId, DateTime TaskDate) + { + var q = db.HJGL_Pipeline_ComponentJoint.Where(x => x.PipelineComponentId == PipelineComponentId).ToList(); + if (q.Count!=0) + { + var NotProductionNum = (from x in q where x.State == 0 select x).Count(); //未生产数量 + var ProductionNum = (from x in q where x.State == 1 select x).Count(); //已生产数量 + if (NotProductionNum == 0) //全部完成 + { + HJGL_PipelineComponentService.UpdateProductionState(PipelineComponentId, 2, TaskDate); + + } + else if (ProductionNum == 0)//未动工 + { + HJGL_PipelineComponentService.UpdateProductionState(PipelineComponentId, 0, TaskDate); + + } + else //已生产 + { + HJGL_PipelineComponentService.UpdateProductionState(PipelineComponentId, 1, TaskDate); + + } + } + + } + + public static void DeleteHJGL_Pipeline_ComponentJointById(string Id) + { + + Model.HJGL_Pipeline_ComponentJoint table = db.HJGL_Pipeline_ComponentJoint.FirstOrDefault(x => x.Id == Id); + if (table != null) + { + db.HJGL_Pipeline_ComponentJoint.DeleteOnSubmit(table); + db.SubmitChanges(); + } + + } + public static void DeleteHJGL_Pipeline_ComponentJointByPipelineComponentId(string PipelineComponentId) + { + + var table = db.HJGL_Pipeline_ComponentJoint.Where(x => x.PipelineComponentId == PipelineComponentId); + if (table != null) + { + db.HJGL_Pipeline_ComponentJoint.DeleteAllOnSubmit(table); + db.SubmitChanges(); + } + + } + public static void DeleteALLHJGL_Pipeline_ComponentJoint() + { + if (db.HJGL_Pipeline_ComponentJoint != null) + { + db.HJGL_Pipeline_ComponentJoint.DeleteAllOnSubmit(db.HJGL_Pipeline_ComponentJoint); + db.SubmitChanges(); + } + } + + } +} \ No newline at end of file diff --git a/SGGL/BLL/HJGL/WeldingManage/PipelineComponentService.cs b/SGGL/BLL/HJGL/WeldingManage/PipelineComponentService.cs index 6aeb6db9..64674e24 100644 --- a/SGGL/BLL/HJGL/WeldingManage/PipelineComponentService.cs +++ b/SGGL/BLL/HJGL/WeldingManage/PipelineComponentService.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; using System.Web.UI.WebControls; @@ -18,6 +19,8 @@ namespace BLL /// 已装箱 /// public static int state_2 = 2; + + public static ListItem[] GetState() { ListItem[] list = new ListItem[3]; @@ -26,6 +29,14 @@ namespace BLL list[2] = new ListItem("已出库", state_2.ToString()); return list; } + public static ListItem[] GetProductionState() + { + ListItem[] list = new ListItem[3]; + list[0] = new ListItem("未开始", "0"); + list[1] = new ListItem("已开始", "1"); + list[2] = new ListItem("已完成", "2"); + return list; + } /// /// 根据ID获取组件信息 /// @@ -95,6 +106,7 @@ namespace BLL model.PipelineComponentCode = model_mat.PrefabricatedComponents; model.DrawingName = model_mat.PrefabricatedComponents.Substring(0, model_mat.PrefabricatedComponents.LastIndexOf('-')).Replace("\"", ""); model.State = state_0; + model.ProductionState = 0; UpdatePipelineComponent(model); } else @@ -105,6 +117,7 @@ namespace BLL model.PipelineComponentCode = model_mat.PrefabricatedComponents; model.DrawingName = model_mat.PrefabricatedComponents.Substring(0, model_mat.PrefabricatedComponents.LastIndexOf('-')).Replace("\"", ""); model.State = state_0; + model.ProductionState = 0; AddPipelineComponent(model); } @@ -135,6 +148,7 @@ namespace BLL newPipeline.DrawingName = pipeline.DrawingName; newPipeline.ReceiveMan= pipeline.ReceiveMan; newPipeline.ReceiveDate= pipeline.ReceiveDate; + newPipeline.ProductionState= pipeline.ProductionState; db.HJGL_Pipeline_Component.InsertOnSubmit(newPipeline); db.SubmitChanges(); } @@ -164,6 +178,7 @@ namespace BLL newPipeline.DrawingName = pipeline.DrawingName; newPipeline.ReceiveMan = pipeline.ReceiveMan; newPipeline.ReceiveDate = pipeline.ReceiveDate; + newPipeline.ProductionState = pipeline.ProductionState; db.SubmitChanges(); } @@ -179,6 +194,40 @@ namespace BLL } + } + /// + /// 修改生产状态 + /// + /// + /// + public static void UpdateProductionState(string pipelineComponentId, int state, DateTime TaskDate) + { + var q = GetPipelineComponentById(pipelineComponentId); + if (q!=null) + { + q.ProductionState = state; + if (state==2) + { + q.ActEndDate = TaskDate; + } + else if(state==1) + { + if (q.ActStartDate ==null) + { + q.ActStartDate = TaskDate; + } + else + { + if (DateTime.Compare(TaskDate,q.ActStartDate.Value) < 0) + { + q.ActStartDate = TaskDate; + } + } + } + UpdatePipelineComponent(q); + + } + } /// /// 根据作业管线Id删除一个作业管线信息 @@ -275,5 +324,16 @@ namespace BLL Funs.FineUIPleaseSelect(dropName); } } + public static void InitMainItemDownProductionStateList(FineUIPro.DropDownList dropName, bool isShowPlease) + { + dropName.DataValueField = "Value"; + dropName.DataTextField = "Text"; + dropName.DataSource = GetProductionState(); + dropName.DataBind(); + if (isShowPlease) + { + Funs.FineUIPleaseSelect(dropName); + } + } } } diff --git a/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs b/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs index beecb30d..b46ce107 100644 --- a/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs +++ b/SGGL/BLL/HJGL/WeldingManage/PipelineService.cs @@ -55,6 +55,10 @@ namespace BLL /// ActDateEnd_FIELD , } + /// + /// 管线划分 + /// + /// public static ListItem[] GetPipeArea() { ListItem[] list = new ListItem[2]; @@ -76,6 +80,10 @@ namespace BLL { return Funs.DB.HJGL_Pipeline.FirstOrDefault(e => e.PipelineId == pipelineId); } + /// + /// 根据管线id获取管线状态 + /// + /// public static void GetStateByPipelineId(string pipelineId) { var mdoel = GetPipelineByPipelineId(pipelineId); @@ -91,6 +99,13 @@ namespace BLL { ActEndDate = Convert.ToDateTime(GetDateByPipelineId(pipelineId, ActDateType.ActDateEnd_FIELD)); } + if (PlanStartDate==null|| PlanEndDate==null) + { + mdoel.State = 0; + + UpdatePipeline(mdoel); + return; + } if (ActStartDate==null&&DateTime.Compare(DateTime.Now,PlanStartDate.Value)<0) { mdoel.State = 0; @@ -114,6 +129,12 @@ namespace BLL UpdatePipeline(mdoel); } + /// + /// 根据管线id获取实际开始,实际完成日期 + /// + /// + /// + /// public static string GetDateByPipelineId(object pipelineId, ActDateType actDateType) { string result =""; @@ -127,7 +148,7 @@ namespace BLL var joints = BLL.WeldJointService.GetWeldJointsByPipelineId(_pipelineId); int joint_Shop_count = joints.Where(x => x.JointAttribute == "预制口").Count(); int joint_Field_count = joints.Where(x => x.JointAttribute == "安装口").Count(); - var TaskJoints = (from x in Funs.DB.View_HJGL_WeldingTask where x.ProjectId == pipemodel.ProjectId && x.PipelineCode == pipemodel.PipelineCode + var TaskJoints = (from x in Funs.DB.View_HJGL_WeldingTask where x.ProjectId == pipemodel.ProjectId && x.PipelineCode == pipemodel.PipelineCode && x.WeldingDailyId!=null select x).ToList(); var TaskJoints_Shop = TaskJoints.Where(x => x.JointAttribute == "预制口").ToList(); var TaskJoints_Field= TaskJoints.Where(x => x.JointAttribute == "安装口").ToList(); @@ -165,10 +186,66 @@ namespace BLL return result; } + + /// + /// 根据焊口更改管线和组件(预制)的实际开始日期和完成日期 + /// + /// + public static void UpdataDateByWeldJointId(string WeldJointId) + { + + DateTime ActDateStart_FIELD = new DateTime(); + DateTime ActDateEnd_FIELD = new DateTime(); + + string JointAttribute = ""; + + var model_joint=BLL.WeldJointService.GetWeldJointByWeldJointId(WeldJointId); + if (model_joint!=null) + { + JointAttribute = model_joint.JointAttribute; + var model_pipeline = GetPipelineByPipelineId(model_joint.PipelineId); + var joints = BLL.WeldJointService.GetWeldJointsByPipelineId(model_joint.PipelineId); + var TaskJoints = (from x in Funs.DB.View_HJGL_WeldingTask + where x.ProjectId == model_pipeline.ProjectId && x.PipelineCode == model_pipeline.PipelineCode && x.WeldingDailyId != null + select x).ToList(); + switch (JointAttribute) + { + + case "安装口": + int joint_Field_count = joints.Where(x => x.JointAttribute == "安装口").Count(); + var TaskJoints_Field = TaskJoints.Where(x => x.JointAttribute == "安装口").ToList(); + + if (TaskJoints_Field.Count > 0) + { + ActDateStart_FIELD = TaskJoints_Field.OrderBy(x => x.TaskDate).First().TaskDate.Value; + } + if (joint_Field_count == TaskJoints_Field.Count && joint_Field_count > 0) + { + ActDateEnd_FIELD = TaskJoints_Field.OrderByDescending(x => x.TaskDate).First().TaskDate.Value; + } + model_pipeline.ActStartDate = ActDateStart_FIELD; + model_pipeline.ActEndDate = ActDateEnd_FIELD; + UpdatePipeline(model_pipeline); + + break; + } + } + + } + /// + /// 根据管线code获取管线信息 + /// + /// + /// public static Model.HJGL_Pipeline GetPipelineByPipelineCode(string pipelineCode) { return Funs.DB.HJGL_Pipeline.FirstOrDefault(e => e.PipelineCode == pipelineCode); } + /// + /// 根据管线信息筛选管线 + /// + /// + /// public static List GetView_HJGL_Pipelines(HJGL_Pipeline model) { var db = Funs.DB; @@ -228,6 +305,38 @@ namespace BLL return Funs.DB.View_HJGL_Pipeline.FirstOrDefault(e => e.PipelineId == pipelineId); } /// + /// 根据主项id获取未完成管线 + /// + /// + /// + public static List GetNoComPipelinesByUnitWordId(string unitworkId) + { + var q = (from x in Funs.DB.View_HJGL_WeldJoint + where x.UnitWorkId == unitworkId + select new { + PipelineId=x.PipelineId, + WeldingDate=x.WeldingDate, + PipelineCode=x.PipelineCode + }).Distinct(); + if (q.Count()==0) + { + return new List(); + } + var noCompipeline = from x in q + group x by x.PipelineId into g + select new + { + PipelineId = g.Key, + Count = (from x2 in g where x2.WeldingDate != null && x2.WeldingDate != "" select x2).Count(), + }; + var NowComPipelineCode = (from x in q + join y in noCompipeline on x.PipelineId equals y.PipelineId + where y.Count == 0 + select x.PipelineCode + ).Distinct(). ToList(); + return NowComPipelineCode; + } + /// /// 下载预制口管线导入模板 /// /// @@ -377,7 +486,7 @@ namespace BLL } /// - /// 根据管线Code获取管线信息 + /// 根据管线code查询管线是否存在 /// /// /// @@ -404,20 +513,12 @@ namespace BLL } } - public static bool IsExistPipelineCode(string pipelineCode, string unitWorkId) - { - Model.SGGLDB db = Funs.DB; - Model.HJGL_Pipeline q = null; - q = Funs.DB.HJGL_Pipeline.FirstOrDefault(x => x.PipelineCode == pipelineCode && x.UnitWorkId == unitWorkId); - if (q != null) - { - return true; - } - else - { - return false; - } - } + /// + /// 根据管线code获取管线信息 + /// + /// 管线号 + /// 主项id + /// public static HJGL_Pipeline GetPipelineByCode(string pipelineCode, string unitWorkId) { Model.SGGLDB db = Funs.DB; @@ -425,7 +526,10 @@ namespace BLL q = Funs.DB.HJGL_Pipeline.FirstOrDefault(x => x.PipelineCode == pipelineCode && x.UnitWorkId == unitWorkId); return q; } - + /// + /// 添加管线信息 + /// + /// public static void AddPipeline(Model.HJGL_Pipeline pipeline) { Model.SGGLDB db = Funs.DB; @@ -520,7 +624,11 @@ namespace BLL } } - // 管线划分 + /// + /// 修改管线划分 + /// + /// + /// public static void UpdatePipelineArea(string pipelineId, string pipelineArea) { Model.SGGLDB db = Funs.DB; diff --git a/SGGL/BLL/HJGL/WeldingManage/WeldingDailyService.cs b/SGGL/BLL/HJGL/WeldingManage/WeldingDailyService.cs index 3936a6a1..887173d6 100644 --- a/SGGL/BLL/HJGL/WeldingManage/WeldingDailyService.cs +++ b/SGGL/BLL/HJGL/WeldingManage/WeldingDailyService.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Linq; +using WIA; namespace BLL { @@ -45,35 +46,57 @@ namespace BLL public static List GetWeldingDailyItem(string weldingDailyId) { List returnViewMatch = new List(); - var weldlineLists = from x in Funs.DB.View_HJGL_WeldJoint + var weldlineLists = (from x in Funs.DB.View_HJGL_WeldJoint where x.WeldingDailyId == weldingDailyId - select x; - if (weldlineLists.Count() > 0) - { - foreach (var item in weldlineLists) - { - Model.SpWeldingDailyItem newWeldReportItem = new Model.SpWeldingDailyItem(); - newWeldReportItem.WeldJointId = item.WeldJointId; - newWeldReportItem.WeldJointCode = item.WeldJointCode; - newWeldReportItem.PipelineCode = item.PipelineCode; - newWeldReportItem.CoverWelderCode = item.CoverWelderCode; - newWeldReportItem.CoverWelderId = item.CoverWelderId; - newWeldReportItem.BackingWelderCode = item.BackingWelderCode; - newWeldReportItem.BackingWelderId = item.BackingWelderId; - //newWeldReportItem.WeldTypeId = item.WeldTypeCode; - newWeldReportItem.JointArea = item.JointArea; - newWeldReportItem.WeldingLocationId = item.WeldingLocationId; - newWeldReportItem.WeldingLocationCode = item.WeldingLocationCode; - newWeldReportItem.JointAttribute = item.JointAttribute; - newWeldReportItem.Size = item.Size; - newWeldReportItem.Dia = item.Dia; - newWeldReportItem.Thickness = item.Thickness; - newWeldReportItem.WeldingMethodCode = item.WeldingMethodCode; - newWeldReportItem.WeldingWireCode = item.WeldingWireCode; - newWeldReportItem.WeldingRodCode = item.WeldingRodCode; - returnViewMatch.Add(newWeldReportItem); - } - } + select new SpWeldingDailyItem + { + WeldJointId = x.WeldJointId, + WeldJointCode = x.WeldJointCode, + PipelineCode = x.PipelineCode, + CoverWelderCode = x.CoverWelderCode, + CoverWelderId = x.CoverWelderId, + BackingWelderCode = x.BackingWelderCode, + BackingWelderId = x.BackingWelderId, + WeldTypeId = x.WeldTypeCode, + JointArea = x.JointArea, + WeldingLocationId = x.WeldingLocationId, + WeldingLocationCode = x.WeldingLocationCode, + JointAttribute = x.JointAttribute, + Size = x.Size, + Dia = x.Dia, + Thickness = x.Thickness, + WeldingMethodCode = x.WeldingMethodCode, + WeldingWireCode = x.WeldingWireCode, + WeldingRodCode = x.WeldingRodCode + + }).ToList(); + returnViewMatch = weldlineLists; + //if (weldlineLists.Count() > 0) + //{ + // foreach (var item in weldlineLists) + // { + // Model.SpWeldingDailyItem newWeldReportItem = new Model.SpWeldingDailyItem(); + // newWeldReportItem.WeldJointId = item.WeldJointId; + // newWeldReportItem.WeldJointCode = item.WeldJointCode; + // newWeldReportItem.PipelineCode = item.PipelineCode; + // newWeldReportItem.CoverWelderCode = item.CoverWelderCode; + // newWeldReportItem.CoverWelderId = item.CoverWelderId; + // newWeldReportItem.BackingWelderCode = item.BackingWelderCode; + // newWeldReportItem.BackingWelderId = item.BackingWelderId; + // //newWeldReportItem.WeldTypeId = item.WeldTypeCode; + // newWeldReportItem.JointArea = item.JointArea; + // newWeldReportItem.WeldingLocationId = item.WeldingLocationId; + // newWeldReportItem.WeldingLocationCode = item.WeldingLocationCode; + // newWeldReportItem.JointAttribute = item.JointAttribute; + // newWeldReportItem.Size = item.Size; + // newWeldReportItem.Dia = item.Dia; + // newWeldReportItem.Thickness = item.Thickness; + // newWeldReportItem.WeldingMethodCode = item.WeldingMethodCode; + // newWeldReportItem.WeldingWireCode = item.WeldingWireCode; + // newWeldReportItem.WeldingRodCode = item.WeldingRodCode; + // returnViewMatch.Add(newWeldReportItem); + // } + //} return returnViewMatch; } diff --git a/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx b/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx index 4e5ea0af..ab645096 100644 --- a/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx +++ b/SGGL/FineUIPro.Web/CQMS/PersonManage/WelderManage.aspx @@ -32,6 +32,19 @@ EnableCollapse="true" Width="250px" Title="单位名称" ShowBorder="true" Layout="VBox" ShowHeader="true" AutoScroll="true" BodyPadding="5px" IconFont="ArrowCircleLeft"> + + + + + + + + + + //------------------------------------------------------------------------------ -namespace FineUIPro.Web.CQMS.PersonManage { - - - public partial class WelderManage { - +namespace FineUIPro.Web.CQMS.PersonManage +{ + + + public partial class WelderManage + { + /// /// form1 控件。 /// @@ -20,7 +22,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -29,7 +31,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// Panel1 控件。 /// @@ -38,7 +40,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel1; - + /// /// panelLeftRegion 控件。 /// @@ -47,7 +49,34 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel panelLeftRegion; - + + /// + /// Toolbar3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar3; + + /// + /// txtQueryWelderCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtQueryWelderCode; + + /// + /// btnQuery 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnQuery; + /// /// tvControlItem 控件。 /// @@ -56,7 +85,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Tree tvControlItem; - + /// /// panelCenterRegion 控件。 /// @@ -65,7 +94,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel panelCenterRegion; - + /// /// Toolbar1 控件。 /// @@ -74,7 +103,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar1; - + /// /// ToolbarFill2 控件。 /// @@ -83,7 +112,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarFill ToolbarFill2; - + /// /// btnEdit 控件。 /// @@ -92,7 +121,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnEdit; - + /// /// btnDelete 控件。 /// @@ -101,7 +130,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnDelete; - + /// /// SimpleForm1 控件。 /// @@ -110,7 +139,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Form SimpleForm1; - + /// /// drpUnitId 控件。 /// @@ -119,7 +148,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label drpUnitId; - + /// /// txtWelderName 控件。 /// @@ -128,7 +157,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtWelderName; - + /// /// txtWelderCode 控件。 /// @@ -137,7 +166,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtWelderCode; - + /// /// rblSex 控件。 /// @@ -146,7 +175,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label rblSex; - + /// /// txtBirthday 控件。 /// @@ -155,7 +184,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtBirthday; - + /// /// txtCertificateCode 控件。 /// @@ -164,7 +193,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtCertificateCode; - + /// /// txtWelderLevel 控件。 /// @@ -173,7 +202,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtWelderLevel; - + /// /// cbIsOnDuty 控件。 /// @@ -182,7 +211,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.CheckBox cbIsOnDuty; - + /// /// txtCertificateLimitTime 控件。 /// @@ -191,7 +220,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label txtCertificateLimitTime; - + /// /// Grid1 控件。 /// @@ -200,7 +229,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid1; - + /// /// Toolbar2 控件。 /// @@ -209,7 +238,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar2; - + /// /// txtQualificationItem 控件。 /// @@ -218,7 +247,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtQualificationItem; - + /// /// ToolbarFill1 控件。 /// @@ -227,7 +256,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarFill ToolbarFill1; - + /// /// btnNew 控件。 /// @@ -236,7 +265,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnNew; - + /// /// ToolbarSeparator1 控件。 /// @@ -245,7 +274,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; - + /// /// ToolbarText1 控件。 /// @@ -254,7 +283,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarText ToolbarText1; - + /// /// ddlPageSize 控件。 /// @@ -263,7 +292,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList ddlPageSize; - + /// /// Window1 控件。 /// @@ -272,7 +301,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window Window1; - + /// /// Menu1 控件。 /// @@ -281,7 +310,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Menu Menu1; - + /// /// btnMenuAudit 控件。 /// @@ -290,7 +319,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnMenuAudit; - + /// /// btnMenuEdit 控件。 /// @@ -299,7 +328,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnMenuEdit; - + /// /// btnMenuDelete 控件。 /// @@ -308,7 +337,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnMenuDelete; - + /// /// btnView 控件。 /// @@ -317,7 +346,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnView; - + /// /// Menu2 控件。 /// @@ -326,7 +355,7 @@ namespace FineUIPro.Web.CQMS.PersonManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Menu Menu2; - + /// /// btnMenuTreeAudit 控件。 /// diff --git a/SGGL/FineUIPro.Web/File/Fastreport/组件打印.frx b/SGGL/FineUIPro.Web/File/Fastreport/组件打印.frx index eee6758f..579d7fcd 100644 --- a/SGGL/FineUIPro.Web/File/Fastreport/组件打印.frx +++ b/SGGL/FineUIPro.Web/File/Fastreport/组件打印.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -99,7 +99,7 @@ namespace FastReport } - + diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 022e88aa..7f39e95b 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -600,6 +600,7 @@ + @@ -8232,6 +8233,13 @@ WeldMatMatch.aspx + + WeldMatMatchGet.aspx + ASPXCodeBehind + + + WeldMatMatchGet.aspx + WeldReport.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/HJGL/DataImport/TDMImport.aspx b/SGGL/FineUIPro.Web/HJGL/DataImport/TDMImport.aspx index 3ef430a0..898886bb 100644 --- a/SGGL/FineUIPro.Web/HJGL/DataImport/TDMImport.aspx +++ b/SGGL/FineUIPro.Web/HJGL/DataImport/TDMImport.aspx @@ -183,7 +183,7 @@ -