| | |
| | | ConcurrentDictionary<string, DrawInfo> result = new ConcurrentDictionary<string, DrawInfo>(); |
| | | PdmBom topBom = model.BomTree[0]; |
| | | CountdownEvent counter = new CountdownEvent(1); |
| | | taskFactory.StartNew(() => |
| | | { |
| | | GetAllByTask(new object[] { |
| | | topBom, result, counter, ErrMsgs, 0 }); |
| | | }); |
| | | GetAllByTask(new object[] { topBom, result, counter, ErrMsgs, 0 }); |
| | | counter.Wait(); |
| | | // 不需要手动释放 |
| | | //counter.Dispose(); |
| | | return new Dictionary<string, DrawInfo>(result); |
| | | } |
| | | |
| | |
| | | int level = (int)datas[4]; |
| | | try |
| | | { |
| | | counter.TryAddCount(); |
| | | counter.AddCount(); |
| | | string filepath = bom.partNo; |
| | | lock (result) |
| | | { |
| | |
| | | /// <exception cref="Exception"></exception> |
| | | private void UploadSingleDraw(DrawAuditOrder daOrder, PdmBom bom, bool justUpload) |
| | | { |
| | | try |
| | | { |
| | | string d3FilePath = bom.d3FilePath; |
| | | string d2FilePath = d3FilePath.Replace(Path.GetExtension(d3FilePath), ".slddrw"); |
| | | if (string.IsNullOrEmpty(d3FilePath) || !File.Exists(d3FilePath)) |
| | |
| | | Result<DrawAudit> res = Client.PostSyncAction<DrawAudit>("drawAudit/add", httpContent); |
| | | DrawAudit da = res.HandleResult(); |
| | | } |
| | | catch (NullReferenceException nex) |
| | | { |
| | | Logger.Error($"UploadSingleDraw NullReferenceException.", nex); |
| | | } |
| | | } |
| | | |
| | | private void Exclude_Click(object sender, RoutedEventArgs e) |
| | | { |