Compare commits

...

10 Commits

2
.gitignore vendored

@ -40,3 +40,5 @@ shangjian/XGL.Model/obj/x86/Debug/
shangjian/XGL.Model/bin/x86/Debug/
shangjian/XGL.Thrift/bin/Debug/
shangjian/XGL.Thrift/obj/Debug/
shangjian/.vscode/*
shangjian/AutoUpdate/.vs/AutoUpdate*

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1 +1 @@
{"RootPath":"D:\\Repos\\WorkSpace\\lanju-client\\shangjian\\LanJuControl","ProjectFileName":"LanJuControl.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"Program.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.8.AssemblyAttributes.cs"}],"References":[{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"D:\\Repos\\WorkSpace\\lanju-client\\shangjian\\LanJuControl\\bin\\Debug\\LanJuControl.exe","OutputItemRelativePath":"LanJuControl.exe"},{"OutputItemFullPath":"D:\\Repos\\WorkSpace\\lanju-client\\shangjian\\LanJuControl\\bin\\Debug\\LanJuControl.pdb","OutputItemRelativePath":"LanJuControl.pdb"}],"CopyToOutputEntries":[]}
{"RootPath":"D:\\working_area\\project\\榄菊上位机\\lanju-client\\shangjian\\LanJuControl","ProjectFileName":"LanJuControl.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"Program.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.8.AssemblyAttributes.cs"}],"References":[{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"D:\\working_area\\project\\榄菊上位机\\lanju-client\\shangjian\\LanJuControl\\bin\\Debug\\LanJuControl.exe","OutputItemRelativePath":"LanJuControl.exe"},{"OutputItemFullPath":"","OutputItemRelativePath":""}],"CopyToOutputEntries":[]}

@ -1 +1 @@
{"RootPath":"D:\\Repos\\WorkSpace\\lanju-client\\shangjian\\LanJuLib","ProjectFileName":"LanJuLib.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"DataConfig\\ConnectionConfig.cs"},{"SourceFile":"DataConfig\\DatabaseConfig.cs"},{"SourceFile":"DataConfig\\DataCache.cs"},{"SourceFile":"DataConfig\\SqlDataObject.cs"},{"SourceFile":"DbHelperSQL.cs"},{"SourceFile":"Logger.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"SecurityHelper\\DESProvider.cs"},{"SourceFile":"SecurityHelper\\MD5Provider.cs"},{"SourceFile":"WorkOrder.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.8.AssemblyAttributes.cs"}],"References":[{"Reference":"D:\\Repos\\WorkSpace\\lanju-client\\shangjian\\CommonFunc\\bin\\x86\\Debug\\CommonFunc.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":true,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\Repos\\WorkSpace\\lanju-client\\shangjian\\CommonFunc\\bin\\x86\\Debug\\NLog.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\Repos\\WorkSpace\\lanju-client\\shangjian\\packages\\System.Data.SqlClient.4.8.5\\lib\\net461\\System.Data.SqlClient.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Web.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"D:\\Repos\\WorkSpace\\lanju-client\\shangjian\\LanJuLib\\bin\\Debug\\LanJuLib.dll","OutputItemRelativePath":"LanJuLib.dll"},{"OutputItemFullPath":"D:\\Repos\\WorkSpace\\lanju-client\\shangjian\\LanJuLib\\bin\\Debug\\LanJuLib.pdb","OutputItemRelativePath":"LanJuLib.pdb"}],"CopyToOutputEntries":[]}
{"RootPath":"D:\\working_area\\project\\榄菊上位机\\lanju-client\\shangjian\\LanJuLib","ProjectFileName":"LanJuLib.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"DataConfig\\ConnectionConfig.cs"},{"SourceFile":"DataConfig\\DatabaseConfig.cs"},{"SourceFile":"DataConfig\\DataCache.cs"},{"SourceFile":"DataConfig\\SqlDataObject.cs"},{"SourceFile":"DbHelperSQL.cs"},{"SourceFile":"Logger.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"SecurityHelper\\DESProvider.cs"},{"SourceFile":"SecurityHelper\\MD5Provider.cs"},{"SourceFile":"WorkOrder.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.8.AssemblyAttributes.cs"}],"References":[{"Reference":"D:\\working_area\\project\\榄菊上位机\\lanju-client\\shangjian\\CommonFunc\\bin\\x86\\Debug\\CommonFunc.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":true,"ProjectPath":"D:\\working_area\\project\\榄菊上位机\\lanju-client\\shangjian\\CommonFunc\\bin\\x86\\Debug\\CommonFunc.dll"},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\working_area\\project\\榄菊上位机\\lanju-client\\shangjian\\CommonFunc\\bin\\x86\\Debug\\NLog.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\working_area\\project\\榄菊上位机\\lanju-client\\shangjian\\packages\\System.Data.SqlClient.4.8.5\\lib\\net461\\System.Data.SqlClient.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Web.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"D:\\working_area\\project\\榄菊上位机\\lanju-client\\shangjian\\LanJuLib\\bin\\Debug\\LanJuLib.dll","OutputItemRelativePath":"LanJuLib.dll"},{"OutputItemFullPath":"","OutputItemRelativePath":""}],"CopyToOutputEntries":[]}

@ -1 +1 @@
{"RootPath":"D:\\Repos\\WorkSpace\\lanju-client\\shangjian\\RestartApp","ProjectFileName":"RestartApp.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"RestartApp.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"update.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.8.AssemblyAttributes.cs"}],"References":[{"Reference":"D:\\Repos\\WorkSpace\\lanju-client\\shangjian\\packages\\HtmlAgilityPack.1.11.54\\lib\\Net45\\HtmlAgilityPack.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"D:\\Repos\\WorkSpace\\lanju-client\\shangjian\\RestartApp\\bin\\Debug\\RestartApp.exe","OutputItemRelativePath":"RestartApp.exe"},{"OutputItemFullPath":"D:\\Repos\\WorkSpace\\lanju-client\\shangjian\\RestartApp\\bin\\Debug\\RestartApp.pdb","OutputItemRelativePath":"RestartApp.pdb"}],"CopyToOutputEntries":[]}
{"RootPath":"D:\\working_area\\project\\榄菊上位机\\lanju-client\\shangjian\\RestartApp","ProjectFileName":"RestartApp.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"RestartApp.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"update.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.8.AssemblyAttributes.cs"}],"References":[{"Reference":"D:\\working_area\\project\\榄菊上位机\\lanju-client\\shangjian\\packages\\HtmlAgilityPack.1.11.54\\lib\\Net45\\HtmlAgilityPack.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"D:\\working_area\\project\\榄菊上位机\\lanju-client\\shangjian\\RestartApp\\bin\\Debug\\RestartApp.exe","OutputItemRelativePath":"RestartApp.exe"},{"OutputItemFullPath":"","OutputItemRelativePath":""}],"CopyToOutputEntries":[]}

@ -1 +1 @@
0f83b8d4b5eccd2a91f969c70fa1ff3e934fb37d2edb72b84bfa358900d806b4
e211a9e640790a0c8f79c10b0dc76dec1c4e718c6b3821aaa7db93f9b4d9caad

@ -9,3 +9,14 @@ D:\Repos\WorkSpace\lanju-client\shangjian\RestartApp\obj\Debug\RestartApp.csproj
D:\Repos\WorkSpace\lanju-client\shangjian\RestartApp\obj\Debug\RestartApp.csproj.CopyComplete
D:\Repos\WorkSpace\lanju-client\shangjian\RestartApp\obj\Debug\RestartApp.exe
D:\Repos\WorkSpace\lanju-client\shangjian\RestartApp\obj\Debug\RestartApp.pdb
D:\working_area\project\榄菊上位机\lanju-client\shangjian\RestartApp\bin\Debug\RestartApp.exe.config
D:\working_area\project\榄菊上位机\lanju-client\shangjian\RestartApp\bin\Debug\RestartApp.exe
D:\working_area\project\榄菊上位机\lanju-client\shangjian\RestartApp\bin\Debug\RestartApp.pdb
D:\working_area\project\榄菊上位机\lanju-client\shangjian\RestartApp\bin\Debug\HtmlAgilityPack.dll
D:\working_area\project\榄菊上位机\lanju-client\shangjian\RestartApp\bin\Debug\HtmlAgilityPack.pdb
D:\working_area\project\榄菊上位机\lanju-client\shangjian\RestartApp\bin\Debug\HtmlAgilityPack.xml
D:\working_area\project\榄菊上位机\lanju-client\shangjian\RestartApp\obj\Debug\RestartApp.csproj.AssemblyReference.cache
D:\working_area\project\榄菊上位机\lanju-client\shangjian\RestartApp\obj\Debug\RestartApp.csproj.CoreCompileInputs.cache
D:\working_area\project\榄菊上位机\lanju-client\shangjian\RestartApp\obj\Debug\RestartApp.csproj.Up2Date
D:\working_area\project\榄菊上位机\lanju-client\shangjian\RestartApp\obj\Debug\RestartApp.exe
D:\working_area\project\榄菊上位机\lanju-client\shangjian\RestartApp\obj\Debug\RestartApp.pdb

@ -1 +1 @@
{"RootPath":"D:\\Repos\\WorkSpace\\lanju-client\\shangjian\\WPFupdate","ProjectFileName":"WPFupdate.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"WPFupdate1.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"update.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.8.AssemblyAttributes.cs"}],"References":[{"Reference":"D:\\Repos\\WorkSpace\\lanju-client\\shangjian\\packages\\HtmlAgilityPack.1.11.54\\lib\\Net45\\HtmlAgilityPack.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"D:\\Repos\\WorkSpace\\lanju-client\\shangjian\\WPFupdate\\bin\\Debug\\WPFupdate.exe","OutputItemRelativePath":"WPFupdate.exe"},{"OutputItemFullPath":"D:\\Repos\\WorkSpace\\lanju-client\\shangjian\\WPFupdate\\bin\\Debug\\WPFupdate.pdb","OutputItemRelativePath":"WPFupdate.pdb"}],"CopyToOutputEntries":[]}
{"RootPath":"D:\\working_area\\project\\榄菊上位机\\lanju-client\\shangjian\\WPFupdate","ProjectFileName":"WPFupdate.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"WPFupdate1.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"update.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.8.AssemblyAttributes.cs"}],"References":[{"Reference":"D:\\working_area\\project\\榄菊上位机\\lanju-client\\shangjian\\packages\\HtmlAgilityPack.1.11.54\\lib\\Net45\\HtmlAgilityPack.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"D:\\working_area\\project\\榄菊上位机\\lanju-client\\shangjian\\WPFupdate\\bin\\Debug\\WPFupdate.exe","OutputItemRelativePath":"WPFupdate.exe"},{"OutputItemFullPath":"","OutputItemRelativePath":""}],"CopyToOutputEntries":[]}

File diff suppressed because one or more lines are too long

@ -10,6 +10,7 @@ using System.Threading.Tasks;
using System.Windows.Controls;
using XGL.Models;
using XGL.Models.Model.FoamingMac;
using static Snap7.S7Client;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace XGL.Data.DBService
@ -64,6 +65,8 @@ namespace XGL.Data.DBService
ord.route_code,
ord.attr1,
ord.shift_id,
ord.start_work_time,
ord.end_work_time,
shift.Shift_Desc,'0' as totalCount
FROM
pro_order_workorder ord WITH (NOLOCK)
@ -106,6 +109,14 @@ namespace XGL.Data.DBService
return null;
}
public string GetShiftById(string shiftCode)
{
string sql = $@"select shift_desc from base_shifts_t where del_flag ='0' and Shift_Id = '{shiftCode}'";
var obj = Utils.netClientDBHelper.getScalar(sql, null);
string issucc = obj == null ? "" : obj.ToString();
return issucc;
}
public DataTable GetTeamList()
{
string sql = $@"SELECT team_id,team_code,team_desc FROM [dbo].[base_team_t] where del_flag ='0' ";
@ -274,7 +285,7 @@ where res.taskcode = '0' and equipmentCode = 'C6' and res.OrderCode is not null
('{CommonFunc.Common.GetUUID()}', '{LoginUser.UserId}', '{LoginUser.UserName}', '{type}', GetDate(),
'-', 'w2', '{status}', '{deviceCode}','{remark}','{orderCode}');";
}
sqlList.Add(logSql);
bool issucc = Utils.netClientDBHelper.executeBatchSql(sqlList);
@ -951,22 +962,65 @@ VALUES
return ret > 0 ? true : false;
}
public string GetInsertConsumeInfoSql(DataRowView selectedConsumeRow, string newReportCode, string siteCode)
//public string GetInsertConsumeInfoSql(DataRowView selectedConsumeRow, string newReportCode, string siteCode)
//{
// string sql = $@" INSERT INTO [dbo].[mes_report_work_consume]
// ([record_id], [workorder_code], [material_code], [material_name], [material_spc],
// [quantity], [unit], [remark], [attr1], [attr2],
// [attr3], [attr4], [create_by], [create_time], [update_by],
// [update_time], [factory_code], [report_code], [del_flag],[parent_order],[recoil],[IP],[version],[rspos],[wastage])
// VALUES
// ('{Common.GetUUID()}', '{selectedConsumeRow["workorder_code"]}', '{selectedConsumeRow["material_code"]}', '{selectedConsumeRow["material_name"]}', '{selectedConsumeRow["material_spc"]}',
// '{selectedConsumeRow["qty"]}','{selectedConsumeRow["unit"]}', '{selectedConsumeRow["remark"]}', NULL, NULL,
// NULL, NULL, '{LoginUser.UserName}', GetDate(), '{LoginUser.UserName}',
// GetDate(), '{siteCode}', '{newReportCode}', '0','{selectedConsumeRow["parent_work_order"]}','{selectedConsumeRow["recoil"]}','{LoginUser.CurrDeviceIP}','{LoginUser.Version}','{selectedConsumeRow["attr1"]}', '{selectedConsumeRow["wastage"]}'); ";
// //int ret = Utils.netClientDBHelper.executeUpdate(sql);
// return sql;
//}
public string GetMergeConsumeInfoSql(DataRowView selectedConsumeRow, string newReportCode, string siteCode)
{
string sql = $@" INSERT INTO [dbo].[mes_report_work_consume]
([record_id], [workorder_code], [material_code], [material_name], [material_spc],
[quantity], [unit], [remark], [attr1], [attr2],
[attr3], [attr4], [create_by], [create_time], [update_by],
[update_time], [factory_code], [report_code], [del_flag],[parent_order],[recoil],[IP],[version],[rspos])
VALUES
('{Common.GetUUID()}', '{selectedConsumeRow["workorder_code"]}', '{selectedConsumeRow["material_code"]}', '{selectedConsumeRow["material_name"]}', '{selectedConsumeRow["material_spc"]}',
'{selectedConsumeRow["qty"]}','{selectedConsumeRow["unit"]}', '{selectedConsumeRow["remark"]}', NULL, NULL,
NULL, NULL, '{LoginUser.UserName}', GetDate(), '{LoginUser.UserName}',
GetDate(), '{siteCode}', '{newReportCode}', '0','{selectedConsumeRow["parent_work_order"]}','{selectedConsumeRow["recoil"]}','{LoginUser.CurrDeviceIP}','{LoginUser.Version}','{selectedConsumeRow["attr1"]}'); ";
//int ret = Utils.netClientDBHelper.executeUpdate(sql);
string sql = $@"
MERGE [dbo].[mes_report_work_consume] AS target
USING (SELECT
'{selectedConsumeRow["workorder_code"]}' AS workorder_code,
'{selectedConsumeRow["material_code"]}' AS material_code
) AS source
ON target.workorder_code = source.workorder_code
AND target.material_code = source.material_code
WHEN MATCHED THEN
UPDATE SET
material_name = '{selectedConsumeRow["material_name"]}',
material_spc = '{selectedConsumeRow["material_spc"]}',
quantity = '{selectedConsumeRow["qty"]}',
unit = '{selectedConsumeRow["unit"]}',
remark = '{selectedConsumeRow["remark"]}',
update_by = '{LoginUser.UserName}',
update_time = GETDATE(),
factory_code = '{siteCode}',
report_code = '{newReportCode}',
del_flag = '0',
parent_order = '{selectedConsumeRow["parent_work_order"]}',
recoil = '{selectedConsumeRow["recoil"]}',
IP = '{LoginUser.CurrDeviceIP}',
version = '{LoginUser.Version}',
rspos = '{selectedConsumeRow["attr1"]}',
wastage = '{selectedConsumeRow["wastage"]}'
WHEN NOT MATCHED THEN
INSERT ([record_id], [workorder_code], [material_code], [material_name], [material_spc],
[quantity], [unit], [remark], [attr1], [attr2],
[attr3], [attr4], [create_by], [create_time], [update_by],
[update_time], [factory_code], [report_code], [del_flag], [parent_order], [recoil], [IP], [version], [rspos], [wastage])
VALUES ('{Common.GetUUID()}', '{selectedConsumeRow["workorder_code"]}', '{selectedConsumeRow["material_code"]}', '{selectedConsumeRow["material_name"]}', '{selectedConsumeRow["material_spc"]}',
'{selectedConsumeRow["qty"]}', '{selectedConsumeRow["unit"]}', '{selectedConsumeRow["remark"]}', NULL, NULL,
NULL, NULL, '{LoginUser.UserName}', GETDATE(), '{LoginUser.UserName}',
GETDATE(), '{siteCode}', '{newReportCode}', '0', '{selectedConsumeRow["parent_work_order"]}', '{selectedConsumeRow["recoil"]}', '{LoginUser.CurrDeviceIP}', '{LoginUser.Version}', '{selectedConsumeRow["attr1"]}', '{selectedConsumeRow["wastage"]}');
";
return sql;
}
/// <summary>
/// 获取母单的包工人数
/// </summary>
@ -1189,7 +1243,16 @@ where machine_code = 'X1' and bind_status = '0' order by update_time DESC";
}
return reportList;
}
public int uporderstarttime(string id)
{
string sql = $@"update [dbo].[pro_order_workorder] set start_work_time='{DateTime.Now}' where workorder_id='{id}'";
return Utils.netClientDBHelper.executeUpdate(sql);
}
public int uporderendtime(string id)
{
string sql = $@"update [dbo].[pro_order_workorder] set end_work_time='{DateTime.Now}' where workorder_id='{id}'";
return Utils.netClientDBHelper.executeUpdate(sql);
}
public int EditReport(report report)
{
string sql = $@"update [dbo].[mes_report] set team='{report.team}',OpenLineCheckBox='{report.OpenLineCheckBox}',ReplaceLineCheckBox='{report.ReplaceLineCheckBox}',unqualified='{report.unqualified}',clear='{report.clear}',residue='{report.residue}',lineClear='{report.lineClear}',UserKnow='{report.UserKnow}',qualified='{report.qualified}',equipStatus='{report.equipStatus}',StampCorrect='{report.StampCorrect}',isClear='{report.isClear}',positionCorrect='{report.positionCorrect}',isLineClear='{report.isLineClear}' where Id='{report.Id}'";
@ -1533,6 +1596,57 @@ where machine_code = 'X1' and bind_status = '0' order by update_time DESC";
return list;
}
public List<MesTableSelfDetialModel> GetMesTableSelfDetialByShiftCode(string id,string shiftCode, int count)
{
string sql = $@"select * from [dbo].[mes_table_self_detial] where belong_to='{id}' and remark = '{shiftCode}' and CONVERT(date, create_time) = CONVERT(date, GETDATE())";
DataSet ds = Utils.netClientDBHelper.getDataSet(sql);
List<MesTableSelfDetialModel> list = new List<MesTableSelfDetialModel>();
if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
{
foreach (DataRow dr in ds.Tables[0].Rows)
{
int dable_line = 0;
try
{
dable_line = int.Parse(dr["table_line"].ToString());
}
catch
{
}
list.Add(new MesTableSelfDetialModel()
{
id = dr["id"].ToString(),
belong_to = dr["belong_to"].ToString(),
remark = dr["remark"].ToString(),
bz = dr["bz"].ToString(),
factory_code = dr["factory_code"].ToString(),
del_flag = dr["del_flag"].ToString(),
check_time_s = dr["check_time_s"].ToString(),
check_time_e = dr["check_time_e"].ToString(),
check_result = dr["check_result"].ToString(),
info_code = dr["info_code"].ToString(),
info_name = dr["info_name"].ToString(),
table_line = dable_line,
});
}
list = list.OrderByDescending(t => t.table_line).ToList();
var distinctList = list.OrderByDescending(t => t.table_line).Select(t => t.table_line).Distinct().ToList();
for (int i = 0; i < distinctList.Count; i++)
{
list.Where(t => t.table_line == distinctList[i]).ToList().ForEach(t =>
{
t.index = i;
});
if (i > count)
{
list.RemoveAll(t => t.table_line == distinctList[i]);
}
}
}
return list;
}
public int InsertMesTableSelfDetial(MesTableSelfDetialModel model)
{
string sql = $@"insert into [dbo].[mes_table_self_detial] (id,table_line,belong_to,remark,bz,factory_code,del_flag,check_time_s,check_time_e,check_result,info_code,info_name,create_time) values ('{model.id}','{model.table_line}','{model.belong_to}','{model.remark}','{model.bz}','{model.factory_code}','{model.del_flag}','{model.check_time_s}','{model.check_time_e}','{model.check_result}','{model.info_code}','{model.info_name}',GetDate())";
@ -1630,9 +1744,23 @@ where machine_code = 'X1' and bind_status = '0' order by update_time DESC";
public bool UpdateProWorkBatchInWork(string lineCode, string batchCode, string workorderCode, string productCode, string productName, string productdescen, string boxType, string packType, string umrez, string status, string productDate)
{
string sql = $@"update pro_workbatch_inwork set workorder_code='{workorderCode}',batch='{batchCode}',product_code='{productCode}',status='{status}',product_name='{productName}',product_name_en='{productdescen}',box_type='{boxType}',pack_type='{packType}',umrez='{umrez}',product_date='{productDate}' where line_code='{lineCode}' ";
LogHelper.instance.log.Info($"sql:" + sql);
return Utils.netClientDBHelper.executeUpdate(sql) > 0;
}
///// <summary>
///// 恢复生产时再次写入装数
///// </summary>
///// <param name="umrez"></param>
///// <param name="lineCode"></param>
///// <returns></returns>
//public bool SecondUpdateProWorkBatchInWork(string umrez, string lineCode)
//{
// string sql = $@"update pro_workbatch_inwork set workorder_code='{workorderCode}',product_code='{productCode}',status='{status}',product_name='{productName}',product_name_en='{productdescen}',pack_type='{packType}',umrez='{umrez}',product_date='{productDate}' where line_code='{lineCode}' ";
// LogHelper.instance.log.Info($"sql:" + sql);
// return Utils.netClientDBHelper.executeUpdate(sql) > 0;
//}
public DataTable GetProductSize(string productCode)
{
string sql = $"SELECT length,width,height from base_product where product_code='{productCode}'";
@ -1661,13 +1789,13 @@ where machine_code = 'X1' and bind_status = '0' order by update_time DESC";
return null;
}
public bool UpdateProWorkBatchInWorkStatus(string lineCode, string status)
public bool UpdateProWorkBatchInWorkStatus(string lineCode, string status,string packType)
{
string sql = $@"update pro_workbatch_inwork set status='{status}' where line_code='{lineCode}' ";
string sql = $@"update pro_workbatch_inwork set status='{status}',pack_type='{packType}' where line_code='{lineCode}' ";
return Utils.netClientDBHelper.executeUpdate(sql) > 0;
}
public bool UpdateProWorkBatchInWorkBatchCode(string lineCode, string batchCode, string status,string productCode,string productName)
public bool UpdateProWorkBatchInWorkBatchCode(string lineCode, string batchCode, string status, string productCode, string productName)
{
string sql = $@"update pro_workbatch_inwork set batch='{batchCode}',product_code='{productCode}',product_name='{productName}',status='{status}' where line_code='{lineCode}' ";
return Utils.netClientDBHelper.executeUpdate(sql) > 0;
@ -1694,6 +1822,17 @@ where machine_code = 'X1' and bind_status = '0' order by update_time DESC";
}
return "";
}
public DataTable GetWcsPlcPointBoxCount(string pointNo)
{
string sql = $"SELECT * FROM wcs_plc_point WHERE plc_point_no ='{pointNo}' and equip='BoxCount'";
DataSet ds = Utils.netClientDBHelper.getDataSet(sql);
if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
{
return ds.Tables[0];
}
return null;
}
}
public class MesTableSelfDetialModel
{

@ -297,7 +297,7 @@ where CONVERT(VARCHAR(10), create_time , 120)= CONVERT(VARCHAR(10), '{LoginUser.
public DataTable GetCosumeData(string workorder)
{
string sql = $@"select DISTINCT '0' as qty,'' as remark, pre.workorder_code, SUBSTRING(material_code, 8, LEN(material_code)) as material_code1,material_code,material_name,detail.prod_type,material_spc,detail.unit,quantity,
string sql = $@"select DISTINCT '0' as qty,'0' as wastage,'' as remark, pre.workorder_code, SUBSTRING(material_code, 8, LEN(material_code)) as material_code1,material_code,material_name,detail.prod_type,material_spc,detail.unit,quantity,
detail.create_by,detail.create_time,detail.update_by,detail.update_time,locator,need_date,
recoil,fund_quanlity,detail.del_flag,parent_work_order,detail.attr1,orders.workorder_code_sap
from mes_prepare_detail detail
@ -700,7 +700,9 @@ select a.TrayCode,a.ProductBarNo,a.carcode,a.createtime,a.lineno,b.HadNumber
// workorder.parent_order ='0' and CONVERT(VARCHAR(10), workorder.product_date , 120)= CONVERT(VARCHAR(10), '{date}' , 120) and workorder.prod_line_code like '%{deviceCode}%' order by sort_no,batch_code";
////string sql = $"WITH LatestCheck AS (\r\n SELECT \r\n *,\r\n ROW_NUMBER() OVER (PARTITION BY order_no, income_batch_no ORDER BY create_time DESC) AS rn\r\n FROM \r\n qc_check_task\r\n WHERE \r\n check_type = 'checkTypeCPPC' \r\n AND del_flag = 0\r\n)\r\nSELECT \r\n workorder.factory_code,\r\n workorder.product_date AS plan_time,\r\n workorder.workorder_id,\r\n workorder.workorder_code,\r\n product_code,\r\n product_name,\r\n product_spc,\r\n shifts.shift_desc,\r\n prod_line_code,\r\n workorder.status,\r\n route_code,\r\n quantity_split,\r\n workorder.unit,\r\n workorder.shift_id,\r\n batch.batch_code,\r\n batch.batch_quantity,\r\n sort_no,\r\n workorder.parent_order,\r\n batch.qc_status,\r\n ISNULL(batch.qc_result, '') AS qc_result,\r\n batch.status AS batchStatus,\r\n workorder_code_sap,\r\n salary_flag,\r\n qty.batchQty,\r\n batch.batch_quantity - qty.batchQty AS diffQty,\r\n chack.create_time,\r\n chack.check_status\r\nFROM \r\n pro_order_workorder workorder WITH (NOLOCK)\r\nLEFT JOIN \r\n base_shifts_t shifts WITH (NOLOCK) ON workorder.shift_id = shifts.shift_id\r\nLEFT JOIN \r\n pro_order_workorder_batch batch WITH (NOLOCK) ON workorder.workorder_id = batch.workorder_id\r\nOUTER APPLY \r\n (SELECT TOP 1 * \r\n FROM LatestCheck \r\n WHERE rn = 1 \r\n AND workorder.workorder_code = LatestCheck.order_no \r\n AND batch.batch_code = LatestCheck.income_batch_no) chack\r\nLEFT JOIN \r\n (SELECT sum(quantity_feedback) AS batchQty, workorder_code, batch \r\n FROM [dbo].[mes_report_work] \r\n WHERE del_flag = 0 \r\n GROUP BY workorder_code, batch) qty \r\n ON qty.workorder_code = workorder.workorder_code AND batch.batch_code = qty.batch\r\nWHERE \r\n 1 = 1 \r\n AND batch.del_flag = 0 \r\n AND workorder.del_flag = 0 \r\n AND workorder.parent_order = '0' \r\n AND CONVERT(VARCHAR(10), workorder.product_date, 120) = CONVERT(VARCHAR(10), '{date}', 120) \r\n AND workorder.prod_line_code LIKE '%{deviceCode}%'\r\nORDER BY \r\n sort_no, batch_code;\r\n";
string sql = $"WITH LatestCheck AS (\r\n SELECT \r\n *,\r\n ROW_NUMBER() OVER (PARTITION BY order_no, income_batch_no ORDER BY create_time DESC) AS rn\r\n FROM \r\n qc_check_task\r\n WHERE \r\n check_type = 'checkTypeCPPC' \r\n AND del_flag = 0\r\n)\r\nSELECT \r\n workorder.factory_code,\r\n workorder.product_date AS plan_time,\r\n workorder.workorder_id,\r\n workorder.workorder_code,\r\n product_code,\r\n product_name,\r\n product_spc,\r\n shifts.shift_desc,\r\n prod_line_code,\r\n workorder.status,\r\n route_code,\r\n quantity_split,\r\n workorder.unit,\r\n workorder.shift_id,\r\n batch.batch_code,\r\n batch.batch_quantity,\r\n sort_no,\r\n workorder.parent_order,\r\n batch.qc_status,\r\n ISNULL(batch.qc_result, '') AS qc_result,\r\n batch.status AS batchStatus,\r\n workorder_code_sap,\r\n salary_flag,\r\n qty.batchQty,\r\n batch.batch_quantity - qty.batchQty AS diffQty,\r\n chack.create_time,\r\n chack.check_status,CASE\r\n WHEN batch.attr1 = '1' THEN 'false'\r\n ELSE 'true'\r\n END AS IsEnabled,\r\n CASE\r\n WHEN batch.attr1 = '1' THEN '结束'\r\n ELSE '开始'\r\n END AS BtnTest ,\r\n batch.batch_id AS batchId \r\nFROM \r\n pro_order_workorder workorder WITH (NOLOCK)\r\nLEFT JOIN \r\n base_shifts_t shifts WITH (NOLOCK) ON workorder.shift_id = shifts.shift_id\r\nLEFT JOIN \r\n pro_order_workorder_batch batch WITH (NOLOCK) ON workorder.workorder_id = batch.workorder_id\r\nOUTER APPLY \r\n (SELECT TOP 1 * \r\n FROM LatestCheck \r\n WHERE rn = 1 \r\n AND workorder.workorder_code = LatestCheck.order_no \r\n AND batch.batch_code = LatestCheck.income_batch_no) chack\r\nLEFT JOIN \r\n (SELECT sum(quantity_feedback) AS batchQty, workorder_code, batch \r\n FROM [dbo].[mes_report_work] \r\n WHERE del_flag = 0 \r\n GROUP BY workorder_code, batch) qty \r\n ON qty.workorder_code = workorder.workorder_code AND batch.batch_code = qty.batch\r\nWHERE \r\n 1 = 1 \r\n AND batch.del_flag = 0 \r\n AND workorder.del_flag = 0 \r\n AND workorder.parent_order = '0' \r\n AND CONVERT(VARCHAR(10), workorder.product_date, 120) = CONVERT(VARCHAR(10), '{date}', 120) \r\n AND workorder.prod_line_code LIKE '%{deviceCode}%'\r\nORDER BY \r\n sort_no, batch_code;\r\n";
//string sql = $"WITH LatestCheck AS (\r\n SELECT \r\n *,\r\n ROW_NUMBER() OVER (PARTITION BY order_no, income_batch_no ORDER BY create_time DESC) AS rn\r\n FROM \r\n qc_check_task\r\n WHERE \r\n check_type = 'checkTypeCPPC' \r\n AND del_flag = 0\r\n)\r\nSELECT \r\n workorder.factory_code,\r\n workorder.product_date AS plan_time,\r\n workorder.workorder_id,\r\n workorder.workorder_code,\r\n product_code,\r\n product_name,\r\n product_spc,\r\n shifts.shift_desc,\r\n prod_line_code,\r\n workorder.status,\r\n route_code,\r\n quantity_split,\r\n workorder.unit,\r\n workorder.shift_id,\r\n batch.batch_code,\r\n batch.batch_quantity,\r\n sort_no,\r\n workorder.parent_order,\r\n batch.qc_status,\r\n ISNULL(batch.qc_result, '') AS qc_result,\r\n batch.status AS batchStatus,\r\n workorder_code_sap,\r\n salary_flag,\r\n qty.batchQty,\r\n batch.batch_quantity - qty.batchQty AS diffQty,\r\n chack.create_time,\r\n chack.check_status,CASE\r\n WHEN batch.attr1 = '1' THEN 'false'\r\n ELSE 'true'\r\n END AS IsEnabled,\r\n CASE\r\n WHEN batch.attr1 = '1' THEN '结束'\r\n ELSE '开始'\r\n END AS BtnTest ,\r\n batch.batch_id AS batchId \r\nFROM \r\n pro_order_workorder workorder WITH (NOLOCK)\r\nLEFT JOIN \r\n base_shifts_t shifts WITH (NOLOCK) ON workorder.shift_id = shifts.shift_id\r\nLEFT JOIN \r\n pro_order_workorder_batch batch WITH (NOLOCK) ON workorder.workorder_id = batch.workorder_id\r\nOUTER APPLY \r\n (SELECT TOP 1 * \r\n FROM LatestCheck \r\n WHERE rn = 1 \r\n AND workorder.workorder_code = LatestCheck.order_no \r\n AND batch.batch_code = LatestCheck.income_batch_no) chack\r\nLEFT JOIN \r\n (SELECT sum(quantity_feedback) AS batchQty, workorder_code, batch \r\n FROM [dbo].[mes_report_work] \r\n WHERE del_flag = 0 \r\n GROUP BY workorder_code, batch) qty \r\n ON qty.workorder_code = workorder.workorder_code AND batch.batch_code = qty.batch\r\nWHERE \r\n 1 = 1 \r\n AND batch.del_flag = 0 \r\n AND workorder.del_flag = 0 \r\n AND workorder.parent_order = '0' \r\n AND CONVERT(VARCHAR(10), workorder.product_date, 120) = CONVERT(VARCHAR(10), '{date}', 120) \r\n AND workorder.prod_line_code LIKE '%{deviceCode}%'\r\nORDER BY \r\n sort_no, batch_code;\r\n";
//string sql = $"WITH LatestCheck AS (\r\n SELECT\r\n *,\r\n ROW_NUMBER() OVER (PARTITION BY order_no, income_batch_no ORDER BY create_time DESC) AS rn\r\n FROM\r\n qc_check_task\r\n WHERE\r\n check_type = 'checkTypeCPPC'\r\n AND del_flag = 0\r\n)\r\nSELECT\r\n workorder.factory_code,\r\n workorder.product_date AS plan_time,\r\n workorder.workorder_id,\r\n workorder.workorder_code,\r\n workorder.product_code,\r\n product_name,\r\n product_spc,\r\n shifts.shift_desc,\r\n prod_line_code,\r\n workorder.status,\r\n route_code,\r\n quantity_split,\r\n workorder.unit,\r\n workorder.shift_id,\r\n batch.batch_code,\r\n batch.batch_quantity,\r\n sort_no,\r\n workorder.parent_order,\r\n batch.qc_status,\r\n ISNULL(batch.qc_result, '') AS qc_result,\r\n batch.status AS batchStatus,\r\n workorder_code_sap,\r\n salary_flag,\r\n qty.batchQty,\r\n batch.batch_quantity - qty.batchQty AS diffQty,\r\n chack.create_time,\r\n chack.check_status,\r\n CASE\r\n WHEN batch.attr1 = '1' THEN 'false'\r\n ELSE 'true'\r\n END AS IsEnabled,\r\n CASE\r\n WHEN batch.attr1 = '1' THEN '结束'\r\n ELSE '开始'\r\n END AS BtnTest,\r\n batch.batch_id AS batchId,\r\n bpa.man_standar\r\nFROM\r\n pro_order_workorder workorder WITH (NOLOCK)\r\nLEFT JOIN\r\n base_shifts_t shifts WITH (NOLOCK) ON workorder.shift_id = shifts.shift_id\r\nLEFT JOIN\r\n pro_order_workorder_batch batch WITH (NOLOCK) ON workorder.workorder_id = batch.workorder_id\r\nOUTER APPLY\r\n (SELECT TOP 1 *\r\n FROM LatestCheck\r\n WHERE rn = 1\r\n AND workorder.workorder_code = LatestCheck.order_no\r\n AND batch.batch_code = LatestCheck.income_batch_no) chack\r\nLEFT JOIN\r\n (SELECT sum(quantity_feedback) AS batchQty, workorder_code, batch\r\n FROM [dbo].[mes_report_work]\r\n WHERE del_flag = 0\r\n GROUP BY workorder_code, batch) qty\r\n ON qty.workorder_code = workorder.workorder_code AND batch.batch_code = qty.batch\r\nLEFT JOIN base_product_attached bpa\r\n ON bpa.product_code =\r\n STUFF(workorder.product_code, 1, PATINDEX('%[^0]%', workorder.product_code)-1, '')\r\nWHERE\r\n 1 = 1\r\n AND batch.del_flag = 0\r\n AND workorder.del_flag = 0\r\n AND workorder.parent_order = '0'\r\n AND CONVERT(VARCHAR(10), workorder.product_date, 120) = CONVERT(VARCHAR(10), '{date}', 120)\r\n AND workorder.prod_line_code LIKE '%{deviceCode}%'\r\nORDER BY\r\n sort_no, batch_code;";
string sql = $"WITH LatestCheck AS (SELECT *,\r\n ROW_NUMBER() OVER (PARTITION BY order_no, income_batch_no ORDER BY create_time DESC) AS rn\r\n FROM qc_check_task\r\n WHERE check_type = 'checkTypeCPPC'\r\n AND del_flag = 0)\r\nSELECT workorder.factory_code,\r\n workorder.product_date AS plan_time,\r\n workorder.workorder_id,\r\n workorder.workorder_code,\r\n workorder.product_code,\r\n workorder.product_name,\r\n product_spc,\r\n shifts.shift_desc,\r\n prod_line_code,\r\n workorder.status,\r\n route_code,\r\n quantity_split,\r\n workorder.unit,\r\n workorder.shift_id,\r\n batch.batch_code,\r\n batch.batch_quantity,\r\n sort_no,\r\n workorder.parent_order,\r\n batch.qc_status,\r\n ISNULL(batch.qc_result, '') AS qc_result,\r\n batch.status AS batchStatus,\r\n workorder_code_sap,\r\n salary_flag,\r\n qty.batchQty,\r\n batch.batch_quantity - qty.batchQty AS diffQty,\r\n chack.create_time,\r\n chack.check_status,\r\n CASE WHEN batch.attr1 = '1' THEN 'false' ELSE 'true' END AS IsEnabled,\r\n CASE WHEN batch.attr1 = '1' THEN '结束' ELSE '开始' END AS BtnTest,\r\n batch.batch_id AS batchId,\r\n mlp.use_man\r\nFROM pro_order_workorder workorder WITH (NOLOCK)\r\n LEFT JOIN base_shifts_t shifts WITH (NOLOCK) ON workorder.shift_id = shifts.shift_id\r\n LEFT JOIN pro_order_workorder_batch batch WITH (NOLOCK) ON workorder.workorder_id = batch.workorder_id\r\n OUTER APPLY (SELECT TOP 1 *\r\n FROM LatestCheck\r\n WHERE rn = 1\r\n AND workorder.workorder_code = LatestCheck.order_no\r\n AND batch.batch_code = LatestCheck.income_batch_no) chack\r\n LEFT JOIN (SELECT sum(quantity_feedback) AS batchQty, workorder_code, batch\r\n FROM [dbo].[mes_report_work]\r\n WHERE del_flag = 0\r\n GROUP BY workorder_code, batch) qty\r\n ON qty.workorder_code = workorder.workorder_code AND batch.batch_code = qty.batch\r\n LEFT JOIN mes_line_product mlp ON mlp.product_code = workorder.product_code AND mlp.del_flag = '0' AND mlp.line_code LIKE '%{deviceCode}%'\r\nWHERE 1 = 1\r\n AND batch.del_flag = 0\r\n AND workorder.del_flag = 0\r\n AND workorder.parent_order = '0'\r\n AND CONVERT(VARCHAR(10), workorder.product_date, 120) = CONVERT(VARCHAR(10), '{date}', 120)\r\n AND workorder.prod_line_code LIKE '%{deviceCode}%'\r\nORDER BY sort_no, batch_code;";
DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
{

@ -329,7 +329,7 @@ namespace XGL.Data
//待补充班组班次
LoginUser.ShiftCode = shiftID;
LoginUser.TeamCode = teamID;
LoginUser.WorkDate = workDate;
LoginUser.WorkDate = DateTime.Parse(workDate).ToString("yyyy-MM-dd");
LoginUser.Start_Time = startTime;
LoginUser.End_Time = endTime;
LoginUser.CurrDeviceIP = Common.GetLocationHostAddress();

File diff suppressed because one or more lines are too long

@ -34,5 +34,7 @@ namespace XGL.Models.Model.FoamingMac
public string totalCount { get; set; }
public string isbai { get; set;}
public string shift_id { get; set; }
public DateTime start_work_time { get; set; }
public DateTime end_work_time { get; set; }
}
}

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]

@ -1 +1 @@
{"RootPath":"D:\\Repos\\WorkSpace\\lanju-client\\shangjian\\XGL.Thrift","ProjectFileName":"XGL.Thrift.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"AreaPlc.cs"},{"SourceFile":"CarArea.cs"},{"SourceFile":"Fault.cs"},{"SourceFile":"LineArea.cs"},{"SourceFile":"MaterielNumKB.cs"},{"SourceFile":"Order.cs"},{"SourceFile":"OutCarLine.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"ThriftCommon.cs"},{"SourceFile":"ThriftService.cs"},{"SourceFile":"ThriftServiceImp.cs"},{"SourceFile":"WorkOrder.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.8.AssemblyAttributes.cs"}],"References":[{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\Repos\\WorkSpace\\lanju-client\\shangjian\\packages\\Thrift.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"D:\\Repos\\WorkSpace\\lanju-client\\shangjian\\XGL.Thrift\\bin\\Debug\\XGL.Thrift.dll","OutputItemRelativePath":"XGL.Thrift.dll"},{"OutputItemFullPath":"D:\\Repos\\WorkSpace\\lanju-client\\shangjian\\XGL.Thrift\\bin\\Debug\\XGL.Thrift.pdb","OutputItemRelativePath":"XGL.Thrift.pdb"}],"CopyToOutputEntries":[]}
{"RootPath":"D:\\working_area\\project\\榄菊上位机\\lanju-client\\shangjian\\XGL.Thrift","ProjectFileName":"XGL.Thrift.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"AreaPlc.cs"},{"SourceFile":"CarArea.cs"},{"SourceFile":"Fault.cs"},{"SourceFile":"LineArea.cs"},{"SourceFile":"MaterielNumKB.cs"},{"SourceFile":"Order.cs"},{"SourceFile":"OutCarLine.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"ThriftCommon.cs"},{"SourceFile":"ThriftService.cs"},{"SourceFile":"ThriftServiceImp.cs"},{"SourceFile":"WorkOrder.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.8.AssemblyAttributes.cs"}],"References":[{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\working_area\\project\\榄菊上位机\\lanju-client\\shangjian\\packages\\Thrift.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"D:\\working_area\\project\\榄菊上位机\\lanju-client\\shangjian\\XGL.Thrift\\bin\\Debug\\XGL.Thrift.dll","OutputItemRelativePath":"XGL.Thrift.dll"},{"OutputItemFullPath":"","OutputItemRelativePath":""}],"CopyToOutputEntries":[]}

@ -195,6 +195,5 @@ public partial class AreaPlc : TBase
sb.Append(")");
return sb.ToString();
}
}

File diff suppressed because one or more lines are too long

@ -10,7 +10,7 @@
<!--车间编码-->
<add key="SiteCode" value="999" />
<!--设备编码-->
<add key="DeviceCode" value="C4" />
<add key="DeviceCode" value="C3" />
<!--上位机类型 0:工单准备1成型机\shoupei2烘房,3:人员登录-->
<add key="ClientMode" value="1" />
<add key="SerialPort" value="COM5" />

@ -122,7 +122,7 @@ namespace XGL.Views
currShiftDate = DateTime.Now.Date.AddDays(-1);
}
DataTable dt = formingMachineService.GetInOutHistoryList(_workOrderCode, _deviceCode, currShiftDate.ToString());
DataTable dt = formingMachineService.GetInOutHistoryList(_workOrderCode, _deviceCode, currShiftDate.ToString("yyyy-MM-dd H:mm:ss"));
if (dt == null) return;
foreach (DataRow i in dt.Rows)
{

@ -443,6 +443,37 @@ Background="#F2F3F5"
Click="jilu_Click" Content="记录"></Button>
</StackPanel>
<StackPanel
Grid.Row="0"
Grid.Column="8"
>
<Button
x:Name="start"
Visibility="Collapsed"
Style="{StaticResource btnKey}"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Background="#2B7EE6"
FontSize="20"
Foreground="White"
Click="start_Click" Content="开始"></Button>
</StackPanel>
<StackPanel
Grid.Row="0"
Grid.Column="8"
>
<Button
x:Name="end"
Margin="0,3,0,0"
Visibility="Collapsed"
Style="{StaticResource btnKey}"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Background="#2B7EE6"
FontSize="20"
Foreground="White"
Click="end_Click" Content="结束"></Button>
</StackPanel>
<StackPanel
Grid.Row="0"
Grid.Column="9"
>
@ -474,7 +505,7 @@ Background="#F2F3F5"
CellStyle="{StaticResource CustomCellStyle}"
HorizontalAlignment="Left"
VerticalAlignment="Center" VerticalContentAlignment="Center" IsReadOnly="True"
AutoGenerateColumns="False" CanUserAddRows="False" SelectionChanged="dgWorkOrderInfo_SelectionChanged">
AutoGenerateColumns="False" CanUserAddRows="False" SelectionChanged="dgWorkOrderInfo_SelectionChanged">
<DataGrid.ColumnHeaderStyle >
<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Center" />
@ -509,6 +540,8 @@ Background="#F2F3F5"
<DataGridTextColumn Width="140" Header="工单完成数" Binding="{Binding attr1}" />
<DataGridTextColumn Width="180" Header="当前机台完成数" Binding="{Binding totalCount}" />
<DataGridTextColumn Width="180" Header="班次" Binding="{Binding shift_id}" />
<DataGridTextColumn Width="250" Header="开始时间" Binding="{Binding start_work_time, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" />
<DataGridTextColumn Width="250" Header="结束时间" Binding="{Binding end_work_time, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" />
<!--<DataGridTextColumn Width="340" Header="流转码" Binding="{Binding work_batch_code}" />-->
<!--<DataGridTextColumn Width="60" Header="出入" Binding="{Binding taskcode,Converter={StaticResource TaskCodeConverter}}"/>-->

@ -50,8 +50,6 @@ namespace XGL.Views
}
public void WindowChange(WindowID windowID)
{
Window1.Content = frame;
@ -206,6 +204,8 @@ namespace XGL.Views
order.attr1 = i["attr1"].ToString();
order.shift_id = i["Shift_Desc"].ToString();
order.totalCount = i["totalCount"].ToString();
order.start_work_time = Convert.ToDateTime(i["start_work_time"].ToString());
order.end_work_time = Convert.ToDateTime(i["end_work_time"].ToString());
//if (isbaiye=="5")
//{
// order.isbai = "白班";
@ -335,6 +335,14 @@ namespace XGL.Views
order.attr1 = i["attr1"].ToString();
order.totalCount = i["totalCount"].ToString();
order.shift_id = i["Shift_Desc"].ToString();
if (i["start_work_time"] != DBNull.Value && !string.IsNullOrEmpty(i["start_work_time"].ToString()))
{
order.start_work_time = Convert.ToDateTime(i["start_work_time"].ToString());
}
if (i["end_work_time"] != DBNull.Value && !string.IsNullOrEmpty(i["end_work_time"].ToString()))
{
order.end_work_time = Convert.ToDateTime(i["end_work_time"].ToString());
}
orderList.Add(order);
}
@ -558,6 +566,24 @@ VALUES
return;
}
_workOrderCode = (dgWorkOrderInfo.SelectedItem as FoamingMacModel).workorder_code;
if ((dgWorkOrderInfo.SelectedItem as FoamingMacModel).start_work_time == DateTime.MinValue&&
(dgWorkOrderInfo.SelectedItem as FoamingMacModel).end_work_time == DateTime.MinValue)
{
start.Visibility = Visibility.Visible;
end.Visibility = Visibility.Collapsed;
}
else if((dgWorkOrderInfo.SelectedItem as FoamingMacModel).start_work_time != DateTime.MinValue &&
(dgWorkOrderInfo.SelectedItem as FoamingMacModel).end_work_time != DateTime.MinValue)
{
start.Visibility = Visibility.Collapsed;
end.Visibility = Visibility.Collapsed;
}
else
{
start.Visibility = Visibility.Collapsed;
end.Visibility = Visibility.Visible;
}
InOut_Click(null,null);
}
@ -628,5 +654,116 @@ VALUES
{
new ReportForm().ShowDialog(); ;
}
private void start_Click(object sender, RoutedEventArgs e)
{
List<FoamingMacModel> orderList = new List<FoamingMacModel>();
var sele = dgWorkOrderInfo.SelectedItem as FoamingMacModel;
if (sele != null)
{
var result = MessageBox.Show("确定要开始该工单吗?", "确认", MessageBoxButton.YesNo, MessageBoxImage.Question);
if (result == MessageBoxResult.Yes)
{
var aaa= formingMachineService.uporderstarttime(sele.workorder_id);
if (aaa>0)
{
start.Visibility = Visibility.Collapsed;
end.Visibility = Visibility.Visible;
MessageBox.Show("工单已开始");
DataTable dt = formingMachineService.GetFormingMachineInfo(deviceCode, LoginUser.WorkDate);
if (dt == null) return;
foreach (DataRow i in dt.Rows)
{
FoamingMacModel order = new FoamingMacModel();
order.workorder_id = i["workorder_id"].ToString();
order.workorder_code = i["workorder_code"].ToString();
order.product_name = i["product_name"].ToString();
order.product_code = i["product_code"].ToString();
order.car_num = Convert.ToInt32(i["car_num"].ToString());
order.plan_time = Convert.ToDateTime(i["plan_time"].ToString());
order.status = i["status"].ToString();
order.process_id = i["route_code"].ToString();
order.attr1 = i["attr1"].ToString();
order.totalCount = i["totalCount"].ToString();
order.shift_id = i["Shift_Desc"].ToString();
if (i["start_work_time"] != DBNull.Value && !string.IsNullOrEmpty(i["start_work_time"].ToString()))
{
order.start_work_time = Convert.ToDateTime(i["start_work_time"].ToString());
}
if (i["end_work_time"] != DBNull.Value && !string.IsNullOrEmpty(i["end_work_time"].ToString()))
{
order.end_work_time = Convert.ToDateTime(i["end_work_time"].ToString());
}
orderList.Add(order);
}
this.dgWorkOrderInfo.ItemsSource = null;
this.dgWorkOrderInfo.ItemsSource = orderList;//dt.DefaultView;
}
else
{
MessageBox.Show("失败");
}
}
}
}
private void end_Click(object sender, RoutedEventArgs e)
{
List<FoamingMacModel> orderList = new List<FoamingMacModel>();
var sele = dgWorkOrderInfo.SelectedItem as FoamingMacModel;
if (sele != null)
{
var result = MessageBox.Show("确定要结束该工单吗?", "确认", MessageBoxButton.YesNo, MessageBoxImage.Question);
if (result == MessageBoxResult.Yes)
{
var aaa= formingMachineService.uporderendtime(sele.workorder_id);
if (aaa > 0)
{
start.Visibility = Visibility.Collapsed;
end.Visibility = Visibility.Collapsed;
MessageBox.Show("工单已结束");
DataTable dt = formingMachineService.GetFormingMachineInfo(deviceCode, LoginUser.WorkDate);
if (dt == null) return;
foreach (DataRow i in dt.Rows)
{
FoamingMacModel order = new FoamingMacModel();
order.workorder_id = i["workorder_id"].ToString();
order.workorder_code = i["workorder_code"].ToString();
order.product_name = i["product_name"].ToString();
order.product_code = i["product_code"].ToString();
order.car_num = Convert.ToInt32(i["car_num"].ToString());
order.plan_time = Convert.ToDateTime(i["plan_time"].ToString());
order.status = i["status"].ToString();
order.process_id = i["route_code"].ToString();
order.attr1 = i["attr1"].ToString();
order.totalCount = i["totalCount"].ToString();
order.shift_id = i["Shift_Desc"].ToString();
if (i["start_work_time"] != DBNull.Value && !string.IsNullOrEmpty(i["start_work_time"].ToString()))
{
order.start_work_time = Convert.ToDateTime(i["start_work_time"].ToString());
}
if (i["end_work_time"] != DBNull.Value && !string.IsNullOrEmpty(i["end_work_time"].ToString()))
{
order.end_work_time = Convert.ToDateTime(i["end_work_time"].ToString());
}
orderList.Add(order);
}
this.dgWorkOrderInfo.ItemsSource = null;
this.dgWorkOrderInfo.ItemsSource = orderList;//dt.DefaultView;
}
else
{
MessageBox.Show("失败");
}
}
}
}
}
}

File diff suppressed because one or more lines are too long

@ -10,7 +10,7 @@
<!--车间编码-->
<add key="SiteCode" value="1000" />
<!--设备编码-->
<add key="DeviceCode" value="XL02" />
<add key="DeviceCode" value="XL05" />
<!--上位机类型 0:工单准备1成型机\shoupei2烘房,3:人员登录,4:称重系统-->
<add key="ClientMode" value="1" />

@ -369,8 +369,7 @@
Margin="20,0"
Click="ReadOrder_Click"
Content="获取"
Style="{StaticResource btnKey}"
Visibility="Collapsed" />
Style="{StaticResource btnKey}" />
</StackPanel>
<StackPanel
Grid.Row="2"
@ -575,6 +574,11 @@
Binding="{Binding qty}"
Header="实际用量"
IsReadOnly="False" />
<DataGridTextColumn
Width="120"
Binding="{Binding wastage}"
Header="损耗"
IsReadOnly="False" />
<DataGridTextColumn
Width="100"
Binding="{Binding parent_work_order}"

@ -48,6 +48,7 @@ namespace XGLFinishPro.Views
public bool? _isEndReport = false;
public string _deviceCode = "";
public string _siteCode = "";
public string _lossCode = "";
DataRowView selectedRow = null;
int sortNo = 0; //定义一个整数,记录子集级数
@ -508,15 +509,18 @@ namespace XGLFinishPro.Views
if (_isEndReport.Value == true || selectedRow["status"].ToString().Equals("w4"))//20240424添加预报工功能暂停状态下添加消耗数据录入功能
{
CreateBaseQty();//将=0的根据公式填充进去
//CreateBaseWastage();//将=0的根据公式填充进去/
foreach (var row in dgConsumeInfo.Items)
{
var selectedConsumeRow = (row as DataRowView);
var qty = selectedConsumeRow["qty"].ToString() == "" ? "0" : selectedConsumeRow["qty"].ToString();
var wastage = selectedConsumeRow["wastage"].ToString() == "" ? "0" : selectedConsumeRow["wastage"].ToString();
var remark = selectedConsumeRow["remark"].ToString();
string insertConsumeSql = formingMachineService.GetInsertConsumeInfoSql(selectedConsumeRow, newReportCode, _siteCode);
string insertConsumeSql = formingMachineService.GetMergeConsumeInfoSql(selectedConsumeRow, newReportCode, _siteCode);
reportWorkSqlList.Add(insertConsumeSql);
LogHelper.instance.log.Error("报工SQL生成" + insertConsumeSql);
#region
@ -829,6 +833,22 @@ namespace XGLFinishPro.Views
}
}
//private void CreateBaseWastage()
//{
// if (_siteCode == "")
// return;
// //生成推荐实际消耗量
// double rate = GetOrderRate();
// if (rate == 0)
// return;
// foreach (System.Data.DataRow item in dtCosumeData.Rows)
// {
// //变更为只有等于0的时候才填值
// if (item["wastage"].ToString().Equals("0"))
// item["wastage"] = Math.Round(Convert.ToDouble(item["wastage"]) * rate, 2);
// }
//}
private void txtQuantity_TextChanged(object sender, TextChangedEventArgs e)
{
if (!Regex.IsMatch(this.txtQuantity.Text, @"^\d+(\.\d+)?$"))
@ -1035,29 +1055,49 @@ namespace XGLFinishPro.Views
{
}
private bool IsReading = false;
private void ReadOrder_Click(object sender, RoutedEventArgs e)
{
int count = 0;
bool isSuccess = false;
while (count++ < 3)
try
{
try
if (IsReading)
{
LanJu_Operator.plc.Connection(LanJu_Operator.PlcIp);
int number = int.Parse(_deviceCode.Substring(2));
isSuccess = true;
break;
return;
}
catch
IsReading = true;
LanJu_Operator.plc.Connection(LanJu_Operator.PlcIp);
int number = int.Parse(_deviceCode.Substring(2));
DataTable dataTable = formingMachineService.GetWcsPlcPointBoxCount("BoxCount" + number);
if (dataTable != null && dataTable.Rows.Count > 0)
{
LanJu_Operator.plc = new PlcHelper();
string address = dataTable.Rows[0]["plc_point_address"].ToString();
var boxCount = LanJu_Operator.plc.Read(new CentralControl.BaseData.PlcSetting
{
PlcAddress = address,
PlcDataType = 1,
PlcValueLength = "2"
});
if (boxCount != null && int.TryParse(boxCount.ToString(), out int count))
{
txtQuantity.Text = boxCount.ToString();
}
else
{
CustomMessageBox.Show("读取失败!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
}
}
else
{
CustomMessageBox.Show("获取点位信息失败!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
}
}
if (!isSuccess)
catch
{
CustomMessageBox.Show("读取失败!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
CustomMessageBox.Show("Plc连接失败", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
}
finally
{
IsReading = false;
}
}
}

@ -0,0 +1,13 @@
<Window x:Class="XGLFinishPro.Views.InputNumberDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="叫料数量" Height="180" Width="300" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
<StackPanel Margin="20">
<TextBlock Text="请输入叫料数量:" Margin="0,0,0,10"/>
<TextBox x:Name="txtNumber" PreviewTextInput="txtNumber_PreviewTextInput" Width="200" MaxLength="8"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,20,0,0">
<Button Content="确定" Width="60" Margin="0,0,10,0" Click="BtnOk_Click"/>
<Button Content="取消" Width="60" Click="BtnCancel_Click"/>
</StackPanel>
</StackPanel>
</Window>

@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace XGLFinishPro.Views
{
/// <summary>
/// InputNumberDialog.xaml 的交互逻辑
/// </summary>
public partial class InputNumberDialog : Window
{
public string InputValue { get; private set; }
public InputNumberDialog()
{
InitializeComponent();
}
private void BtnOk_Click(object sender, RoutedEventArgs e)
{
InputValue = txtNumber.Text;
DialogResult = true;
}
private void BtnCancel_Click(object sender, RoutedEventArgs e)
{
DialogResult = false;
}
private void txtNumber_PreviewTextInput(object sender, TextCompositionEventArgs e)
{
// 只允许输入数字
e.Handled = !Regex.IsMatch(e.Text, "^[0-9]+$");
}
}
}

@ -1,17 +1,19 @@
<Window x:Class="XGLFinishPro.Views.LanJu_Check_Report"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:XGLFinishPro.Views"
mc:Ignorable="d"
WindowStyle="None"
WindowState="Maximized"
Loaded="Window_Loaded"
Height="1000" Width="1900">
<Window
x:Class="XGLFinishPro.Views.LanJu_Check_Report"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:XGLFinishPro.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Width="1900"
Height="1000"
Loaded="Window_Loaded"
WindowState="Maximized"
WindowStyle="None"
mc:Ignorable="d">
<Window.Resources>
<ResourceDictionary>
<Style TargetType="ComboBox" BasedOn="{x:Null}">
<Style BasedOn="{x:Null}" TargetType="ComboBox">
<Setter Property="Width" Value="50" />
<Setter Property="Height" Value="30" />
<Setter Property="VerticalAlignment" Value="Center" />
@ -23,45 +25,48 @@
<Setter.Value>
<ControlTemplate TargetType="ComboBox">
<Grid x:Name="TogGrid">
<ToggleButton x:Name="ToggleButton"
ClickMode="Press"
Focusable="false"
Click="ToggleButton_Click"
FontSize="{TemplateBinding FontSize}"
VerticalAlignment="{TemplateBinding VerticalAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"
Content="{TemplateBinding SelectionBoxItem}"
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<ToggleButton
x:Name="ToggleButton"
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Click="ToggleButton_Click"
ClickMode="Press"
Focusable="false"
FontSize="{TemplateBinding FontSize}">
<ContentPresenter
HorizontalAlignment="Center"
VerticalAlignment="Center"
Content="{TemplateBinding SelectionBoxItem}"
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</ToggleButton>
<Popup x:Name="Popup"
Placement="Bottom"
IsOpen="{TemplateBinding IsDropDownOpen}"
AllowsTransparency="True"
Focusable="False"
PopupAnimation="Slide">
<Grid x:Name="DropDown"
SnapsToDevicePixels="True"
MinWidth="{TemplateBinding ActualWidth}"
MaxHeight="200">
<Border x:Name="DropDownBorder"
Background="White"
BorderThickness="1"
BorderBrush="Gray" />
<ScrollViewer Margin="4,6,4,6"
SnapsToDevicePixels="True">
<StackPanel IsItemsHost="True"
KeyboardNavigation.DirectionalNavigation="Contained" />
<Popup
x:Name="Popup"
AllowsTransparency="True"
Focusable="False"
IsOpen="{TemplateBinding IsDropDownOpen}"
Placement="Bottom"
PopupAnimation="Slide">
<Grid
x:Name="DropDown"
MinWidth="{TemplateBinding ActualWidth}"
MaxHeight="200"
SnapsToDevicePixels="True">
<Border
x:Name="DropDownBorder"
Background="White"
BorderBrush="Gray"
BorderThickness="1" />
<ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True">
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
</ScrollViewer>
</Grid>
</Popup>
@ -82,7 +87,7 @@
<Trigger Property="IsGrouping" Value="true">
<Setter Property="ScrollViewer.CanContentScroll" Value="false" />
</Trigger>
<!-- 新增的Trigger用于在选择完成后将按钮颜色变回原来的颜色 -->
<!-- 新增的Trigger用于在选择完成后将按钮颜色变回原来的颜色 -->
<Trigger Property="IsDropDownOpen" Value="false">
<Setter TargetName="ToggleButton" Property="Background" Value="White" />
</Trigger>
@ -92,10 +97,10 @@
</Setter>
</Style>
<Style x:Key="TextBlockStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="25"/>
<Setter Property="Margin" Value="10,0,8,0"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="FontSize" Value="25" />
<Setter Property="Margin" Value="10,0,8,0" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
</Style>
<Style x:Key="CheckBoxStyle" TargetType="{x:Type CheckBox}">
<Setter Property="HorizontalAlignment" Value="Center" />
@ -110,44 +115,136 @@
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto" />
<RowDefinition Height="*" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Content="产品转换/完产清线点检表" Grid.RowSpan="2" Grid.Column="1" VerticalAlignment="Center" FontWeight="Bold" FontSize="40" HorizontalAlignment="Center" />
<StackPanel Orientation="Horizontal" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center">
<Button Content="刷新" Background="#2B7EE6" Foreground="White" Width="100" FontSize="20" Height="50" Margin="10" Click="Refresh_Click"/>
<Button x:Name="Add" Content="新增一列" Background="#2B7EE6" Foreground="White" Width="100" FontSize="20" Height="50" Margin="10" Click="Add_Click"/>
<Button x:Name="IsFinalSubmit" Content="最终提交" Background="Red" Foreground="White" Width="100" FontSize="20" Height="50" Margin="10" Click="Submit_Click"/>
<Button x:Name="Commit" Content="提交" Background="#2B7EE6" Foreground="White" Width="100" FontSize="20" Height="50" Margin="10" Click="Submit_Click"/>
<Button Content="关闭" Background="#2B7EE6" Foreground="White" Width="100" FontSize="20" Height="50" Margin="10" Click="Close_Click"/>
<Label
Grid.RowSpan="2"
Grid.Column="1"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Content="产品转换/完产清线点检表"
FontSize="40"
FontWeight="Bold" />
<StackPanel
Grid.Column="2"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Horizontal">
<Button
Width="100"
Height="50"
Margin="10"
Background="#2B7EE6"
Click="Refresh_Click"
Content="刷新"
FontSize="20"
Foreground="White" />
<Button
x:Name="Add"
Width="100"
Height="50"
Margin="10"
Background="#2B7EE6"
Click="Add_Click"
Content="新增一列"
FontSize="20"
Foreground="White" />
<Button
x:Name="IsFinalSubmit"
Width="100"
Height="50"
Margin="10"
Background="Red"
Click="Submit_Click"
Content="最终提交"
FontSize="20"
Foreground="White" />
<Button
x:Name="Commit"
Width="100"
Height="50"
Margin="10"
Background="#2B7EE6"
Click="Submit_Click"
Content="保存"
FontSize="20"
Foreground="White" />
<Button
Width="100"
Height="50"
Margin="10"
Background="#2B7EE6"
Click="Close_Click"
Content="关闭"
FontSize="20"
Foreground="White" />
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Column="2" Grid.Row="2" VerticalAlignment="Bottom" HorizontalAlignment="Right">
<Label Content="表单编号:" FontSize="25"/>
<Label x:Name="OrderCode" Content="08GL05C001-014A" FontSize="25"/>
<StackPanel
Grid.Row="2"
Grid.Column="2"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Orientation="Horizontal">
<Label Content="表单编号:" FontSize="25" />
<Label
x:Name="OrderCode"
Content="08GL05C001-014A"
FontSize="25" />
</StackPanel>
</Grid>
<Grid x:Name="MainGrid" Grid.Row="1" Margin="10,10,10,0"/>
<StackPanel Orientation="Horizontal" Grid.Row="2" Margin="10,10,10,0">
<Grid
x:Name="MainGrid"
Grid.Row="1"
Margin="10,10,10,0" />
<StackPanel
Grid.Row="2"
Margin="10,10,10,0"
Orientation="Horizontal">
<StackPanel Orientation="Vertical">
<TextBlock Text="填写要求" Style="{StaticResource TextBlockStyle}" HorizontalAlignment="Left" />
<TextBlock Text="1.产线组长在开线、品种转换时填写该表," Style="{StaticResource TextBlockStyle}" HorizontalAlignment="Left" />
<TextBlock Text="2.在“口”中勾选类别。" Style="{StaticResource TextBlockStyle}" HorizontalAlignment="Left" />
<TextBlock Text="3.“点检结果”是填“√”否填“x”,若有异常则填写实际情况。" Style="{StaticResource TextBlockStyle}" HorizontalAlignment="Left" />
<TextBlock
HorizontalAlignment="Left"
Style="{StaticResource TextBlockStyle}"
Text="填写要求" />
<TextBlock
HorizontalAlignment="Left"
Style="{StaticResource TextBlockStyle}"
Text="1.产线组长在开线、品种转换时填写该表," />
<TextBlock
HorizontalAlignment="Left"
Style="{StaticResource TextBlockStyle}"
Text="2.在“口”中勾选类别。" />
<TextBlock
HorizontalAlignment="Left"
Style="{StaticResource TextBlockStyle}"
Text="3.“点检结果”是填“√”否填“x”,若有异常则填写实际情况。" />
</StackPanel>
<StackPanel Width="500" Margin="600,0,0,20" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom">
<TextBlock Text="班组长签字:" Style="{StaticResource TextBlockStyle}" HorizontalAlignment="Right" />
<TextBlock x:Name="NickName" Text="" Style="{StaticResource TextBlockStyle}" HorizontalAlignment="Right" />
<StackPanel
Width="500"
Margin="600,0,0,20"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Orientation="Horizontal">
<TextBlock
HorizontalAlignment="Right"
Style="{StaticResource TextBlockStyle}"
Text="班组长签字:" />
<TextBlock
x:Name="NickName"
HorizontalAlignment="Right"
Style="{StaticResource TextBlockStyle}"
Text="" />
</StackPanel>
</StackPanel>
</Grid>

@ -44,6 +44,8 @@ namespace XGLFinishPro.Views
private readonly List<string> _minutes = new List<string> { "00", "05", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55" };
private string LineStr = "";
private readonly List<string> teamGroup = new List<string>() { "A", "B", "C", "D", "E", "F" };
private string shiftName = string.Empty;
private string shiftCode = LoginUser.ShiftCode;
public LanJu_Check_Report()
{
InitializeComponent();
@ -59,6 +61,7 @@ namespace XGLFinishPro.Views
{
this.NickName.Text = LoginUser.UserName;
LineStr = dbService.GetBaseEquipment(Utils.GetAppSetting("DeviceCode"));
shiftName = dbService.GetShiftById(shiftCode);
LoadData();
}
@ -85,7 +88,7 @@ namespace XGLFinishPro.Views
}
list.ForEach(t => t.value = t.value.Insert(0, "A"));
mesTableSelf = dbService.GetMesTableSelf(deviceCode, null, date, "CheckReport");
mesTableSelf = dbService.GetMesTableSelf(deviceCode, null, date, "CheckReport" + shiftName);
if (mesTableSelf == null)
{
mesTableSelf = new MesTableSelf()
@ -98,7 +101,7 @@ namespace XGLFinishPro.Views
del_flag = "0",
product_date = date,
bz = string.Empty,
report_name = "CheckReport"
report_name = "CheckReport" + shiftName
};
dbService.InsertMesTableSelf(mesTableSelf);
}

@ -123,7 +123,7 @@
<Button Content="刷新" Background="#2B7EE6" Foreground="White" Width="100" FontSize="20" Height="50" Margin="10" Click="Refresh_Click"/>
<Button x:Name="Add" Content="新增一列" Background="#2B7EE6" Foreground="White" Width="100" FontSize="20" Height="50" Margin="10" Click="Add_Click"/>
<Button x:Name="IsFinalSubmit" Content="最终提交" Background="Red" Foreground="White" Width="100" FontSize="20" Height="50" Margin="10" Click="Submit_Click"/>
<Button x:Name="Commit" Content="提交" Background="#2B7EE6" Foreground="White" Width="100" FontSize="20" Height="50" Margin="10" Click="Submit_Click"/>
<Button x:Name="Commit" Content="保存" Background="#2B7EE6" Foreground="White" Width="100" FontSize="20" Height="50" Margin="10" Click="Submit_Click"/>
<Button Content="关闭" Background="#2B7EE6" Foreground="White" Width="100" FontSize="20" Height="50" Margin="10" Click="Close_Click"/>
</StackPanel>

@ -47,6 +47,8 @@ namespace XGLFinishPro.Views
private string workId = string.Empty;
private string productName = string.Empty;
private bool IsFinal = false;
private string shiftName = string.Empty;
private string shiftCode = LoginUser.ShiftCode;
public LanJu_Conversion_Report()
{
InitializeComponent();
@ -95,6 +97,7 @@ namespace XGLFinishPro.Views
//this.CheckDate.Text = date;
try
{
shiftName = dbService.GetShiftById(shiftCode);
this.Line.Text = dbService.GetBaseEquipment(Utils.GetAppSetting("DeviceCode"));
product_code = string.Empty;
DataTable dataTable = dbService.GetProOrderWorkorder(workId);
@ -173,7 +176,7 @@ namespace XGLFinishPro.Views
}
TypeDic = mainTypeDic;
mesTableSelf = null;
mesTableSelf = dbService.GetMesTableSelf(deviceCode, productName, this.CheckDate.Text, "ConversionReport");
mesTableSelf = dbService.GetMesTableSelf(deviceCode, productName, this.CheckDate.Text, "ConversionReport"+ shiftName);
if (mesTableSelf == null)
{
mesTableSelf = new MesTableSelf()
@ -187,7 +190,7 @@ namespace XGLFinishPro.Views
del_flag = "0",
product_date = this.CheckDate.Text,
bz = string.Empty,
report_name = "ConversionReport"
report_name = "ConversionReport"+ shiftName
};
if (!string.IsNullOrEmpty(productName))
{

@ -135,7 +135,7 @@
<Button Content="刷新" Background="#2B7EE6" Foreground="White" Width="100" FontSize="20" Height="50" Margin="10" Click="Refresh_Click"/>
<Button x:Name="Add" Content="新增一列" Background="#2B7EE6" Foreground="White" Width="100" FontSize="20" Height="50" Margin="10" Click="Add_Click"/>
<Button x:Name="IsFinalSubmit" Content="最终提交" Background="Red" Foreground="White" Width="100" FontSize="20" Height="50" Margin="10" Click="Submit_Click"/>
<Button x:Name="Commit" Content="提交" Background="#2B7EE6" Foreground="White" Width="100" FontSize="20" Height="50" Margin="10" Click="Submit_Click"/>
<Button x:Name="Commit" Content="保存" Background="#2B7EE6" Foreground="White" Width="100" FontSize="20" Height="50" Margin="10" Click="Submit_Click"/>
<Button Content="关闭" Background="#2B7EE6" Foreground="White" Width="100" FontSize="20" Height="50" Margin="10" Click="Close_Click"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Column="0" Grid.Row="0">

@ -55,6 +55,8 @@ namespace XGLFinishPro.Views
private string workId = string.Empty;
private string date = string.Empty;
private string shiftName = string.Empty;
private string shiftCode = LoginUser.ShiftCode;
public LanJu_First_Inspection_Reprot()
{
@ -70,6 +72,7 @@ namespace XGLFinishPro.Views
try
{
this.LeftCheckDate.SelectedDate = DateTime.Parse(LoginUser.WorkDate);
shiftName = dbService.GetShiftById(shiftCode);
}
catch
{
@ -90,177 +93,219 @@ namespace XGLFinishPro.Views
private void LoadData(bool addLine = false)
{
isUpdate = true;
list.Clear();
DataTable dataTable = dbService.GetProOrderWorkorder(workId);
if (dataTable != null && dataTable.Rows.Count > 0)
try
{
//LProductName = dataTable.Rows[0]["product_name"].ToString();
//this.RightProductName.Text = dataTable.Rows[0]["product_name"].ToString();
product_code = dataTable.Rows[0]["product_code"].ToString();
}
var leftHearList = dbService.GetSelfCheckInfo("first_inspection_left").OrderBy(t => t.dict_sort).ToList();
var leftMainList = dbService.GetSelfCheckInfo("first_inspection_left_info").OrderBy(t => t.dict_sort).ToList();
var rightHearList = dbService.GetSelfCheckInfo("first_inspection_right").OrderBy(t => t.dict_sort).ToList();
var rightMainList = dbService.GetSelfCheckInfo("first_inspection_right_info").OrderBy(t => t.dict_sort).ToList();
isUpdate = true;
list.Clear();
DataTable dataTable = dbService.GetProOrderWorkorder(workId);
if (dataTable == null || dataTable.Rows.Count == 0)
{
Console.WriteLine("[Error] 未获取到工单信息workId: " + workId);
LogHelper.instance.log.Error("[Error] 未获取到工单信息workId: " + workId);
}
else
{
if (dataTable.Rows.Count > 0)
{
product_code = dataTable.Rows[0]["product_code"].ToString();
}
}
var leftHearList = dbService.GetSelfCheckInfo("first_inspection_left").OrderBy(t => t.dict_sort).ToList();
if (leftHearList == null || !leftHearList.Any())
{
Console.WriteLine("[Error] 未获取到左侧检查信息。");
LogHelper.instance.log.Error("[Error] 未获取到左侧检查信息。");
}
var leftMainList = dbService.GetSelfCheckInfo("first_inspection_left_info").OrderBy(t => t.dict_sort).ToList();
if (leftMainList == null || !leftMainList.Any())
{
Console.WriteLine("[Error] 未获取到左侧主检查信息。");
LogHelper.instance.log.Error("[Error] 未获取到左侧主检查信息。");
}
var rightHearList = dbService.GetSelfCheckInfo("first_inspection_right").OrderBy(t => t.dict_sort).ToList();
if (rightHearList == null || !rightHearList.Any())
{
Console.WriteLine("[Error] 未获取到右侧检查信息。");
LogHelper.instance.log.Error("[Error] 未获取到右侧检查信息。");
}
var rightMainList = dbService.GetSelfCheckInfo("first_inspection_right_info").OrderBy(t => t.dict_sort).ToList();
if (rightMainList == null || !rightMainList.Any())
{
Console.WriteLine("[Error] 未获取到右侧主检查信息。");
LogHelper.instance.log.Error("[Error] 未获取到右侧主检查信息。");
}
GetMesTableSeft();
leftData = dbService.GetMesTableSelfDetial(leftbelong_to, 6);
rightData = dbService.GetMesTableSelfDetial(rightbelong_to, 6);
if (addLine)
{
int leftLine = leftData.Max(t => t.table_line) + 1;
leftData.ForEach(t => { t.index++; });
leftData.Insert(0, new MesTableSelfDetialModel() { index = 0 });
leftData.RemoveAll(t => t.index == 6);
GetMesTableSeft();
leftData = dbService.GetMesTableSelfDetial(leftbelong_to, 6);
if (leftData == null || !leftData.Any())
{
Console.WriteLine("[Error] 未获取到左侧详细检查数据。");
LogHelper.instance.log.Error("[Error] 未获取到左侧详细检查数据。");
}
rightData = dbService.GetMesTableSelfDetial(rightbelong_to, 6);
if (rightData == null || !rightData.Any())
{
Console.WriteLine("[Error] 未获取到右侧详细检查数据。");
LogHelper.instance.log.Error("[Error] 未获取到右侧详细检查数据。");
}
int rightLine = rightData.Max(t => t.table_line) + 1;
rightData.ForEach(t => { t.index++; });
rightData.Insert(0, new MesTableSelfDetialModel() { index = 0 });
rightData.RemoveAll(t => t.index == 6);
}
if (addLine)
{
int leftLine = leftData.Max(t => t.table_line) + 1;
leftData.ForEach(t => { t.index++; });
leftData.Insert(0, new MesTableSelfDetialModel() { index = 0 });
leftData.RemoveAll(t => t.index == 6);
int rightLine = rightData.Max(t => t.table_line) + 1;
rightData.ForEach(t => { t.index++; });
rightData.Insert(0, new MesTableSelfDetialModel() { index = 0 });
rightData.RemoveAll(t => t.index == 6);
}
for (var i = 0; i < 7; i++)
{
foreach (var item in leftHearList)
{
bool hasData = leftData.Where(t => t.index == i && t.info_name == item.dict_label).Any();
if (!hasData)
{
int tableLine = 0;
MesTableSelfDetialModel mesTableSelfDetialModel = leftData.Where(t => t.index == i).Where(t => t.table_line != 0).FirstOrDefault();
if (mesTableSelfDetialModel != null)
{
tableLine = mesTableSelfDetialModel.table_line;
}
else
{
try
{
tableLine = leftData.Max(t => t.table_line) + 1;
}
catch
{
for (var i = 0; i < 7; i++)
{
}
}
leftData.Add(new MesTableSelfDetialModel()
{
index = i,
table_line = tableLine,
info_name = item.dict_label,
info_code = leftHearList.FirstOrDefault(t => t.dict_label == item.dict_label)?.dict_code,
});
list.Add(new ConveterData()
{
label = item.dict_label,
value = MD5Provider.Hash(item.dict_label),
});
}
}
foreach (var item in rightHearList)
{
bool hasData = rightData.Where(t => t.index == i && t.info_name == item.dict_label).Any();
if (!hasData)
{
int tableLine = 0;
MesTableSelfDetialModel mesTableSelfDetialModel = rightData.Where(t => t.index == i).Where(t => t.table_line != 0).FirstOrDefault();
if (mesTableSelfDetialModel != null)
{
tableLine = mesTableSelfDetialModel.table_line;
}
else
{
try
{
tableLine = rightData.Max(t => t.table_line) + 1;
}
catch
{
}
}
rightData.Add(new MesTableSelfDetialModel()
{
index = i,
table_line = tableLine,
info_name = item.dict_label,
info_code = rightHearList.FirstOrDefault(t => t.dict_label == item.dict_label)?.dict_code,
});
list.Add(new ConveterData()
{
label = item.dict_label,
value = MD5Provider.Hash(item.dict_label),
});
}
}
}
var leftDic = new Dictionary<string, Dictionary<int, MesTableSelfDetialModel>>();
foreach (var item in leftData)
{
if (item.info_name == null || leftDic.Keys.Contains(item.info_name))
{
continue;
}
var mesTableSelfDetialModels = leftData.Where(t => t.info_name == item.info_name).ToList();
var dictionary = mesTableSelfDetialModels.ToDictionary(t => t.index);
leftDic.Add(item.info_name, dictionary);
}
var rightDic = new Dictionary<string, Dictionary<int, MesTableSelfDetialModel>>();
foreach (var item in rightData)
{
if (item.info_name == null || rightDic.Keys.Contains(item.info_name))
{
continue;
}
var mesTableSelfDetialModels = rightData.Where(t => t.info_name == item.info_name).ToList();
var dictionary = mesTableSelfDetialModels.ToDictionary(t => t.index);
rightDic.Add(item.info_name, dictionary);
}
list.ForEach(t => t.value.Remove(9, 11));
list.ForEach(t => t.value = t.value.Insert(0, "A"));
MakeHeaderData(this.Left);
//MakeHeaderData(this.Right);
var leftTypeDic = new Dictionary<string, List<string>>();
foreach (var item in leftHearList)
{
bool hasData = leftData.Where(t => t.index == i && t.info_name == item.dict_label).Any();
if (!hasData)
var defaultDic = leftMainList.Where(t => string.IsNullOrEmpty(t.remark)).Select(t => t.dict_value).ToList();
var typeDic = leftMainList.Where(t => t.remark == item.dict_label).Select(t => t.dict_value).ToList();
defaultDic.AddRange(typeDic);
if (!leftTypeDic.ContainsKey(item.dict_label))
{
int tableLine = 0;
MesTableSelfDetialModel mesTableSelfDetialModel = leftData.Where(t => t.index == i).Where(t => t.table_line != 0).FirstOrDefault();
if (mesTableSelfDetialModel != null)
{
tableLine = mesTableSelfDetialModel.table_line;
}
else
{
try
{
tableLine = leftData.Max(t => t.table_line) + 1;
}
catch
{
}
}
leftData.Add(new MesTableSelfDetialModel()
{
index = i,
table_line = tableLine,
info_name = item.dict_label,
info_code = leftHearList.FirstOrDefault(t => t.dict_label == item.dict_label)?.dict_code,
});
list.Add(new ConveterData()
{
label = item.dict_label,
value = MD5Provider.Hash(item.dict_label),
});
leftTypeDic.Add(item.dict_label, defaultDic);
}
}
var rightTypeDic = new Dictionary<string, List<string>>();
foreach (var item in rightHearList)
{
bool hasData = rightData.Where(t => t.index == i && t.info_name == item.dict_label).Any();
if (!hasData)
var defaultDic = rightMainList.Where(t => string.IsNullOrEmpty(t.remark)).Select(t => t.dict_value).ToList();
var typeDic = rightMainList.Where(t => t.remark == item.dict_label).Select(t => t.dict_value).ToList();
defaultDic.AddRange(typeDic);
if (!rightTypeDic.ContainsKey(item.dict_label))
{
int tableLine = 0;
MesTableSelfDetialModel mesTableSelfDetialModel = rightData.Where(t => t.index == i).Where(t => t.table_line != 0).FirstOrDefault();
if (mesTableSelfDetialModel != null)
{
tableLine = mesTableSelfDetialModel.table_line;
}
else
{
try
{
tableLine = rightData.Max(t => t.table_line) + 1;
}
catch
{
}
}
rightData.Add(new MesTableSelfDetialModel()
{
index = i,
table_line = tableLine,
info_name = item.dict_label,
info_code = rightHearList.FirstOrDefault(t => t.dict_label == item.dict_label)?.dict_code,
});
list.Add(new ConveterData()
{
label = item.dict_label,
value = MD5Provider.Hash(item.dict_label),
});
rightTypeDic.Add(item.dict_label, defaultDic);
}
}
MainValueData(this.Left, leftHearList, leftDic, leftTypeDic);
//MainValueData(this.Right, rightHearList, rightDic, rightTypeDic);
UpdateUi(this.Left);
//UpdateUi(this.Right);
isUpdate = false;
}
var leftDic = new Dictionary<string, Dictionary<int, MesTableSelfDetialModel>>();
foreach (var item in leftData)
catch (Exception ex)
{
if (item.info_name == null || leftDic.Keys.Contains(item.info_name))
{
continue;
}
var mesTableSelfDetialModels = leftData.Where(t => t.info_name == item.info_name).ToList();
var dictionary = mesTableSelfDetialModels.ToDictionary(t => t.index);
leftDic.Add(item.info_name, dictionary);
LogHelper.instance.log.Error("[Error] 加载数据异常!" + ex.Message);
}
var rightDic = new Dictionary<string, Dictionary<int, MesTableSelfDetialModel>>();
foreach (var item in rightData)
{
if (item.info_name == null || rightDic.Keys.Contains(item.info_name))
{
continue;
}
var mesTableSelfDetialModels = rightData.Where(t => t.info_name == item.info_name).ToList();
var dictionary = mesTableSelfDetialModels.ToDictionary(t => t.index);
rightDic.Add(item.info_name, dictionary);
}
list.ForEach(t => t.value.Remove(9, 11));
list.ForEach(t => t.value = t.value.Insert(0, "A"));
MakeHeaderData(this.Left);
//MakeHeaderData(this.Right);
var leftTypeDic = new Dictionary<string, List<string>>();
foreach (var item in leftHearList)
{
var defaultDic = leftMainList.Where(t => string.IsNullOrEmpty(t.remark)).Select(t => t.dict_value).ToList();
var typeDic = leftMainList.Where(t => t.remark == item.dict_label).Select(t => t.dict_value).ToList();
defaultDic.AddRange(typeDic);
if (!leftTypeDic.ContainsKey(item.dict_label))
{
leftTypeDic.Add(item.dict_label, defaultDic);
}
}
var rightTypeDic = new Dictionary<string, List<string>>();
foreach (var item in rightHearList)
{
var defaultDic = rightMainList.Where(t => string.IsNullOrEmpty(t.remark)).Select(t => t.dict_value).ToList();
var typeDic = rightMainList.Where(t => t.remark == item.dict_label).Select(t => t.dict_value).ToList();
defaultDic.AddRange(typeDic);
if (!rightTypeDic.ContainsKey(item.dict_label))
{
rightTypeDic.Add(item.dict_label, defaultDic);
}
}
MainValueData(this.Left, leftHearList, leftDic, leftTypeDic);
//MainValueData(this.Right, rightHearList, rightDic, rightTypeDic);
UpdateUi(this.Left);
//UpdateUi(this.Right);
isUpdate = false;
}
private MesTableSelf leftmesTableSelf;
private void GetMesTableSeft()
{
leftmesTableSelf = dbService.GetMesTableSelf(deviceCode, LProductName, this.LeftCheckDate.Text, "ConversionReportLeft");
leftmesTableSelf = dbService.GetMesTableSelf(deviceCode, LProductName, this.LeftCheckDate.Text, "ConversionReportLeft"+ shiftName);
if (leftmesTableSelf == null)
{
if (!string.IsNullOrEmpty(LProductName))
@ -276,7 +321,7 @@ namespace XGLFinishPro.Views
del_flag = "0",
product_date = this.LeftCheckDate.Text,
bz = string.Empty,
report_name = "ConversionReportLeft"
report_name = "ConversionReportLeft"+ shiftName
};
}
dbService.InsertMesTableSelf(leftmesTableSelf);
@ -868,6 +913,7 @@ namespace XGLFinishPro.Views
private void Submit_Click(object sender, RoutedEventArgs e)
{
bool isSuccess = false;
string isFinal = "0";
if (sender is Button button)
{
@ -894,6 +940,7 @@ namespace XGLFinishPro.Views
});
foreach (var item in leftData)
{
int resultLeft = 0;
if (item.table_line == 0)
{
item.table_line = 1;
@ -905,15 +952,21 @@ namespace XGLFinishPro.Views
var mesTableSelfDetialModel = tempLeftData.FirstOrDefault(t => t.id == item.id);
if (mesTableSelfDetialModel == null)
{
dbService.InsertMesTableSelfDetial(item);
resultLeft = dbService.InsertMesTableSelfDetial(item);
}
else
{
dbService.UpdateMesTableSelfDetial(item);
resultLeft = dbService.UpdateMesTableSelfDetial(item);
}
if (resultLeft > 0)
{
isSuccess = true;
}
}
foreach (var item in rightData)
{
int resultRight = 0;
if (item.table_line == 0)
{
item.table_line = 1;
@ -925,16 +978,29 @@ namespace XGLFinishPro.Views
var mesTableSelfDetialModel = tempRightData.FirstOrDefault(t => t.id == item.id);
if (mesTableSelfDetialModel == null)
{
dbService.InsertMesTableSelfDetial(item);
resultRight = dbService.InsertMesTableSelfDetial(item);
}
else
{
dbService.UpdateMesTableSelfDetial(item);
resultRight = dbService.UpdateMesTableSelfDetial(item);
}
if (resultRight > 0)
{
isSuccess = true;
}
}
dbService.UpdateMesTableSelf(leftbelong_to, "", LoginUser.UserName, isFinal);
//dbService.UpdateMesTableSelf(rightbelong_to, "", LoginUser.UserName);
MessageBox.Show("提交成功!");
if (isSuccess)
{
MessageBox.Show("保存成功!");
}
else
{
MessageBox.Show("保存失败!");
LogHelper.instance.log.Error("[Error] 保存失败!");
}
LoadData();
}
@ -955,33 +1021,41 @@ namespace XGLFinishPro.Views
private void LeftCheckDate_SelectedDateChanged_1(object sender, SelectionChangedEventArgs e)
{
this.date = this.LeftCheckDate.SelectedDate.Value.ToString("yyyy-MM-dd");
DataTable dataTable = dbService.GetProOrderWorkorder(deviceCode, date);
List<OrderWork> orderWorks = new List<OrderWork>();
if (dataTable == null || dataTable.Rows.Count == 0)
try
{
MessageBox.Show("没有查询到工单信息!");
}
else
{
foreach (DataRow row in dataTable.Rows)
this.date = this.LeftCheckDate.SelectedDate.Value.ToString("yyyy-MM-dd");
DataTable dataTable = dbService.GetProOrderWorkorder(deviceCode, date);
List<OrderWork> orderWorks = new List<OrderWork>();
if (dataTable == null || dataTable.Rows.Count == 0)
{
if (orderWorks.Where(t => t.WorkName == row["product_name"].ToString()).Any())
{
continue;
}
orderWorks.Add(new OrderWork()
{
WorkId = row["workorder_id"].ToString(),
WorkName = row["product_name"].ToString(),
});
LogHelper.instance.log.Error("没有查询到工单信息!");
MessageBox.Show("没有查询到工单信息!");
}
else
{
foreach (DataRow row in dataTable.Rows)
{
if (orderWorks.Where(t => t.WorkName == row["product_name"].ToString()).Any())
{
continue;
}
orderWorks.Add(new OrderWork()
{
WorkId = row["workorder_id"].ToString(),
WorkName = row["product_name"].ToString(),
});
}
}
this.LeftProductName.ItemsSource = orderWorks.Distinct();
this.LeftProductName.Items.Refresh();
this.workId = string.Empty;
this.LProductName = string.Empty;
LoadData();
}
catch (Exception ex)
{
LogHelper.instance.log.Error("首检记录获取工单出现异常!" + ex.Message);
}
this.LeftProductName.ItemsSource = orderWorks.Distinct();
this.LeftProductName.Items.Refresh();
this.workId = string.Empty;
this.LProductName = string.Empty;
LoadData();
}
private void LeftProductName_SelectionChanged(object sender, SelectionChangedEventArgs e)

File diff suppressed because it is too large Load Diff

@ -2,16 +2,20 @@
using CommonFunc;
using CommonFunc.Tools;
using HandyControl.Tools.Extension;
using LiveCharts.Charts;
using Microsoft.SqlServer.Server;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Net.Http;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
using System.Timers;
using System.Windows;
using System.Windows.Controls;
using NLog;
using Xceed.Wpf.Toolkit.Primitives;
using XGL.Data;
using XGL.Data.DBService;
@ -30,7 +34,7 @@ namespace XGLFinishPro.Views
/// </summary>
public partial class LanJu_Operator : UserControl
{
public static string PlcIp= "172.18.15.20";
public static string PlcIp = "172.18.15.20";
public static bool isSuccess = false;
public static bool IsWrite = false;
public static PlcHelper plc = new PlcHelper();
@ -39,6 +43,12 @@ namespace XGLFinishPro.Views
public static LanJu_Operator lanJu_Operator;
Frame frame = new Frame() { Content = new Views.LanJu_InOut() };
string deviceCode = Utils.GetAppSetting("DeviceCode");
private List<string> lineList = new List<string> //用于过滤产线来写入PLC箱型尺寸
{
"XL01", "XL02", "XL03", "XL04", "XL05",
"XL06", "XL07", "XL08", "XL09", "XL10", "XL11"
};
Timer timerDeciveState = new Timer();
string _workOrderCode = "";
userDB usdb = new userDB();
@ -431,8 +441,11 @@ namespace XGLFinishPro.Views
if (pauseOrderWin.ShowDialog() == true)
{
PauseRecoverOrderS(workordercode, "w2", pauseOrderWin);
ProWorkBatchInWork("w2", dgWorkOrderInfo.SelectedItem as DataRowView, 2);
//formingMachineService.UpdateWorkOrder(workordercode, "w2", pauseOrderWin.remark, pauseOrderWin.type, deviceCode);
ProWorkBatchInWork("w2", dgWorkOrderInfo.SelectedItem as DataRowView, 0);
// 添加写入PLC尺寸信息的逻辑
string materialCode = selectedRow["product_code"].ToString();
WritePlcBoxMessage(materialCode);
GetWorkOrderInfo();
}
@ -664,6 +677,13 @@ namespace XGLFinishPro.Views
// CustomMessageBox.Show("请先校验用户!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
// return;
//}
bool connectResult = plc.Connection(PlcIp);
if (!connectResult)
{
LogHelper.instance.log.Info("PLC连接失败");
CustomMessageBox.Show("PLC连接失败无法开始工单");
return;
}
if (dgWorkOrderInfo.SelectedItems.Count == 0)
{
CustomMessageBox.Show("请选择要开始的工单!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
@ -731,7 +751,12 @@ namespace XGLFinishPro.Views
string materialDesc = (dgWorkOrderInfo.SelectedItem as DataRowView)["product_name"].ToString();
userDbWareHouse.InsertOperationLog(workorderID, "w2", "", "开始工单", deviceCode, materialCode, materialDesc);
ProWorkBatchInWork("w2", dgWorkOrderInfo.SelectedItem as DataRowView, 0);
WritePlcBoxMessage(materialCode);
LogHelper.instance.log.Info("问题跟踪:设备编号是否为空:"+ deviceCode);
if (!string.IsNullOrEmpty(deviceCode) && lineList.Contains(deviceCode))
{
LogHelper.instance.log.Info("问题跟踪尝试将箱型信息写给PLC"+ materialCode );
WritePlcBoxMessage(materialCode);
}
// await CallCheckApi("checkTypeSCXJ");20240403赵啸林因为切线方案调整要求取消上位机生成巡检任务的功能
GetWorkOrderInfo();
}
@ -781,25 +806,29 @@ namespace XGLFinishPro.Views
if (type == 0)
{
batchCode = "";
LogHelper.instance.log.Info($"开始工单:" + lineCode + "," + batchCode + "," + workorderCode + "," + productCode + "," + productName + "," + productdescen + "," + boxType + "," + packType + "," + umrez + "," + status + "," + LoginUser.WorkDate);
if (!formingMachineService.UpdateProWorkBatchInWork(lineCode, batchCode, workorderCode, productCode, productName, productdescen, boxType, packType, umrez, status, LoginUser.WorkDate))
{
CustomMessageBox.Show("更新打印机表状态失败!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
LogHelper.instance.log.Info($"更新打印机表状态失败:" + CustomMessageBoxButton.OK +";"+ CustomMessageBoxIcon.Warning);
return false;
}
}
else if (type == 1)
{
if (!formingMachineService.UpdateProWorkBatchInWorkBatchCode(lineCode, batchCode, status,productCode,productName))
if (!formingMachineService.UpdateProWorkBatchInWorkBatchCode(lineCode, batchCode, status, productCode, productName))
{
CustomMessageBox.Show("更新打印机表状态失败!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
LogHelper.instance.log.Info($"更新打印机表状态失败:" + CustomMessageBoxButton.OK + ";" + CustomMessageBoxIcon.Warning);
return false;
}
}
else if (type == 2)
{
if (!formingMachineService.UpdateProWorkBatchInWorkStatus(lineCode, status))
if (!formingMachineService.UpdateProWorkBatchInWorkStatus(lineCode, status, packType))
{
CustomMessageBox.Show("更新打印机表状态失败!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
LogHelper.instance.log.Info($"更新打印机表状态失败:" + CustomMessageBoxButton.OK + ";" + CustomMessageBoxIcon.Warning);
return false;
}
}
@ -964,6 +993,7 @@ namespace XGLFinishPro.Views
string quality = (dgWorkOrderInfo.SelectedItem as DataRowView)["quantity_split"].ToString();
string unit = (dgWorkOrderInfo.SelectedItem as DataRowView)["unit"].ToString();
string plan_time = (dgWorkOrderInfo.SelectedItem as DataRowView)["plan_time"].ToString();
plan_time = plan_time.Replace("/", "-");
//调用首件检验接口
string apiUrl = formingMachineService.GetInterfaceUrl("createCheckProduceTask");
FirstCheckModel firstCheck = new FirstCheckModel();
@ -1147,7 +1177,12 @@ namespace XGLFinishPro.Views
// WritePlcBoxMessage(row["product_code"].ToString());
// }
//}
ProWorkBatchInWork("w2", dgWorkOrderInfo.SelectedItem as DataRowView, 1);
if (ProWorkBatchInWork("w2", dgWorkOrderInfo.SelectedItem as DataRowView, 1))
{
DataRowView temp = dgWorkOrderInfo.SelectedItem as DataRowView;
var batchCode = temp["batch_code"].ToString();
LogHelper.instance.log.Info(DateTime.Now + $"已开始批次:" + batchCode);
}
}
else if (content == "结束")
{
@ -1189,10 +1224,12 @@ namespace XGLFinishPro.Views
DataTable pointsDt = formingMachineService.GetWcsPlcPoint(plcPointNo, "ProductSize");
if (pointsDt == null || pointsDt.Rows.Count == 0)
{
LogHelper.instance.log.Info("问题跟踪pointsDt为空或者数量为零");
return;
}
if (dt != null && dt.Rows.Count > 0)
{
LogHelper.instance.log.Info("问题跟踪dt不为空" );
string heigh = dt.Rows[0]["height"].ToString();
string width = dt.Rows[0]["width"].ToString();
string length = dt.Rows[0]["length"].ToString();
@ -1204,21 +1241,32 @@ namespace XGLFinishPro.Views
try
{
count++;
plc.Connection(PlcIp);
//bool connectResult = plc.Connection(PlcIp);
//if (!connectResult)
//{
// LogHelper.instance.log.Info("问题跟踪PLC连接失败");
//}
//else
//{
//}
if (pointsDt != null && pointsDt.Rows.Count > 0)
{
bool writeResult = false;
foreach (DataRow row in pointsDt.Rows)
{
if (row["plc_point_no"].ToString() == height)
{
plc.Write(new PlcSetting() {
PlcAddress= row["plc_point_address"].ToString() ,
PlcValueLength="2"
writeResult = plc.Write(new PlcSetting()
{
PlcAddress = row["plc_point_address"].ToString(),
PlcValueLength = "2"
}, h);
}
else if (row["plc_point_no"].ToString() == width1)
{
plc.Write(new PlcSetting()
writeResult = plc.Write(new PlcSetting()
{
PlcAddress = row["plc_point_address"].ToString(),
PlcValueLength = "2"
@ -1226,22 +1274,38 @@ namespace XGLFinishPro.Views
}
else if (row["plc_point_no"].ToString() == length1)
{
plc.Write(new PlcSetting()
writeResult = plc.Write(new PlcSetting()
{
PlcAddress = row["plc_point_address"].ToString(),
PlcValueLength = "2"
}, l);
}
LogHelper.instance.log.Info($"写入PLC尺寸信息成功新高度{h},新宽度{w},新长度{l}");
if (writeResult)
{
LogHelper.instance.log.Info($"写入PLC尺寸信息成功,新高度{h},新宽度{w},新长度{l}");
Dispatcher.Invoke(() =>
{
CustomMessageBox.Show($"写入PLC尺寸信息成功,新高度{h},新宽度{w},新长度{l}");
});
}
else
{
LogHelper.instance.log.Info($"写入PLC尺寸信息失败");
Dispatcher.Invoke(() =>
{
CustomMessageBox.Show($"写入PLC尺寸信息失败");
});
}
}
isSuccess = true;
isSuccess = writeResult;
break;
}
}
catch (Exception ex)
{
isSuccess = false;
LogHelper.instance.log.Info($"写入PLC尺寸信息失败第{count}次重试{ex}");
LogHelper.instance.log.Error($"写入PLC尺寸信息失败第{count}次重试,异常信息:{ex.Message}", ex);
plc = new PlcHelper();
}
}
@ -1254,9 +1318,9 @@ namespace XGLFinishPro.Views
}
}
}
catch
catch(Exception ex)
{
LogHelper.instance.log.Info("问题跟踪异常:" + ex);
}
});
}
@ -1270,6 +1334,48 @@ namespace XGLFinishPro.Views
IsWrite = false;
}
}
/// <summary>
/// 叫料按钮事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private async void btnCallMaterialRequest_Click(object sender, RoutedEventArgs e)
{
// 判断当前窗口内容是否为QitaoLvUC
if (Window1.Content is Frame frame && frame.Content is XGLFinishPro.Views.QitaoLvUC qitaoLvUC)
{
var selectedRow = qitaoLvUC.SelectedMaterialRow;
if (selectedRow == null)
{
CustomMessageBox.Show("请先选中一条领料记录!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
// 组装数据
string materialCode = selectedRow["material_code"].ToString();
string materialName = selectedRow["material_name"].ToString();
string quantity = qitaoLvUC.InputQuantity ?? selectedRow["quantity"].ToString();
string locator = selectedRow["locator"].ToString();
// TODO: 这里根据实际需求组装更多字段
// 发送请求(伪代码,需替换为实际接口调用)
try
{
// 这里可以用HttpClient或RestHelper等工具发送请求
// var result = await SomeApiHelper.SendMaterialRequest(materialCode, materialName, quantity, locator);
// 假设成功
CustomMessageBox.Show($"叫料请求已发送!\n物料编码{materialCode}\n物料名称{materialName}\n数量{quantity}\n库位{locator}", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Success);
}
catch (Exception ex)
{
CustomMessageBox.Show($"叫料请求失败:{ex.Message}", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Error);
}
}
else
{
CustomMessageBox.Show("请先点击领料单并选中一条记录!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
}
}
}
public class ReportWorkModel
{

@ -0,0 +1,230 @@
<Window x:Class="XGLFinishPro.Views.Lanju_Daily_Check_Report"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:XGLFinishPro.Views"
mc:Ignorable="d"
WindowState="Maximized"
WindowStyle="None"
Loaded="Window_Loaded"
Height="1000" Width="1900">
<!--Loaded="Window_Loaded"-->
<Window.Resources>
<ResourceDictionary>
<Style BasedOn="{x:Null}" TargetType="ComboBox">
<Setter Property="Width" Value="50" />
<Setter Property="Height" Value="30" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="FontSize" Value="20" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBox">
<Grid x:Name="TogGrid">
<ToggleButton
x:Name="ToggleButton"
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Click="ToggleButton_Click"
ClickMode="Press"
Focusable="false"
FontSize="{TemplateBinding FontSize}">
<ContentPresenter
HorizontalAlignment="Center"
VerticalAlignment="Center"
Content="{TemplateBinding SelectionBoxItem}"
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</ToggleButton>
<Popup
x:Name="Popup"
AllowsTransparency="True"
Focusable="False"
IsOpen="{TemplateBinding IsDropDownOpen}"
Placement="Bottom"
PopupAnimation="Slide">
<Grid
x:Name="DropDown"
MinWidth="{TemplateBinding ActualWidth}"
MaxHeight="200"
SnapsToDevicePixels="True">
<Border
x:Name="DropDownBorder"
Background="White"
BorderBrush="Gray"
BorderThickness="1" />
<ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True">
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
</ScrollViewer>
</Grid>
</Popup>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsFocused" Value="true">
<Setter TargetName="ToggleButton" Property="Background" Value="Gray" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="ToggleButton" Property="Background" Value="Gray" />
</Trigger>
<Trigger Property="HasItems" Value="false">
<Setter TargetName="DropDownBorder" Property="MinHeight" Value="95" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="Gray" />
</Trigger>
<Trigger Property="IsGrouping" Value="true">
<Setter Property="ScrollViewer.CanContentScroll" Value="false" />
</Trigger>
<!-- 新增的Trigger用于在选择完成后将按钮颜色变回原来的颜色 -->
<Trigger Property="IsDropDownOpen" Value="false">
<Setter TargetName="ToggleButton" Property="Background" Value="White" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TextBlockStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="25" />
<Setter Property="Margin" Value="10,0,8,0" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
</Style>
<Style x:Key="CheckBoxStyle" TargetType="{x:Type CheckBox}">
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="LayoutTransform">
<Setter.Value>
<ScaleTransform ScaleX="1.5" ScaleY="1.5" />
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="*" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label
Grid.RowSpan="2"
Grid.Column="1"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Content="班组安全生产每日点检报表"
FontSize="40"
FontWeight="Bold" />
<StackPanel
Grid.Column="2"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Horizontal">
<Button
x:Name="IsFinalSubmit"
Width="100"
Height="50"
Margin="10"
Background="Red"
Click="Submit_Click"
Content="最终提交"
FontSize="20"
Foreground="White" />
<Button
x:Name="Commit"
Width="100"
Height="50"
Margin="10"
Background="#2B7EE6"
Click="Submit_Click"
Content="保存"
FontSize="20"
Foreground="White" />
<Button
Width="100"
Height="50"
Margin="10"
Background="#2B7EE6"
Click="Close_Click"
Content="关闭"
FontSize="20"
Foreground="White" />
</StackPanel>
<!--<StackPanel
Grid.Row="2"
Grid.Column="2"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Orientation="Horizontal">
<Label Content="表单编号:" FontSize="25" />
<Label
x:Name="OrderCode"
Content="08GL05C001-014A"
FontSize="25" />
</StackPanel>-->
</Grid>
<Grid
x:Name="MainGrid"
Grid.Row="1"
Margin="10,10,10,0" />
<StackPanel
Grid.Row="2"
Margin="10,10,10,0"
Orientation="Horizontal">
<StackPanel Orientation="Vertical">
<TextBlock
HorizontalAlignment="Left"
Style="{StaticResource TextBlockStyle}"
Text="填写要求" />
<TextBlock
HorizontalAlignment="Left"
Style="{StaticResource TextBlockStyle}"
Text="2.在“口”中勾选类别。" />
<TextBlock
HorizontalAlignment="Left"
Style="{StaticResource TextBlockStyle}"
Text="3.“检查结果”是填“√”否填“x”,若有异常则填写实际情况。" />
</StackPanel>
<!--<StackPanel
Width="500"
Margin="600,0,0,20"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Orientation="Horizontal">
<TextBlock
HorizontalAlignment="Right"
Style="{StaticResource TextBlockStyle}"
Text="班组长签字:" />
<TextBlock
x:Name="NickName"
HorizontalAlignment="Right"
Style="{StaticResource TextBlockStyle}"
Text="" />
</StackPanel>-->
</StackPanel>
</Grid>
</Window>

@ -0,0 +1,960 @@
using CentralControl.App_Code;
using CommonFunc;
using CommonFunc.Tools;
using HandyControl.Tools.Extension;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Documents;
using System.Windows.Media;
using System.Windows.Shapes;
using XGL.Data.DBService;
using XGL.Models;
namespace XGLFinishPro.Views
{
public partial class Lanju_Daily_Check_Report : Window
{
private string belong_to = string.Empty;
private List<MesTableSelfDetialModel> data;
FormingMachineService dbService = new FormingMachineService();
private static double LineWidth = 30;
private static double LineHeight = 30;
private static double MainLineWidth = 150;
private static double MainLineHeight = 50;
string deviceCode = Utils.GetAppSetting("DeviceCode");
string productName = string.Empty;
private string shiftCode = "";
private string shiftName = "";
private string product_code = string.Empty;
private readonly List<string> _hours = new List<string>() { "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23" };
private bool isUpdate = false;
private readonly List<string> _minutes = new List<string> { "00", "05", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55" };
private string LineStr = "";
private readonly List<string> teamGroup = new List<string>() { "白班", "中班", "晚班"};
public Lanju_Daily_Check_Report()
{
InitializeComponent();
this.date = LoginUser.WorkDate;
shiftCode = LoginUser.ShiftCode;
shiftName = dbService.GetShiftById(shiftCode);
}
private List<ConveterData> list = new List<ConveterData>();
private string date;
private MesTableSelf mesTableSelf;
private List<MesTableSelfDetialModel> mesTableSelfDetialList;
public List<BaseDictData> DictDatas { get; private set; }
private void Window_Loaded(object sender, RoutedEventArgs e)
{
//this.NickName.Text = LoginUser.UserName;
LineStr = dbService.GetBaseEquipment(Utils.GetAppSetting("DeviceCode"));
LoadData();
}
private void LoadData(bool addLine = false)
{
isUpdate = true;
list.Clear();
this.MainGrid.Children.Clear();
this.MainGrid.RowDefinitions.Clear();
this.MainGrid.ColumnDefinitions.Clear();
DictDatas = dbService.GetConversionReportType();
var baseDictDatas = dbService.GetSelfCheckInfo("secutity_production").ToList();
var baseMainDictDatas = dbService.GetSelfCheckInfo("secutity_production_result").ToList();
Dictionary<string, List<string>> mainDict = new Dictionary<string, List<string>>();
for (int i = 0; i < baseDictDatas.Count; i++)
{
mainDict.Add(baseDictDatas[i].dict_label, baseMainDictDatas.Where(t => t.remark == baseDictDatas[i].remark || string.IsNullOrEmpty(t.remark)).Select(t => t.dict_value).ToList());
if (!list.Any(t => t.label == baseDictDatas[i].dict_label))
{
list.Add(new ConveterData()
{
label = baseDictDatas[i].dict_label,
value = MD5Provider.Hash(baseDictDatas[i].dict_label),
});
}
}
list.ForEach(t => t.value = t.value.Insert(0, "A"));//开头插入"A"
mesTableSelf = dbService.GetMesTableSelf(deviceCode, null, date, "SecurityProduction"+ shiftName);
if (mesTableSelf == null)
{
mesTableSelf = new MesTableSelf()
{
id = Guid.NewGuid().ToString(),
line_code = deviceCode,
check_date = date,
product_code = product_code,
factory_code = Utils.GetAppSetting("SiteCode"),
del_flag = "0",
product_date = date,
bz = string.Empty,
report_name = "SecurityProduction" + shiftName
};
dbService.InsertMesTableSelf(mesTableSelf);
}
belong_to = mesTableSelf.id;
// 获取当天该班次的记录
data = dbService.GetMesTableSelfDetialByShiftCode(mesTableSelf.id, shiftCode, baseDictDatas.Count);
if (data.Count == 0) // 如果不存在记录,创建新记录
{
data = new List<MesTableSelfDetialModel>();
foreach (var item in baseDictDatas)
{
var newModel = new MesTableSelfDetialModel
{
id = Guid.NewGuid().ToString(),
belong_to = mesTableSelf.id,
info_name = item.dict_label,
info_code = item.dict_code,
check_result = "", // 初始化为空字符串
bz = "", // 初始化为空字符串
remark = shiftCode,
table_line = 1, // 设置默认值
index = 0, // 设置默认值
del_flag = "0" // 设置为未删除
};
// 插入新记录到数据库
dbService.InsertMesTableSelfDetial(newModel);
// 添加到内存中的列表
data.Add(newModel);
}
}
if (addLine)
{
int maxLine = data.Max(t => t.table_line) + 1;
data.ForEach(t => { t.index++; });
data.Insert(0, new MesTableSelfDetialModel() { index = 0 });
data.RemoveAll(t => t.index == 7);
}
//for (var i = 0; i < 1; i++)
//{
//}
foreach (var item in baseDictDatas)
{
bool hasData = data.Where(t => t.info_name == item.dict_label && t.remark == shiftCode).Any();
if (!hasData)
{
int tableLine = 1;
MesTableSelfDetialModel mesTableSelfDetialModel = data.Where(t => t.table_line != 0).FirstOrDefault();
if (mesTableSelfDetialModel != null)
{
tableLine = mesTableSelfDetialModel.table_line;
}
else
{
try
{
tableLine = data.Max(t => t.table_line) + 1;
}
catch
{
}
}
data.Add(new MesTableSelfDetialModel()
{
table_line = tableLine,
info_name = item.dict_label,
remark = shiftCode,
info_code = DictDatas.FirstOrDefault(t => t.dict_label == item.dict_label)?.dict_code,
});
}
}
Dictionary<string, Dictionary<int, MesTableSelfDetialModel>> dic = new Dictionary<string, Dictionary<int, MesTableSelfDetialModel>>();
foreach (var item in data)
{
if (item.info_name == null || dic.Keys.Contains(item.info_name))
{
continue;
}
var mesTableSelfDetialModels = data.Where(t => t.info_name == item.info_name).ToList();
// 使用GroupBy和ToDictionary来处理可能的重复index
var dictionary = mesTableSelfDetialModels
.GroupBy(t => t.index)
.ToDictionary(
g => g.Key,
g => g.First() // 如果有重复的index取第一个记录
);
dic.Add(item.info_name, dictionary);
if (!list.Any(t => t.label == item.info_name))
{
list.Add(new ConveterData()
{
label = item.info_name,
value = MD5Provider.Hash(item.info_name),
});
}
}
list.ForEach(t => t.value = t.value.Insert(0, "A"));
MakeHeaderData();
MakeMainData(baseDictDatas, mainDict, dic);
UpdateUI();
isUpdate = false;
}
private void UpdateUI()
{
try
{
double width = this.MainGrid.GetValidWidth();
double widthCount = this.MainGrid.ColumnDefinitions.Count;
var lineWidth = width / (widthCount + 3.2);
double height = this.MainGrid.GetValidHeight();
double heightCount = this.MainGrid.RowDefinitions.Count;
var lineHeight = height / heightCount;
foreach (var item in this.MainGrid.Children)
{
if (item is ComboBox comboBox)
{
comboBox.Width = lineWidth;
comboBox.Height = lineHeight - 10;
comboBox.IsEnabled = !mesTableSelf.IsFinal;
}
if (item is TextBox textBox)
{
textBox.Width = Width = (this.MainGrid.GetValidWidth()) /
(this.MainGrid.ColumnDefinitions.Count + 3.2) * 5 - 10;
textBox.Height = this.MainGrid.GetValidHeight() / MainGrid.RowDefinitions.Count - 5;
textBox.IsEnabled = !mesTableSelf.IsFinal;
}
}
this.Commit.Visibility = mesTableSelf.IsFinal ? Visibility.Collapsed : Visibility.Visible;
this.IsFinalSubmit.Visibility = this.Commit.Visibility;
}
catch
{
}
}
private void MakeMainData(List<BaseDictData> baseDictDatas, Dictionary<string, List<string>> mainDict, Dictionary<string, Dictionary<int, MesTableSelfDetialModel>> dic)
{
string name = baseDictDatas.FirstOrDefault()?.remark;
for (int i = 0; i < baseDictDatas.Count; i++)
{
this.MainGrid.RowDefinitions.Add(new RowDefinition()
{
Height = new GridLength(1.0, GridUnitType.Star)
});
}
for (int i = 3; i < baseDictDatas.Count + 3; i++)
{
Line line;
if (i == baseDictDatas.Count + 2)
{
line = new Line()
{
VerticalAlignment = VerticalAlignment.Bottom,
X1 = 1,
Stretch = Stretch.Fill,
StrokeThickness = 1,
Stroke = Brushes.Black,
};
Grid.SetColumn(line, 0);
Grid.SetRow(line, i);
Grid.SetColumnSpan(line, 99);
this.MainGrid.Children.Add(line);
continue;
}
line = new Line()
{
VerticalAlignment = VerticalAlignment.Bottom,
X1 = 1,
Stretch = Stretch.Fill,
StrokeThickness = 1,
Stroke = Brushes.Black,
};
Grid.SetColumn(line, 0);
Grid.SetRow(line, i);
Grid.SetColumnSpan(line, 1);
this.MainGrid.Children.Add(line);
line = new Line()
{
VerticalAlignment = VerticalAlignment.Bottom,
X1 = 1,
Stretch = Stretch.Fill,
StrokeThickness = 1,
Stroke = Brushes.Black,
};
Grid.SetColumn(line, 2);
Grid.SetRow(line, i);
Grid.SetColumnSpan(line, 99);
this.MainGrid.Children.Add(line);
if (name != baseDictDatas[i - 3].remark)
{
line = new Line()
{
VerticalAlignment = VerticalAlignment.Top,
X1 = 1,
Stretch = Stretch.Fill,
StrokeThickness = 1,
Stroke = Brushes.Black,
};
Grid.SetColumn(line, 1);
Grid.SetRow(line, i);
Grid.SetColumnSpan(line, 1);
this.MainGrid.Children.Add(line);
}
name = baseDictDatas[i - 3].remark;
}
for (int i = 0; i < baseDictDatas.Count; i++)
{
if (name != baseDictDatas[i].remark)
{
TextBlock textBlock2 = new TextBlock()
{
Text = baseDictDatas[i].remark,
FontSize = 18,
FontWeight = FontWeights.Bold,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
};
Grid.SetColumn(textBlock2, 1);
Grid.SetRow(textBlock2, i + 3);
Grid.SetRowSpan(textBlock2, baseDictDatas.Where(t => t.remark == baseDictDatas[i].remark).Count());
this.MainGrid.Children.Add(textBlock2);
}
name = baseDictDatas[i].remark;
TextBlock textBlock = new TextBlock()
{
Text = i + 1 + "",
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Center,
FontSize = 18,
FontWeight = FontWeights.Bold,
};
Grid.SetColumn(textBlock, 0);
Grid.SetRow(textBlock, i + 3);
this.MainGrid.Children.Add(textBlock);
textBlock = new TextBlock()
{
Text = baseDictDatas[i].dict_label.Replace("___", "/"),
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Center,
FontSize = 18,
FontWeight = FontWeights.Bold,
TextWrapping = TextWrapping.Wrap,
};
Grid.SetColumn(textBlock, 2);
Grid.SetRow(textBlock, i + 3);
this.MainGrid.Children.Add(textBlock);
}
int index = 1;
//检查结果下拉框
for (int i = 0; i < baseDictDatas.Count; i++)
{
index = 1;
for (int j = 0; j < 1; j++) // 只保留一列检查结果
{
int column = 3 + (j * 2);
ComboBox comboBox = new ComboBox()
{
Name = list.First(t => t.label == baseDictDatas[i].dict_label).value + index,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
ItemsSource = mainDict[baseDictDatas[i].dict_label]?.Distinct(),
SelectedItem = data.Where(t => t.info_name == baseDictDatas[i].dict_label && t.index == j).Select(t => t.check_result).FirstOrDefault(),
Width = 50 // 设置宽度为100可以根据需要调整
};
comboBox.SelectionChanged += SelectionChanged;
Grid.SetRow(comboBox, i + 3);
Grid.SetColumn(comboBox, column);
Grid.SetColumnSpan(comboBox, 2);
this.MainGrid.Children.Add(comboBox);
index++;
}
}
//存在问题输入文本框
for (int i = 0; i < baseDictDatas.Count; i++)
{
index = 1;
for (int j = 0; j < 1; j++) // 只保留一列检查结果
{
int column = 5 + (j * 2);
TextBox textBox = new TextBox()
{
Name = list.First(t => t.label == baseDictDatas[i].dict_label).value + index,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
//Width = (this.MainGrid.GetValidWidth())/(this.MainGrid.ColumnDefinitions.Count + 3.2)*5-10,
//Height = this.MainGrid.GetValidHeight()/ MainGrid.RowDefinitions.Count-5,
FontSize = 18,
Text = data.Where(t => t.info_name == baseDictDatas[i].dict_label && t.index == j)
.Select(t => t.bz)
.FirstOrDefault() // 显示已有的BZ值
};
textBox.TextChanged += TextBox_TextChanged;
Grid.SetRow(textBox, i + 3);
Grid.SetColumn(textBox, column);
Grid.SetColumnSpan(textBox, 6);
this.MainGrid.Children.Add(textBox);
index++;
}
}
// 添加三列空白列
for (int i = 0; i < baseDictDatas.Count; i++)
{
for (int j = 0; j < 3; j++)
{
int column = 5 + (j * 2);
TextBlock emptyBlock = new TextBlock()
{
Text = "",
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Center,
};
Grid.SetRow(emptyBlock, i + 3);
Grid.SetColumn(emptyBlock, column);
Grid.SetColumnSpan(emptyBlock, 2);
this.MainGrid.Children.Add(emptyBlock);
}
}
}
private void SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (isUpdate)
{
return;
}
if (sender is ComboBox comboBox)
{
if (comboBox.Name.Contains("班组"))
{
var index = int.Parse(comboBox.Name.Substring(comboBox.Name.Length - 1, 1));
data.Where(t => t.index == index - 1).ForEach(t => t.remark = shiftCode.ToString());
}
else
{
var key = list.First(t => t.value == comboBox.Name.Substring(0, comboBox.Name.Length - 1)).label;
var index = int.Parse(comboBox.Name.Substring(comboBox.Name.Length - 1, 1));
MesTableSelfDetialModel mesTableSelfDetialModel = data.Where(t => t.info_name == key && t.index == index - 1).First();
mesTableSelfDetialModel.check_result = comboBox.SelectedItem.ToString();
if (string.IsNullOrEmpty(mesTableSelfDetialModel.id))
{
mesTableSelfDetialModel.id = Guid.NewGuid().ToString();
mesTableSelfDetialModel.belong_to = belong_to;
}
foreach (var item in this.MainGrid.Children)
{
if (item is StackPanel stackPanel)
{
foreach (var item2 in stackPanel.Children)
{
if (item2 is ComboBox comboBox1)
{
if (comboBox1.Name == $"班组{index}")
{
data.Where(t => t.index == index - 1).ForEach(t => t.remark = comboBox1.SelectedItem?.ToString());
}
}
}
}
}
}
}
}
private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
{
if (isUpdate)
{
return;
}
if (sender is TextBox textBox)
{
var key = list.First(t => t.value == textBox.Name.Substring(0, textBox.Name.Length - 1)).label;
var index = int.Parse(textBox.Name.Substring(textBox.Name.Length - 1, 1));
MesTableSelfDetialModel mesTableSelfDetialModel = data.Where(t => t.info_name == key && t.index == index - 1).First();
mesTableSelfDetialModel.bz = textBox.Text;
if (string.IsNullOrEmpty(mesTableSelfDetialModel.id))
{
mesTableSelfDetialModel.id = Guid.NewGuid().ToString();
mesTableSelfDetialModel.belong_to = belong_to;
}
}
}
private void MakeHeaderData()
{
#region 画线
for (int i = 0; i < 11; i++)
{
double width = 1.0;
if (i == 0)
{
width = 1.2;
}
if (i == 1)
{
width = 1.5;
}
if (i == 2)
{
width = 6.0;
}
if (i == 3)
{
width = 0.8;
}
if (i == 4)
{
width = 0.8;
}
this.MainGrid.ColumnDefinitions.Add(new ColumnDefinition()
{
Width = new GridLength(width, GridUnitType.Star)
});
}
#region 画表格竖线
for (int i = 0; i < 11; i++)
{
// ✅ 跳过第3行索引2第6~11列索引6~11之间的竖线
if ((i < 4 || i % 2 == 1) && !(i >= 6 && i <= 11))
{
Line line = new Line()
{
Name = $"YLine{i}",
Stroke = Brushes.Black,
StrokeThickness = 1,
Y1 = 1,
Stretch = Stretch.Fill,
HorizontalAlignment = HorizontalAlignment.Left,
};
Grid.SetColumn(line, i);
Grid.SetRow(line, 0);
if (i >= 4 && i % 2 == 0)
{
Grid.SetRowSpan(line, 1);
}
else
{
Grid.SetRowSpan(line, 99);
}
this.MainGrid.Children.Add(line);
}
}
// 添加最后一列右边的边界线
Line boundaryLine = new Line()
{
Name = "BoundaryLine",
Stroke = Brushes.Black,
StrokeThickness = 1,
Y1 = 1,
Stretch = Stretch.Fill,
HorizontalAlignment = HorizontalAlignment.Right, // 让它靠右对齐
};
// 设置它在第 11 列(超出当前最大列)
Grid.SetColumn(boundaryLine, 11);
Grid.SetRow(boundaryLine, 0);
Grid.SetRowSpan(boundaryLine, 99); // 让它跨 99 行,确保足够高
this.MainGrid.Children.Add(boundaryLine);
#endregion
#region 画表格横线
for (int i = 0; i <= 2; i++)
{
this.MainGrid.RowDefinitions.Add(new RowDefinition()
{
Height = new GridLength(1, GridUnitType.Star)
});
// 跳过第 1 行,不画线
if (i == 1)
continue;
Line line = new Line()
{
Name = $"XLine{i}",
Stroke = Brushes.Black,
StrokeThickness = 1,
X1 = 1,
Stretch = Stretch.Fill,
VerticalAlignment = VerticalAlignment.Top,
};
Grid.SetColumn(line, 0);
Grid.SetRow(line, i);
Grid.SetColumnSpan(line, 11);
this.MainGrid.Children.Add(line);
// 仅在最后一行i == 2添加底部边界线
if (i == 2)
{
Line line1 = new Line()
{
Stroke = Brushes.Black,
StrokeThickness = 1,
X1 = 1,
Stretch = Stretch.Fill,
VerticalAlignment = VerticalAlignment.Bottom,
};
Grid.SetColumn(line1, 0);
Grid.SetRow(line1, i);
Grid.SetColumnSpan(line1, 15);
this.MainGrid.Children.Add(line1);
}
}
#endregion
#endregion
#region 画表头
TextBlock textBlock = new TextBlock()
{
Text = "产线名称",
FontSize = 18,
FontWeight = FontWeights.Bold,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
};
Grid.SetColumn(textBlock, 0);
Grid.SetRow(textBlock, 0);
Grid.SetRowSpan(textBlock, 2);
this.MainGrid.Children.Add(textBlock);
textBlock = new TextBlock()
{
Text = "序号",
FontSize = 18,
FontWeight = FontWeights.Bold,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
};
Grid.SetColumn(textBlock, 0);
Grid.SetRow(textBlock, 2);
this.MainGrid.Children.Add(textBlock);
textBlock = new TextBlock()
{
Text = "检查项目",
FontSize = 18,
FontWeight = FontWeights.Bold,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
};
Grid.SetColumn(textBlock, 1);
Grid.SetRow(textBlock, 2);
this.MainGrid.Children.Add(textBlock);
textBlock = new TextBlock()
{
Text = LineStr,
FontSize = 18,
FontWeight = FontWeights.Bold,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
};
Grid.SetColumn(textBlock, 1);
Grid.SetRow(textBlock, 0);
Grid.SetRowSpan(textBlock, 2);
this.MainGrid.Children.Add(textBlock);
StackPanel stackPanel = new StackPanel
{
Orientation = Orientation.Horizontal,
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Center,
};
TextBlock textBlock2 = new TextBlock()
{
Text = "日期:",
FontSize = 18,
FontWeight = FontWeights.Bold,
};
stackPanel.Children.Add(textBlock2);
var datePicker = new DatePicker()
{
FontSize = 18,
FontWeight = FontWeights.Bold,
SelectedDate = DateTime.Parse(date)
};
datePicker.SelectedDateChanged += (s, e) =>
{
date = ((DatePicker)s).SelectedDate.Value.ToString("yyyy-MM-dd");
LoadData();
};
stackPanel.Children.Add(datePicker);
// ✅ 让 StackPanel 跨两行
Grid.SetColumn(stackPanel, 2);
Grid.SetRow(stackPanel, 0);
Grid.SetRowSpan(stackPanel, 2); // ✅ 这里改成对 stackPanel 设置 RowSpan
this.MainGrid.Children.Add(stackPanel);
textBlock = new TextBlock()
{
Text = "班次",
FontSize = 18,
FontWeight = FontWeights.Bold,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
};
Grid.SetColumn(textBlock, 3);
Grid.SetRow(textBlock, 0);
Grid.SetRowSpan(textBlock, 2);
Grid.SetColumnSpan(textBlock, 2);
this.MainGrid.Children.Add(textBlock);
int index = 1;
// 假设这是返回的集合
textBlock = new TextBlock()
{
Text = shiftName,
FontSize = 18,
FontWeight = FontWeights.Bold,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
};
Grid.SetColumn(textBlock, 5);
Grid.SetRow(textBlock, 0);
Grid.SetRowSpan(textBlock, 2);
Grid.SetColumnSpan(textBlock, 2);
this.MainGrid.Children.Add(textBlock);
textBlock = new TextBlock()
{
Text = "点检人",
FontSize = 18,
FontWeight = FontWeights.Bold,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
};
Grid.SetColumn(textBlock, 7);
Grid.SetRow(textBlock, 0);
Grid.SetRowSpan(textBlock, 2);
Grid.SetColumnSpan(textBlock, 2);
this.MainGrid.Children.Add(textBlock);
// 在"点检人"左侧(列索引 7添加竖线
Line lineLeft = new Line()
{
Stroke = Brushes.Black, // 你可以改成 Black
StrokeThickness = 1, // 线条加粗
Y1 = 1,
Stretch = Stretch.Fill,
HorizontalAlignment = HorizontalAlignment.Left,
};
Grid.SetColumn(lineLeft, 7);
Grid.SetRow(lineLeft, 0);
Grid.SetRowSpan(lineLeft, 2);
this.MainGrid.Children.Add(lineLeft);
// 在"点检人"右侧(列索引 8添加竖线
Line lineRight = new Line()
{
Stroke = Brushes.Black, // 你可以改成 Black
StrokeThickness = 1, // 线条加粗
Y1 = 1,
Stretch = Stretch.Fill,
HorizontalAlignment = HorizontalAlignment.Right,
};
Grid.SetColumn(lineRight, 8);
Grid.SetRow(lineRight, 0);
Grid.SetRowSpan(lineRight, 2);
this.MainGrid.Children.Add(lineRight);
textBlock = new TextBlock()
{
Text = LoginUser.UserName,
FontSize = 18,
FontWeight = FontWeights.Bold,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
};
Grid.SetColumn(textBlock, 9);
Grid.SetRow(textBlock, 0);
Grid.SetRowSpan(textBlock, 2);
Grid.SetColumnSpan(textBlock, 2);
this.MainGrid.Children.Add(textBlock);
textBlock = new TextBlock()
{
Text = "检查标准",
FontSize = 18,
FontWeight = FontWeights.Bold,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
};
Grid.SetColumn(textBlock, 2);
Grid.SetRow(textBlock, 2);
this.MainGrid.Children.Add(textBlock);
for (int i = 3; i < 4; i++)
{
if (i % 2 == 1)
{
textBlock = new TextBlock()
{
Text = "检查结果",
FontSize = 18,
FontWeight = FontWeights.Bold,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
};
Grid.SetColumn(textBlock, i);
Grid.SetRow(textBlock, 2);
Grid.SetColumnSpan(textBlock, 2);
this.MainGrid.Children.Add(textBlock);
}
}
textBlock = new TextBlock()
{
Text = "存在问题",
FontSize = 18,
FontWeight = FontWeights.Bold,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
};
// 设置到第3行索引2
Grid.SetRow(textBlock, 2);
// 从第6列索引5开始
Grid.SetColumn(textBlock, 5);
// **合并6到11列索引5到10共6列**
Grid.SetColumnSpan(textBlock, 6);
this.MainGrid.Children.Add(textBlock);
#endregion
}
private void CheckBox_Checked(object sender, RoutedEventArgs e)
{
if (sender is CheckBox checkBox)
{
int index = int.Parse(checkBox.Name.Substring(checkBox.Name.Length - 1, 1));
if (checkBox.Name.Contains("开线"))
{
if (checkBox.IsChecked != null && checkBox.IsChecked.Value)
{
data.Where(t => t.index == index - 1).ForEach(t => t.bz = "1");
foreach (var item in this.MainGrid.Children)
{
if (item is CheckBox checkBox2 && checkBox2.Name == $"清换线{index}")
{
data.Where(t => t.index == index - 1).ForEach(t => t.bz = "1");
checkBox2.IsChecked = false;
break;
}
}
}
else
{
data.Where(t => t.index == index - 1).ForEach(t => t.bz = "");
}
}
else
{
if (checkBox.IsChecked != null && checkBox.IsChecked.Value)
{
data.Where(t => t.index == index - 1).ForEach(t => t.bz = "0");
foreach (var item in this.MainGrid.Children)
{
if (item is CheckBox checkBox1 && checkBox1.Name == $"开线{index}")
{
data.Where(t => t.index == index - 1).ForEach(t => t.bz = "2");
checkBox1.IsChecked = false;
break;
}
}
}
else
{
data.Where(t => t.index == index - 1).ForEach(t => t.bz = "");
}
}
}
}
private void ToggleButton_Click(object sender, RoutedEventArgs e)
{
if (((ToggleButton)sender).TemplatedParent is ComboBox comboBox)
{
comboBox.IsDropDownOpen = !comboBox.IsDropDownOpen;
}
}
private void Refresh_Click(object sender, RoutedEventArgs e)
{
LoadData();
}
private void Add_Click(object sender, RoutedEventArgs e)
{
LoadData(true);
}
private void Submit_Click(object sender, RoutedEventArgs e)
{
string isFinal = "0";
if (sender is Button button)
{
isFinal = button.Content.ToString() == "最终提交" ? "1" : "0";
}
if (isFinal == "1")
{
var result = MessageBox.Show("是否将报表最终提交?", "提示", MessageBoxButton.YesNo, MessageBoxImage.Question);
if (result != MessageBoxResult.Yes)
{
return;
}
}
foreach (var item in data)
{
if (!string.IsNullOrEmpty(item.belong_to))
{
var mesTableSelf = dbService.GetMesTableSelfDetialById(item.id);
if (mesTableSelf != null)
{
dbService.UpdateMesTableSelfDetial(item);
}
else if (mesTableSelf == null)
{
dbService.InsertMesTableSelfDetial(item);
}
}
}
mesTableSelf.create_by = LoginUser.UserName;
dbService.UpdateMesTableSelf(belong_to, "", LoginUser.UserName, isFinal);
MessageBox.Show("保存成功");
LoadData();
}
private void Close_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
}
}

@ -39,7 +39,8 @@
AutoGenerateColumns="False"
FrozenColumnCount="1"
EnableColumnVirtualization="False"
ScrollViewer.HorizontalScrollBarVisibility="Visible" IsReadOnly="True" CanUserAddRows="False">
ScrollViewer.HorizontalScrollBarVisibility="Visible" IsReadOnly="True" CanUserAddRows="False"
SelectionChanged="dgMaterialInfo_SelectionChanged">
<DataGrid.ColumnHeaderStyle>
<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Center" />

@ -26,6 +26,7 @@ namespace XGLFinishPro.Views
{
FinishProdDBService userDbWareHouse = new FinishProdDBService();
string _workOrderCode = "";
public QitaoLvUC()
{
InitializeComponent();
@ -42,6 +43,29 @@ namespace XGLFinishPro.Views
e.Row.Header = (e.Row.GetIndex() + 1).ToString();
}
public string InputQuantity { get; set; }
private void dgMaterialInfo_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (dgMaterialInfo.SelectedItem is DataRowView row)
{
string code = row["material_code"].ToString();
string name = row["material_name"].ToString();
// 弹出自定义输入数量窗口
var inputDialog = new InputNumberDialog();
if (inputDialog.ShowDialog() == true)
{
InputQuantity = inputDialog.InputValue;
CustomMessageBox.Show($"物料编码:{code}\n物料名称{name}\n数量{InputQuantity}", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Success);
}
else
{
InputQuantity = null;
}
}
}
private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
try
@ -62,5 +86,13 @@ namespace XGLFinishPro.Views
LogHelper.instance.log.Error("获取工单齐套信息时发生异常:" + ex.Message);
}
}
public DataRowView SelectedMaterialRow
{
get
{
return this.dgMaterialInfo?.SelectedItem as DataRowView;
}
}
}
}

@ -13,6 +13,7 @@
<Button Content="产品转换/完产清线点检表" Width="300" Height="50" Margin="20" Background="LightGreen" Click="Open_ReportForm" />
<Button Content="自检互检记录表" Width="300" Height="50" Margin="20" Background="LightGreen" Click="Open_SelfForm" />
<Button Content="产品首检表" Width="300" Height="50" Margin="20" Background="LightGreen" Click="Open_FistForm" />
<Button Content="班组安全生产每日点检报表" Width="300" Height="50" Margin="20" Background="LightGreen" Click="Open_SafeForm"></Button>
</StackPanel>
</Grid>
</Window>

@ -56,5 +56,14 @@ namespace XGLFinishPro.Views
new LanJu_First_Inspection_Reprot().ShowDialog();
//}
}
private void Open_SafeForm(object sender, RoutedEventArgs e)
{
//new OrderWorkIdSelect().ShowDialog();
//if (OrderWorkIdSelect.IsSelect)
//{
new Lanju_Daily_Check_Report().ShowDialog();
//}
}
}
}

@ -437,12 +437,18 @@
<Compile Include="Views\HBLogWin.xaml.cs">
<DependentUpon>HBLogWin.xaml</DependentUpon>
</Compile>
<Compile Include="Views\InputNumberDialog.xaml.cs">
<DependentUpon>InputNumberDialog.xaml</DependentUpon>
</Compile>
<Compile Include="Views\LanJu_Check_Report.xaml.cs">
<DependentUpon>LanJu_Check_Report.xaml</DependentUpon>
</Compile>
<Compile Include="Views\LanJu_Conversion_Report.xaml.cs">
<DependentUpon>LanJu_Conversion_Report.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Lanju_Daily_Check_Report.xaml.cs">
<DependentUpon>Lanju_Daily_Check_Report.xaml</DependentUpon>
</Compile>
<Compile Include="Views\LanJu_First_Inspection_Reprot.xaml.cs">
<DependentUpon>LanJu_First_Inspection_Reprot.xaml</DependentUpon>
</Compile>
@ -736,6 +742,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\InputNumberDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\LanJu_Check_Report.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -744,6 +754,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\Lanju_Daily_Check_Report.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\LanJu_First_Inspection_Reprot.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>

@ -3,10 +3,10 @@
<Recommand>强烈建议:对数据库以及本软件的参数更改,不要在此页进行.可以通过系统配置页进行更新.</Recommand>
<!--本地的业务数据库-->
<MESClientConnectionString>vadMWi9D6ZBkwIr78LoLmGwiSCvVnpY3nMB7IyQlxFiV2OD5s5WUgOabwGwWK3THofFvPL2rHpOvJVIvtz0oZU/NFQyT8KQlbk0rHjUXoU7wgRdUumDJ1RrSFmIjPm8S</MESClientConnectionString>
<!--榄菊业务数据库-->
<!--榄菊业务数据库-->
<MESNetClientConnectionString>vadMWi9D6ZC3usVUY51rbTRH8TjL6CxlHbduXNDkc8suJwqe10me6ktk8XD3QU91A7V9zSnfhmhLWUQKZQdqof6chkC37l6QElb57z876mZdo9764iNmLGULHBiQyMu6PXowBdyaQVt17BPsWFn4EUs7Z7zTZwBP+2iJBVXitA3OF6EZXxAztmeZk/1iCwni+JzeWNpXqeOoGzkmSSzmVQH2Yf9m/mlqag2TbldSCcnUQl6lE7tcGg==</MESNetClientConnectionString>
<!--榄菊云数据库-->
<CloudConnectionString>vadMWi9D6ZC3usVUY51rbTRH8TjL6CxlHbduXNDkc8suJwqe10me6ktk8XD3QU91ML11cYCqHcHmTXJFsNQamIbW3UEpkjgNPUcBwRfgP6AWftvk9YFyv7y7/6nzX/c+6z6xMDIdcjYVvfteU+7YtOQhJXTfF5ScosAA0GliBfD8dWAunW+ZCos5LemAj2xb2wvvCxlbnrof8IunWslCaBEAGrdC/KhE0qEfNbxydwc=</CloudConnectionString>
<!--榄菊云数据库-->
<CloudConnectionString>vadMWi9D6ZC3usVUY51rbTRH8TjL6CxlHbduXNDkc8suJwqe10me6ktk8XD3QU91ML11cYCqHcHmTXJFsNQamIbW3UEpkjgNPUcBwRfgP6AWftvk9YFyv7y7/6nzX/c+6z6xMDIdcjYVvfteU+7YtOQhJXTfF5ScosAA0GliBfD8dWAunW+ZCos5LemAj2xb2wvvCxlbnrof8IunWslCaBEAGrdC/KhE0qEfNbxydwc=</CloudConnectionString>

Loading…
Cancel
Save