using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Opsoft.NetCore.O3App.Domain; using Opsoft.NetCore.O3App.Domain.Interface; using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IRepositories; using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices; using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model; using Opsoft.NetCore.O3App.Repositories.WMS; using Opsoft.NetCore.O3App.Shared; namespace Opsoft.NetCore.O3App.Services.WMS { [MapTo(typeof(ISTKStockSchemeService), ServiceLifetime.Transient)] public class STKStockSchemeService : ServiceBase, ISTKStockSchemeService { public STKStockSchemeService(ISTKStockSchemeRepository repository, IBarcodeRepository barcodeRepository) : base(repository) { Init(repository); (repository as STKStockSchemeRepository).Init(barcodeRepository); } /// /// 查询盘点方案 /// /// /// public async Task QuerySourceInvPrg(STKStockScheme SData) { if (SData.sourceBillNO == "") { throw new O3AppException("传参信息错误,盘点方案编码为空", 400); } return await (repository as ISTKStockSchemeRepository).QuerySourceInvPrg(SData); } /// /// 盘点方案提交 /// /// /// public async Task SubmitBill(Barcode_Inv SData) { if (SData.sourceBillNO == null || SData.sourceBillNO.ToString() == "") { throw new O3AppException("传参信息错误,盘点方案编号未定义!!", 400); } if (SData.submitData == null || SData.submitData.Count <= 0) { throw new O3AppException("提交信息为空!!", 400); } return await (repository as ISTKStockSchemeRepository).SubmitBill(SData); } } }