37 lines
1.2 KiB
C#
Executable File
37 lines
1.2 KiB
C#
Executable File
using Microsoft.Extensions.DependencyInjection;
|
|
using Opsoft.Data;
|
|
using Opsoft.NetCore.O3App.Domain;
|
|
using Opsoft.NetCore.O3App.Domain.Interface;
|
|
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IRepositories;
|
|
using Opsoft.NetCore.O3App.Shared;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Opsoft.NetCore.O3App.Repositories.WMS
|
|
{
|
|
[MapTo(typeof(IProductBarcodeCheckRepository), ServiceLifetime.Transient)]
|
|
public class ProductBarcodeCheckRepository : RepositoryBase<BaseEntity>, IProductBarcodeCheckRepository
|
|
{
|
|
public ProductBarcodeCheckRepository() : base()
|
|
{
|
|
|
|
}
|
|
|
|
public async Task<List<string>> ExecuteAsync(Dictionary<string, string> sqlList)
|
|
{
|
|
await using APPServerContext dbContext = new APPServerContext(LoginInfo.DBAias, LoginInfo.UserID);
|
|
List<string> errorBarcode = new List<string>();
|
|
foreach (var sql in sqlList)
|
|
{
|
|
if (await dbContext.Database.SqlNonQueryAsync(sql.Value) <= 0)
|
|
{
|
|
errorBarcode.Add(sql.Key);
|
|
}
|
|
}
|
|
return errorBarcode;
|
|
}
|
|
}
|
|
}
|