| | |
| | | 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 |
| | | { |