using Microsoft.Extensions.DependencyInjection; 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.Shared; using System.Collections.Generic; using System.Threading.Tasks; namespace Opsoft.NetCore.O3App.Services.WMS { /// /// 外购入库 /// [MapTo(typeof(ISTKInStockService), ServiceLifetime.Transient)] public class STKInStockService : ServiceBase, ISTKInStockService { private readonly ISelBillRepository _selBillRepository; public STKInStockService(ISTKInStockRepository repository, ISelBillRepository selBillRepository) : base(repository) { Init(repository); Init(selBillRepository); _selBillRepository = selBillRepository; } /// /// 提交入库信息 /// /// /// public async Task STKInStockSubmit(InputBarCode request) { if (request.barcodeList == null || request.barcodeList.Count<=0) { return new RetMessage { Status = 0, Message = "提交信息为空" }; } string tranType = "STK_INSTOCK"; List selBillList = await _selBillRepository.QuerySelBill(request.orgID, tranType); if (selBillList == null || selBillList.Count <= 0) { return new RetMessage { Status = 0, Message = "外购入库对应的出入库流程信息未找到" }; } request.TranType = tranType; return await (repository as ISTKInStockRepository).STKInStockSubmit(request, selBillList); } /// /// 提交退料信息 /// /// /// public async Task PURRetStockSubmit(InputBarCode request) { if (request.barcodeList == null || request.barcodeList.Count <= 0) { return new RetMessage { Status = 0, Message = "提交信息为空" }; } string tranType = "PUR_MRB"; List selBillList = await _selBillRepository.QuerySelBill(request.orgID, tranType); if (selBillList == null || selBillList.Count <= 0) { return new RetMessage { Status = 0, Message = "外购退料对应的出入库流程信息未找到" }; } request.TranType = tranType; return await (repository as ISTKInStockRepository).PURRetStockSubmit(request, selBillList); } } }