|
|
@ -1,5 +1,6 @@ |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Net.Http; |
|
|
|
using System.Net.Http.Headers; |
|
|
|
using System.Text; |
|
|
@ -12,10 +13,12 @@ using Microsoft.EntityFrameworkCore; |
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
using Microsoft.Extensions.Logging; |
|
|
|
using Microsoft.Extensions.Options; |
|
|
|
using Volo.Abp; |
|
|
|
using Volo.Abp.BackgroundWorkers; |
|
|
|
using Volo.Abp.IdentityServer.Clients; |
|
|
|
using Volo.Abp.Threading; |
|
|
|
using Volo.Abp.Uow; |
|
|
|
using Volo.Abp.Validation; |
|
|
|
using Win_in.Sfs.Wms.DataExchange.Domain; |
|
|
|
using Win_in.Sfs.Wms.DataExchange.Domain.Shared; |
|
|
|
using Win_in.Sfs.Wms.DataExchange.Wms; |
|
|
@ -72,12 +75,23 @@ public class IncomingToWmsWorker : AsyncPeriodicBackgroundWorkerBase |
|
|
|
await AddOrUpdateWmsAsync(workerContext, incomingToWms).ConfigureAwait(false); |
|
|
|
|
|
|
|
} |
|
|
|
catch (AbpValidationException ex) |
|
|
|
{ |
|
|
|
string Verification = ""; |
|
|
|
if (ex.ValidationErrors.Count > 0) |
|
|
|
{ |
|
|
|
Verification = ex.ValidationErrors |
|
|
|
.Select(err => err.ToString()) |
|
|
|
.Aggregate(string.Empty, (current, next) => string.Format("{0} {1}", current, next)); |
|
|
|
} |
|
|
|
//throw new UserFriendlyException(Verification + ex.Message + Convert.ToString(ex.InnerException), null, ex.Message);
|
|
|
|
incomingToWms.SetError(EnumExchangeDataErrorCode.Exception, Verification + ex.Message + Convert.ToString(ex.InnerException)); |
|
|
|
} |
|
|
|
catch (Exception e) |
|
|
|
{ |
|
|
|
e = e.GetBaseException(); |
|
|
|
incomingToWms.SetError(EnumExchangeDataErrorCode.Exception, e.Message); |
|
|
|
} |
|
|
|
|
|
|
|
//归档并删除
|
|
|
|
await incomingToWmsManager.ArchiveAsync(incomingToWms).ConfigureAwait(false); |
|
|
|
} |
|
|
|