|
@ -3,6 +3,7 @@ using System.Collections.Generic; |
|
|
using System.Linq; |
|
|
using System.Linq; |
|
|
using System.Threading.Tasks; |
|
|
using System.Threading.Tasks; |
|
|
using Microsoft.EntityFrameworkCore; |
|
|
using Microsoft.EntityFrameworkCore; |
|
|
|
|
|
|
|
|
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
|
|
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
|
|
using Volo.Abp.EntityFrameworkCore; |
|
|
using Volo.Abp.EntityFrameworkCore; |
|
|
using Win_in.Sfs.Scp.WebApi.Asns; |
|
|
using Win_in.Sfs.Scp.WebApi.Asns; |
|
@ -11,6 +12,8 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore; |
|
|
|
|
|
|
|
|
public class X12AsnRepository : EfCoreRepository<WebApiDbContext, X12Asn, Guid>, IX12AsnRepository |
|
|
public class X12AsnRepository : EfCoreRepository<WebApiDbContext, X12Asn, Guid>, IX12AsnRepository |
|
|
{ |
|
|
{ |
|
|
|
|
|
private const string Reader = "QAD Agent"; |
|
|
|
|
|
|
|
|
public X12AsnRepository(IDbContextProvider<WebApiDbContext> dbContextProvider) : base(dbContextProvider) |
|
|
public X12AsnRepository(IDbContextProvider<WebApiDbContext> dbContextProvider) : base(dbContextProvider) |
|
|
{ |
|
|
{ |
|
|
} |
|
|
} |
|
@ -28,7 +31,7 @@ public class X12AsnRepository : EfCoreRepository<WebApiDbContext, X12Asn, Guid>, |
|
|
{ |
|
|
{ |
|
|
foreach (var entity in list) |
|
|
foreach (var entity in list) |
|
|
{ |
|
|
{ |
|
|
entity.SetSuccess(); |
|
|
entity.SetSuccess(Reader); |
|
|
await UpdateAsync(entity); |
|
|
await UpdateAsync(entity); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -49,13 +52,13 @@ public class X12AsnRepository : EfCoreRepository<WebApiDbContext, X12Asn, Guid>, |
|
|
entity.SetProcessing(); |
|
|
entity.SetProcessing(); |
|
|
break; |
|
|
break; |
|
|
case EnumExchangeDataStatus.Finish: |
|
|
case EnumExchangeDataStatus.Finish: |
|
|
entity.SetSuccess(); |
|
|
entity.SetSuccess(Reader); |
|
|
break; |
|
|
break; |
|
|
case EnumExchangeDataStatus.Hold: |
|
|
case EnumExchangeDataStatus.Hold: |
|
|
entity.SetHold(); |
|
|
entity.SetHold(); |
|
|
break; |
|
|
break; |
|
|
case EnumExchangeDataStatus.Error: |
|
|
case EnumExchangeDataStatus.Error: |
|
|
entity.SetError(EnumExchangeDataErrorCode.Exception,""); |
|
|
entity.SetError(Reader, EnumExchangeDataErrorCode.Exception,""); |
|
|
break; |
|
|
break; |
|
|
default: |
|
|
default: |
|
|
throw new ArgumentOutOfRangeException(nameof(status), status, null); |
|
|
throw new ArgumentOutOfRangeException(nameof(status), status, null); |
|
|