| | |
| | | "WorkspaceRootPath": "C:\\Workspace\\PdmSwPlugin2\\", |
| | | "Documents": [ |
| | | { |
| | | "AbsoluteMoniker": "D:0:0:{6E609A8C-583B-4607-A510-FA84218C4A31}|PdmSwPlugin.Main\\PdmSwPlugin.Main.csproj|C:\\Workspace\\PdmSwPlugin2\\pdmswplugin.main\\constant\\pluginconst.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", |
| | | "AbsoluteMoniker": "D:0:0:{6E609A8C-583B-4607-A510-FA84218C4A31}|PdmSwPlugin.Main\\PdmSwPlugin.Main.csproj|c:\\workspace\\pdmswplugin2\\pdmswplugin.main\\constant\\pluginconst.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", |
| | | "RelativeMoniker": "D:0:0:{6E609A8C-583B-4607-A510-FA84218C4A31}|PdmSwPlugin.Main\\PdmSwPlugin.Main.csproj|solutionrelative:pdmswplugin.main\\constant\\pluginconst.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" |
| | | }, |
| | | { |
| | |
| | | "RelativeMoniker": "D:0:0:{1033FBD8-8700-4CD0-808A-BB97DB057A6B}|PdmSwPlugin.PDM\\PdmSwPlugin.PDM.csproj|solutionrelative:pdmswplugin.pdm\\pdmcontrol.xaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" |
| | | }, |
| | | { |
| | | "AbsoluteMoniker": "D:0:0:{BE239D32-7253-4D19-8793-159E98545B55}|PdmSwPlugin.DrawApprove\\PdmSwPlugin.DrawApprove.csproj|c:\\workspace\\pdmswplugin2\\pdmswplugin.drawapprove\\drawaudithiscontrol.xaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", |
| | | "RelativeMoniker": "D:0:0:{BE239D32-7253-4D19-8793-159E98545B55}|PdmSwPlugin.DrawApprove\\PdmSwPlugin.DrawApprove.csproj|solutionrelative:pdmswplugin.drawapprove\\drawaudithiscontrol.xaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" |
| | | }, |
| | | { |
| | | "AbsoluteMoniker": "D:0:0:{E17EF6B6-EE83-45AA-B0C0-E3A097089E97}|PdmSwPlugin.Common\\PdmSwPlugin.Common.csproj|C:\\Workspace\\PdmSwPlugin2\\pdmswplugin.common\\entity\\drawaudit\\drawaudit.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", |
| | | "RelativeMoniker": "D:0:0:{E17EF6B6-EE83-45AA-B0C0-E3A097089E97}|PdmSwPlugin.Common\\PdmSwPlugin.Common.csproj|solutionrelative:pdmswplugin.common\\entity\\drawaudit\\drawaudit.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" |
| | | }, |
| | | { |
| | | "AbsoluteMoniker": "D:0:0:{6E609A8C-583B-4607-A510-FA84218C4A31}|PdmSwPlugin.Main\\PdmSwPlugin.Main.csproj|c:\\workspace\\pdmswplugin2\\pdmswplugin.main\\swaddin\\maincontrol.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", |
| | | "RelativeMoniker": "D:0:0:{6E609A8C-583B-4607-A510-FA84218C4A31}|PdmSwPlugin.Main\\PdmSwPlugin.Main.csproj|solutionrelative:pdmswplugin.main\\swaddin\\maincontrol.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" |
| | | }, |
| | | { |
| | | "AbsoluteMoniker": "D:0:0:{6E609A8C-583B-4607-A510-FA84218C4A31}|PdmSwPlugin.Main\\PdmSwPlugin.Main.csproj|c:\\workspace\\pdmswplugin2\\pdmswplugin.main\\maincontrol.xaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", |
| | | "RelativeMoniker": "D:0:0:{6E609A8C-583B-4607-A510-FA84218C4A31}|PdmSwPlugin.Main\\PdmSwPlugin.Main.csproj|solutionrelative:pdmswplugin.main\\maincontrol.xaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" |
| | | }, |
| | | { |
| | | "AbsoluteMoniker": "D:0:0:{BE239D32-7253-4D19-8793-159E98545B55}|PdmSwPlugin.DrawApprove\\PdmSwPlugin.DrawApprove.csproj|C:\\Workspace\\PdmSwPlugin2\\pdmswplugin.drawapprove\\drawapprove.xaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", |
| | | "AbsoluteMoniker": "D:0:0:{BE239D32-7253-4D19-8793-159E98545B55}|PdmSwPlugin.DrawApprove\\PdmSwPlugin.DrawApprove.csproj|c:\\workspace\\pdmswplugin2\\pdmswplugin.drawapprove\\drawapprove.xaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", |
| | | "RelativeMoniker": "D:0:0:{BE239D32-7253-4D19-8793-159E98545B55}|PdmSwPlugin.DrawApprove\\PdmSwPlugin.DrawApprove.csproj|solutionrelative:pdmswplugin.drawapprove\\drawapprove.xaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" |
| | | }, |
| | | { |
| | | "AbsoluteMoniker": "D:0:0:{BE239D32-7253-4D19-8793-159E98545B55}|PdmSwPlugin.DrawApprove\\PdmSwPlugin.DrawApprove.csproj|C:\\Workspace\\PdmSwPlugin2\\pdmswplugin.drawapprove\\drawapprove.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}", |
| | | "RelativeMoniker": "D:0:0:{BE239D32-7253-4D19-8793-159E98545B55}|PdmSwPlugin.DrawApprove\\PdmSwPlugin.DrawApprove.csproj|solutionrelative:pdmswplugin.drawapprove\\drawapprove.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}" |
| | | "AbsoluteMoniker": "D:0:0:{E17EF6B6-EE83-45AA-B0C0-E3A097089E97}|PdmSwPlugin.Common\\PdmSwPlugin.Common.csproj|c:\\workspace\\pdmswplugin2\\pdmswplugin.common\\util\\dmsldfileextentionchecker.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", |
| | | "RelativeMoniker": "D:0:0:{E17EF6B6-EE83-45AA-B0C0-E3A097089E97}|PdmSwPlugin.Common\\PdmSwPlugin.Common.csproj|solutionrelative:pdmswplugin.common\\util\\dmsldfileextentionchecker.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" |
| | | }, |
| | | { |
| | | "AbsoluteMoniker": "D:0:0:{E17EF6B6-EE83-45AA-B0C0-E3A097089E97}|PdmSwPlugin.Common\\PdmSwPlugin.Common.csproj|C:\\Workspace\\PdmSwPlugin2\\pdmswplugin.common\\entity\\drawaudit\\drawauditorder.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", |
| | | "RelativeMoniker": "D:0:0:{E17EF6B6-EE83-45AA-B0C0-E3A097089E97}|PdmSwPlugin.Common\\PdmSwPlugin.Common.csproj|solutionrelative:pdmswplugin.common\\entity\\drawaudit\\drawauditorder.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" |
| | | "AbsoluteMoniker": "D:0:0:{7ACEDAA9-2DE8-4485-837A-E7D58812A6DC}|PdmSw\\PdmSw.csproj|c:\\workspace\\pdmswplugin2\\pdmsw\\settings\\pluginsetting.xml||{FA3CD31E-987B-443A-9B81-186104E8DAC1}", |
| | | "RelativeMoniker": "D:0:0:{7ACEDAA9-2DE8-4485-837A-E7D58812A6DC}|PdmSw\\PdmSw.csproj|solutionrelative:pdmsw\\settings\\pluginsetting.xml||{FA3CD31E-987B-443A-9B81-186104E8DAC1}" |
| | | } |
| | | ], |
| | | "DocumentGroupContainers": [ |
| | |
| | | "DocumentGroups": [ |
| | | { |
| | | "DockedWidth": 200, |
| | | "SelectedChildIndex": 5, |
| | | "SelectedChildIndex": 0, |
| | | "Children": [ |
| | | { |
| | | "$type": "Document", |
| | | "DocumentIndex": 2, |
| | | "Title": "DrawAuditHisControl.xaml.cs", |
| | | "DocumentMoniker": "C:\\Workspace\\PdmSwPlugin2\\PdmSwPlugin.DrawApprove\\DrawAuditHisControl.xaml.cs", |
| | | "RelativeDocumentMoniker": "PdmSwPlugin.DrawApprove\\DrawAuditHisControl.xaml.cs", |
| | | "ToolTip": "C:\\Workspace\\PdmSwPlugin2\\PdmSwPlugin.DrawApprove\\DrawAuditHisControl.xaml.cs", |
| | | "RelativeToolTip": "PdmSwPlugin.DrawApprove\\DrawAuditHisControl.xaml.cs", |
| | | "ViewState": "AQIAABYBAAAAAAAAAAAiwCgBAAAgAAAA", |
| | | "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", |
| | | "WhenOpened": "2024-08-21T08:12:02.317Z", |
| | | "EditorCaption": "" |
| | | }, |
| | | { |
| | | "$type": "Document", |
| | | "DocumentIndex": 4, |
| | | "Title": "MainControl.cs", |
| | | "DocumentMoniker": "C:\\Workspace\\PdmSwPlugin2\\PdmSwPlugin.Main\\SwAddIn\\MainControl.cs", |
| | | "RelativeDocumentMoniker": "PdmSwPlugin.Main\\SwAddIn\\MainControl.cs", |
| | | "ToolTip": "C:\\Workspace\\PdmSwPlugin2\\PdmSwPlugin.Main\\SwAddIn\\MainControl.cs", |
| | | "RelativeToolTip": "PdmSwPlugin.Main\\SwAddIn\\MainControl.cs", |
| | | "ViewState": "AQIAAHAAAAAAAAAAAAAAAHgAAABHAAAA", |
| | | "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", |
| | | "WhenOpened": "2024-08-21T07:59:50.181Z", |
| | | "EditorCaption": "" |
| | | }, |
| | | { |
| | | "$type": "Document", |
| | | "DocumentIndex": 5, |
| | | "Title": "MainControl.xaml.cs", |
| | | "DocumentMoniker": "C:\\Workspace\\PdmSwPlugin2\\PdmSwPlugin.Main\\MainControl.xaml.cs", |
| | | "RelativeDocumentMoniker": "PdmSwPlugin.Main\\MainControl.xaml.cs", |
| | | "ToolTip": "C:\\Workspace\\PdmSwPlugin2\\PdmSwPlugin.Main\\MainControl.xaml.cs", |
| | | "RelativeToolTip": "PdmSwPlugin.Main\\MainControl.xaml.cs", |
| | | "ViewState": "AQIAAKAAAAAAAAAAAAAowBEAAAAAAAAA", |
| | | "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", |
| | | "WhenOpened": "2024-08-21T07:59:44.275Z", |
| | | "EditorCaption": "" |
| | | }, |
| | | { |
| | | "$type": "Document", |
| | | "DocumentIndex": 7, |
| | | "Title": "DrawApprove.xaml", |
| | | "DocumentMoniker": "C:\\Workspace\\PdmSwPlugin2\\PdmSwPlugin.DrawApprove\\DrawApprove.xaml", |
| | | "RelativeDocumentMoniker": "PdmSwPlugin.DrawApprove\\DrawApprove.xaml", |
| | | "ToolTip": "C:\\Workspace\\PdmSwPlugin2\\PdmSwPlugin.DrawApprove\\DrawApprove.xaml", |
| | | "RelativeToolTip": "PdmSwPlugin.DrawApprove\\DrawApprove.xaml", |
| | | "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|", |
| | | "WhenOpened": "2024-08-20T03:02:33.757Z" |
| | | }, |
| | | { |
| | | "$type": "Document", |
| | | "DocumentIndex": 8, |
| | | "Title": "DrawAuditOrder.cs", |
| | | "DocumentMoniker": "C:\\Workspace\\PdmSwPlugin2\\PdmSwPlugin.Common\\Entity\\DrawAudit\\DrawAuditOrder.cs", |
| | | "RelativeDocumentMoniker": "PdmSwPlugin.Common\\Entity\\DrawAudit\\DrawAuditOrder.cs", |
| | | "ToolTip": "C:\\Workspace\\PdmSwPlugin2\\PdmSwPlugin.Common\\Entity\\DrawAudit\\DrawAuditOrder.cs", |
| | | "RelativeToolTip": "PdmSwPlugin.Common\\Entity\\DrawAudit\\DrawAuditOrder.cs", |
| | | "ViewState": "AQIAAAAAAAAAAAAAAAAAAAkAAAAFAAAA", |
| | | "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", |
| | | "WhenOpened": "2024-08-20T02:13:49.926Z" |
| | | }, |
| | | { |
| | | "$type": "Document", |
| | | "DocumentIndex": 0, |
| | |
| | | "RelativeToolTip": "PdmSwPlugin.Main\\Constant\\PluginConst.cs", |
| | | "ViewState": "AQIAAAAAAAAAAAAAAAAAAAgAAAAAAAAA", |
| | | "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", |
| | | "WhenOpened": "2024-08-18T12:05:54.617Z", |
| | | "WhenOpened": "2024-08-27T02:20:56.948Z", |
| | | "EditorCaption": "" |
| | | }, |
| | | { |
| | | "$type": "Document", |
| | | "DocumentIndex": 3, |
| | | "Title": "DMSldFileExtentionChecker.cs", |
| | | "DocumentMoniker": "C:\\Workspace\\PdmSwPlugin2\\PdmSwPlugin.Common\\Util\\DMSldFileExtentionChecker.cs", |
| | | "RelativeDocumentMoniker": "PdmSwPlugin.Common\\Util\\DMSldFileExtentionChecker.cs", |
| | | "ToolTip": "C:\\Workspace\\PdmSwPlugin2\\PdmSwPlugin.Common\\Util\\DMSldFileExtentionChecker.cs", |
| | | "RelativeToolTip": "PdmSwPlugin.Common\\Util\\DMSldFileExtentionChecker.cs", |
| | | "ViewState": "AQIAAAsAAAAAAAAAAAAYwBMAAAA2AAAA", |
| | | "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", |
| | | "WhenOpened": "2024-08-27T01:56:05.638Z", |
| | | "EditorCaption": "" |
| | | }, |
| | | { |
| | | "$type": "Document", |
| | | "DocumentIndex": 4, |
| | | "Title": "PluginSetting.xml", |
| | | "DocumentMoniker": "C:\\Workspace\\PdmSwPlugin2\\PdmSw\\Settings\\PluginSetting.xml", |
| | | "RelativeDocumentMoniker": "PdmSw\\Settings\\PluginSetting.xml", |
| | | "ToolTip": "C:\\Workspace\\PdmSwPlugin2\\PdmSw\\Settings\\PluginSetting.xml", |
| | | "RelativeToolTip": "PdmSw\\Settings\\PluginSetting.xml", |
| | | "ViewState": "AQIAAAAAAAAAAAAAAAAAAAcAAAAmAAAA", |
| | | "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003576|", |
| | | "WhenOpened": "2024-08-27T01:51:40.382Z", |
| | | "EditorCaption": "" |
| | | }, |
| | | { |
| | |
| | | "RelativeDocumentMoniker": "PdmSwPlugin.PDM\\PdmControl.xaml.cs", |
| | | "ToolTip": "C:\\Workspace\\PdmSwPlugin2\\PdmSwPlugin.PDM\\PdmControl.xaml.cs", |
| | | "RelativeToolTip": "PdmSwPlugin.PDM\\PdmControl.xaml.cs", |
| | | "ViewState": "AQIAAFMEAAAAAAAAAAAAALEGAAAAAAAA", |
| | | "ViewState": "AQIAAJQCAAAAAAAAAAAYwJ0CAAA1AAAA", |
| | | "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", |
| | | "WhenOpened": "2024-08-18T08:40:17.518Z", |
| | | "WhenOpened": "2024-08-27T01:28:33.744Z", |
| | | "EditorCaption": "" |
| | | }, |
| | | { |
| | | "$type": "Document", |
| | | "DocumentIndex": 6, |
| | | "DocumentIndex": 2, |
| | | "Title": "DrawApprove.xaml.cs", |
| | | "DocumentMoniker": "C:\\Workspace\\PdmSwPlugin2\\PdmSwPlugin.DrawApprove\\DrawApprove.xaml.cs", |
| | | "RelativeDocumentMoniker": "PdmSwPlugin.DrawApprove\\DrawApprove.xaml.cs", |
| | | "ToolTip": "C:\\Workspace\\PdmSwPlugin2\\PdmSwPlugin.DrawApprove\\DrawApprove.xaml.cs", |
| | | "RelativeToolTip": "PdmSwPlugin.DrawApprove\\DrawApprove.xaml.cs", |
| | | "ViewState": "AQIAAAEBAAAAAAAAAAAkwBcBAAA2AAAA", |
| | | "ViewState": "AQIAAM8AAAAAAAAAAAAgwLcAAAAAAAAA", |
| | | "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", |
| | | "WhenOpened": "2024-08-18T08:30:42.283Z" |
| | | }, |
| | | { |
| | | "$type": "Document", |
| | | "DocumentIndex": 3, |
| | | "Title": "DrawAudit.cs", |
| | | "DocumentMoniker": "C:\\Workspace\\PdmSwPlugin2\\PdmSwPlugin.Common\\Entity\\DrawAudit\\DrawAudit.cs", |
| | | "RelativeDocumentMoniker": "PdmSwPlugin.Common\\Entity\\DrawAudit\\DrawAudit.cs", |
| | | "ToolTip": "C:\\Workspace\\PdmSwPlugin2\\PdmSwPlugin.Common\\Entity\\DrawAudit\\DrawAudit.cs", |
| | | "RelativeToolTip": "PdmSwPlugin.Common\\Entity\\DrawAudit\\DrawAudit.cs", |
| | | "ViewState": "AQIAAAYAAAAAAAAAAAAAABAAAAAWAAAA", |
| | | "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", |
| | | "WhenOpened": "2024-08-18T08:28:05.337Z", |
| | | "WhenOpened": "2024-08-26T06:10:46.307Z", |
| | | "EditorCaption": "" |
| | | } |
| | | ] |
| | |
| | | using PdmSwPlugin.Common; |
| | | using PdmSwPlugin.Common.Entity.DrawAudit; |
| | | using PdmSwPlugin.Common.Entity.Pdm; |
| | | using PdmSwPlugin.Common.Entity.System; |
| | | using PdmSwPlugin.Common.Interface; |
| | | using PdmSwPlugin.Common.Setting; |
| | | using PdmSwPlugin.Common.Util; |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Logger.Error("UI update failed.", ex); |
| | | this.Error($"UI更新列表失败!异常:{ex}"); |
| | | Logger.Error($"V{PdmUser.LoginUser.pluginVersion}, UI update failed.", ex); |
| | | this.Error($"V{PdmUser.LoginUser.pluginVersion},UI更新列表失败!异常:{ex}"); |
| | | dataSource = new ObservableCollection<DrawAudit>(); |
| | | } |
| | | finally |
| | |
| | | } |
| | | else if (err != 0) |
| | | { |
| | | Logger.Error($"OpenDoc6 Failed,Error:{err}.See Solidworks Doc."); |
| | | Logger.Error($"V{PdmUser.LoginUser.pluginVersion}, OpenDoc6 Failed,Error:{err}.See Solidworks Doc."); |
| | | } |
| | | else if (warn == 128) |
| | | { |
| | |
| | | ""); |
| | | } |
| | | |
| | | private string GetRealFilePath(string dbPath) |
| | | private string GetRealFilePath(string relativePath) |
| | | { |
| | | string fileName = Path.GetFileName(dbPath); |
| | | string filePath = Path.Combine(PluginSetting.Instance.SwFilePath, fileName); |
| | | // string fileName = Path.GetFileName(dbPath); |
| | | // string filePath = Path.Combine(PluginSetting.Instance.SwFilePath, dbPath); |
| | | string filePath = PluginSetting.Instance.SwFilePath + relativePath; |
| | | return filePath; |
| | | } |
| | | |
| | |
| | | this.Error($"服务器中未找到图纸文件,路径:{filePath}"); |
| | | return; |
| | | } |
| | | OpenDocMayError(filePath, (int)swDocumentTypes_e.swDocPART, (int)swOpenDocOptions_e.swOpenDocOptions_ReadOnly, |
| | | |
| | | OpenDocMayError(filePath, (int)FileExtentionChecker.Check(filePath, out _), (int)swOpenDocOptions_e.swOpenDocOptions_ReadOnly, |
| | | ""); |
| | | } |
| | | |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Logger.Error("Get draw audit data list failed.", ex); |
| | | this.Error($"刷新列表失败!异常:{ex.Message}"); |
| | | Logger.Error($"V{PdmUser.LoginUser.pluginVersion}, Get draw audit data list failed.", ex); |
| | | this.Error($"V{PdmUser.LoginUser.pluginVersion},刷新列表失败!异常:{ex.Message}"); |
| | | return new List<DrawAudit>(); |
| | | } |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | string modelPath = Path.Combine(PluginSetting.Instance.SwFilePath, Path.GetFileName(da.d3RelativePath)); |
| | | string drawingPath = Path.Combine(PluginSetting.Instance.SwFilePath, Path.GetFileName(da.d2RelativePath)); |
| | | string modelPath = GetRealFilePath(da.d3RelativePath); |
| | | string drawingPath = GetRealFilePath(da.d2RelativePath); |
| | | SwApp.CloseDoc(modelPath); |
| | | SwApp.CloseDoc(drawingPath); |
| | | } |
| | | catch (Exception exx) |
| | | { |
| | | Logger.Error("Auto close open doc failed.", exx); |
| | | Logger.Error($"V{PdmUser.LoginUser.pluginVersion}, Auto close open doc failed.", exx); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Logger.Error("Draw complete failed.", ex); |
| | | this.Error($"审核失败!{ex.Message}"); |
| | | Logger.Error($"V{PdmUser.LoginUser.pluginVersion}, Draw complete failed.", ex); |
| | | this.Error($"V{PdmUser.LoginUser.pluginVersion},审核失败!{ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Logger.Error("Get draw audit history failed.", ex); |
| | | this.Error($"获取审核历史失败!{ex.Message}"); |
| | | Logger.Error($"V{PdmUser.LoginUser.pluginVersion},Get draw audit history failed.", ex); |
| | | this.Error($"V{PdmUser.LoginUser.pluginVersion},获取审核历史失败!{ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | |
| | | public class PluginConst |
| | | { |
| | | public static readonly string AppId = "DF23E96F-A469-4302-8367-7FA2F798CD09"; |
| | | public static readonly string Version = "0.0.0.37"; |
| | | public static readonly string Version = "0.0.0.39"; |
| | | } |
| | | } |
| | |
| | | pluginVersion = PluginConst.Version |
| | | }); |
| | | PdmUser user = res.HandleResult(); |
| | | user.appId = PluginConst.AppId; |
| | | user.pluginVersion = PluginConst.Version; |
| | | callback(user); |
| | | } |
| | | catch (Exception e) |
| | |
| | | { |
| | | Result<PdmUser> res = HttpClientCreator.PostSyncAction<PdmUser>("openApi/wpf/login", param); |
| | | PdmUser user = res.HandleResult(); |
| | | user.appId = PluginConst.AppId; |
| | | user.pluginVersion = PluginConst.Version; |
| | | Dispatcher.Invoke(() => |
| | | { |
| | | PdmUser.SetLoginUser(user); |
| | |
| | | using System.Windows.Interop; |
| | | using PdmSwPlugin.Commmon.Control; |
| | | using PdmSwPlugin.Common.Entity.System; |
| | | using System.Windows.Documents; |
| | | |
| | | namespace PdmSwPlugin.PDM |
| | | { |
| | |
| | | { |
| | | // FillBomInfo(boms, bomInfos, drawInfos); |
| | | model.BomTree = new ObservableCollection<PdmBom>(); |
| | | Logger.Error("刷新BOM列表失败!", e); |
| | | this.Warning(e.Message); |
| | | Logger.Error($"V{PdmUser.LoginUser.pluginVersion}, Refresh Bom List Failed.", e); |
| | | this.Error($"V{PdmUser.LoginUser.pluginVersion},刷新失败:{e.Message}"); |
| | | return new ObservableCollection<PdmBom>(); |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Logger.Error("检入BOM失败!", ex); |
| | | this.Show(ex.Message, true); |
| | | Logger.Error($"V{PdmUser.LoginUser.pluginVersion},Check In Bom Failed.", ex); |
| | | this.Error($"V{PdmUser.LoginUser.pluginVersion},检入Bom失败!{ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Logger.Error("检入BOM失败!", ex); |
| | | this.Show(ex.Message, true); |
| | | Logger.Error($"V{PdmUser.LoginUser.pluginVersion}, Check In BOM Failed.", ex); |
| | | this.Error($"V{PdmUser.LoginUser.pluginVersion},检入BOM失败!{ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Logger.Error("附带图纸检入BOM失败!", ex); |
| | | this.Show(ex.Message, true); |
| | | Logger.Error($"V{PdmUser.LoginUser.pluginVersion}, Check In Bom With File Failed.", ex); |
| | | this.Error($"V{PdmUser.LoginUser.pluginVersion},检入失败!{ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | |
| | | foreach (PdmBom bom in errors.Keys) |
| | | { |
| | | Exception err = errors[bom]; |
| | | Logger.Error($"[{bom.partModel}]上传图纸错误!", err); |
| | | Logger.Error($"V{PdmUser.LoginUser.pluginVersion},[{bom.partModel}] Upload Draw Failed.", err); |
| | | Msg += $"[{bom.partModel}]上传图纸错误!{err.Message}\r\n"; |
| | | } |
| | | this.Show(Msg); |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Logger.Error("附带图纸检入BOM失败!", ex); |
| | | this.Show(ex.Message, true); |
| | | Logger.Error($"V{PdmUser.LoginUser.pluginVersion}, Check In BOM With File Failed.", ex); |
| | | this.Error($"V{PdmUser.LoginUser.pluginVersion},检入失败!{ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Logger.Error("导出建料文档失败!", ex); |
| | | this.Show(ex.Message, true); |
| | | Logger.Error($"V{PdmUser.LoginUser.pluginVersion}, Export Material Excel Failed.", ex); |
| | | this.Error($"V{PdmUser.LoginUser.pluginVersion},导出建料文档失败!{ex.Message}"); |
| | | } |
| | | } |
| | | |
| | |
| | | string refPath = SwDMUtil.GetDrawingRef(drawFilePath, out string errMsg); |
| | | if (refPath == null) |
| | | { |
| | | Logger.Error($"【{drawFilePath}】读取工程图引用路径失败 【{errMsg}】"); |
| | | Logger.Error($"V{PdmUser.LoginUser.pluginVersion}, [{drawFilePath}] Read slddrw Ref Path Failed.[{errMsg}]"); |
| | | } |
| | | else |
| | | { |
| | | refPath = Path.GetFileName(refPath); |
| | | } |
| | | Logger.Debug($"文档路径:【{filepath}】\r\n" + |
| | | Logger.Debug($"V{PdmUser.LoginUser.pluginVersion},文档路径:【{filepath}】\r\n" + |
| | | $"工程图路径:【{drawFilePath}】\r\n" + |
| | | $"文件全称:【{allProperties["文件全称"]}】\r\n" + |
| | | $"引用路径:【{refPath}】"); |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | Logger.Error($"【{filepath}】读取质量属性失败", e); |
| | | Logger.Error($"V{PdmUser.LoginUser.pluginVersion},[{filepath}] Read Mass Properties Failed.", e); |
| | | } |
| | | allProperties["图纸类型"] = bom.produceWay;//bom.BomInfo.jgj; |
| | | |
| | |
| | | { |
| | | bom.drawInfo.checkRuleResult = 2; |
| | | bom.drawInfo.errMessages = new List<string> { e.Message }; |
| | | Logger.Error($"【{bom.filePath}】读取属性失败", e); |
| | | Logger.Error($"V{PdmUser.LoginUser.pluginVersion},[{bom.filePath}] Read MASS Properies Failed.", e); |
| | | } |
| | | finally |
| | | { |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Logger.Error("PDM check rule failed.", ex); |
| | | this.Show($"图纸检查执行失败:{ex.Message}", true); |
| | | Logger.Error($"V{PdmUser.LoginUser.pluginVersion}, PDM check rule failed.", ex); |
| | | this.Error($"V{PdmUser.LoginUser.pluginVersion},图纸检查执行失败!{ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Logger.Error($"请求审批单号失败", ex); |
| | | this.Error($"请求审批单号失败! {ex.Message}"); |
| | | Logger.Error($"V{PdmUser.LoginUser.pluginVersion}, Request AuditOrder Code Failed.", ex); |
| | | this.Error($"V{PdmUser.LoginUser.pluginVersion},请求审批单号失败! {ex.Message}"); |
| | | return; |
| | | } |
| | | |
| | | ConcurrentQueue<string> errs = new ConcurrentQueue<string>(); |
| | | CountdownEvent counter = new CountdownEvent(boms.Count); |
| | | int successCount = 0; |
| | | ConcurrentQueue<string> pathCache = new ConcurrentQueue<string>(boms.Select(b => b.filePath).ToList()); |
| | | foreach (PdmBom bom in boms) |
| | | { |
| | | Task.Run(() => |
| | |
| | | try |
| | | { |
| | | MaskAdorner.ShowMessage(content, $"正在上传【{bom.partNo}】..."); |
| | | string d3FilePath = bom.d3FilePath; |
| | | string d2FilePath = d3FilePath.Replace(Path.GetExtension(d3FilePath), ".slddrw"); |
| | | if (string.IsNullOrEmpty(d3FilePath) || !File.Exists(d3FilePath)) |
| | | { |
| | | throw new Exception($"未找到3D图纸"); |
| | | } |
| | | if (string.IsNullOrEmpty(d2FilePath) || !File.Exists(d2FilePath)) |
| | | { |
| | | throw new Exception($"未找到工程图纸"); |
| | | } |
| | | |
| | | FileInfo fileInfo; |
| | | MultipartFormDataContent httpContent = new MultipartFormDataContent(); |
| | | httpContent.Add(new StringContent(bom.partNo), "materialCode"); |
| | | httpContent.Add(new StringContent(bom.partNo), "materialModel"); |
| | | httpContent.Add(new StringContent(daOrder.id), "orderId"); |
| | | fileInfo = new FileInfo(d3FilePath); |
| | | FileInfo file2Info = new FileInfo(d2FilePath); |
| | | httpContent.Add(new ByteArrayContent(FileUtil.toByteArray(d3FilePath)), "d3File", fileInfo.Name); |
| | | httpContent.Add(new ByteArrayContent(FileUtil.toByteArray(d2FilePath)), "d2File", file2Info.Name); |
| | | |
| | | Result<DrawAudit> res = Client.PostSyncAction<DrawAudit>("drawAudit/add", httpContent); |
| | | DrawAudit da = res.HandleResult(); |
| | | UploadDraw(daOrder, bom, pathCache); |
| | | Interlocked.Increment(ref successCount); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Logger.Error($"物料【{bom.partModel}】发起审批失败!", ex); |
| | | errs.Enqueue($"物料【{bom.partModel}】发起审批失败!异常:{ex.Message}"); |
| | | Logger.Error($"V{PdmUser.LoginUser.pluginVersion}, [{bom.partModel}] Request Audit Failed.", ex); |
| | | errs.Enqueue($"物料【{bom.partModel}】发起审批失败!{ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | |
| | | } |
| | | catch (Exception ig) |
| | | { |
| | | Logger.Error("发送送审消息异常", ig); |
| | | Logger.Error($"V{PdmUser.LoginUser.pluginVersion}, Send Audit Socket Failed.", ig); |
| | | } |
| | | } |
| | | // 刷新服务器上的BOM信息 |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Logger.Error("Request audit failed", ex); |
| | | this.Error($"发起审批异常!{ex}"); |
| | | Logger.Error($"V{PdmUser.LoginUser.pluginVersion}, Request audit failed", ex); |
| | | this.Error($"V{PdmUser.LoginUser.pluginVersion},发起审批异常!{ex}"); |
| | | } |
| | | finally |
| | | { |
| | |
| | | MaskAdorner.HideMask(content); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 上传图纸操作 |
| | | /// </summary> |
| | | /// <param name="daOrder"></param> |
| | | /// <param name="bom"></param> |
| | | private void UploadDraw(DrawAuditOrder daOrder, PdmBom bom, ConcurrentQueue<string> pathCache) |
| | | { |
| | | if (bom.BomInfo.drawingType == (int)swDocumentTypes_e.swDocASSEMBLY && bom.children != null && bom.children.Count > 0) |
| | | { |
| | | foreach (PdmBom child in bom.children) |
| | | { |
| | | UploadChildDraw(daOrder, child, true, pathCache); |
| | | } |
| | | } |
| | | UploadSingleDraw(daOrder, bom, false); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 上传子零件图纸,有递归 |
| | | /// </summary> |
| | | /// <param name="daOrder"></param> |
| | | /// <param name="bom"></param> |
| | | /// <param name="justUpload"></param> |
| | | private void UploadChildDraw(DrawAuditOrder daOrder, PdmBom bom, bool justUpload, ConcurrentQueue<string> pathCache) |
| | | { |
| | | if (bom.BomInfo.drawingType == (int)swDocumentTypes_e.swDocASSEMBLY && bom.children != null && bom.children.Count > 0) |
| | | { |
| | | foreach (PdmBom child in bom.children) |
| | | { |
| | | UploadChildDraw(daOrder, child, justUpload, pathCache); |
| | | } |
| | | } |
| | | if (!pathCache.Contains(bom.filePath)) |
| | | { |
| | | UploadSingleDraw(daOrder, bom, justUpload); |
| | | pathCache.Append(bom.filePath); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 上传单张图纸 |
| | | /// </summary> |
| | | /// <param name="daOrder"></param> |
| | | /// <param name="bom"></param> |
| | | /// <param name="justUpload"></param> |
| | | /// <exception cref="Exception"></exception> |
| | | private void UploadSingleDraw(DrawAuditOrder daOrder, PdmBom bom, bool justUpload) |
| | | { |
| | | string d3FilePath = bom.d3FilePath; |
| | | string d2FilePath = d3FilePath.Replace(Path.GetExtension(d3FilePath), ".slddrw"); |
| | | if (string.IsNullOrEmpty(d3FilePath) || !File.Exists(d3FilePath)) |
| | | { |
| | | throw new Exception($"[{bom.partModel}]未找到3D图纸"); |
| | | } |
| | | // !justUpload(需要审核)要判断2D图纸存不存在 |
| | | if (!justUpload && (string.IsNullOrEmpty(d2FilePath) || !File.Exists(d2FilePath))) |
| | | { |
| | | throw new Exception($"[{bom.partModel}]未找到工程图纸"); |
| | | } |
| | | MultipartFormDataContent httpContent = new MultipartFormDataContent(); |
| | | httpContent.Add(new StringContent(bom.partNo), "materialCode"); |
| | | httpContent.Add(new StringContent(bom.partNo), "materialModel"); |
| | | httpContent.Add(new StringContent(daOrder.id), "orderId"); |
| | | httpContent.Add(new StringContent(justUpload.ToString()), "justUpload"); |
| | | FileInfo fileInfo = new FileInfo(d3FilePath); |
| | | httpContent.Add(new ByteArrayContent(FileUtil.toByteArray(d3FilePath)), "d3File", fileInfo.Name); |
| | | // !justUpload(需要审核)要上传2D图 |
| | | if (!justUpload) |
| | | { |
| | | FileInfo file2Info = new FileInfo(d2FilePath); |
| | | httpContent.Add(new ByteArrayContent(FileUtil.toByteArray(d2FilePath)), "d2File", file2Info.Name); |
| | | } |
| | | Result<DrawAudit> res = Client.PostSyncAction<DrawAudit>("drawAudit/add", httpContent); |
| | | DrawAudit da = res.HandleResult(); |
| | | } |
| | | |
| | | private void Exclude_Click(object sender, RoutedEventArgs e) |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Logger.Error("Get draw audit history failed.", ex); |
| | | this.Error($"获取审核历史失败!{ex.Message}"); |
| | | Logger.Error($"V{PdmUser.LoginUser.pluginVersion}, Get draw audit history failed.", ex); |
| | | this.Error($"V{PdmUser.LoginUser.pluginVersion},获取审核历史失败!{ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | |
| | | catch (Exception ex) |
| | | { |
| | | PtrCheckHandler?.Invoke(null, ex, false); |
| | | Logger.Error("PDM check rule failed.", ex); |
| | | this.Show($"图纸检查执行失败:{ex.Message}", true); |
| | | Logger.Error($"V{PdmUser.LoginUser.pluginVersion}, PDM check rule failed.", ex); |
| | | this.Error($"V{PdmUser.LoginUser.pluginVersion},图纸检查执行失败:{ex.Message}"); |
| | | } |
| | | finally |
| | | { |