using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; 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; namespace Opsoft.NetCore.O3App.Services.WMS { /// /// 委外领料/委外退料 /// [MapTo(typeof(ISUBPICKMTRLService), ServiceLifetime.Transient)] public class SUBPICKMTRLService : ServiceBase, ISUBPICKMTRLService { private readonly ISelBillRepository _selBillRepository; public SUBPICKMTRLService(ISUBPICKMTRLRepository repository, ISelBillRepository selBillRepository) : base(repository) { Init(repository); Init(selBillRepository); _selBillRepository = selBillRepository; } /// /// 委外领料 /// /// /// public async Task SUBPICKMTRL(InputBarCode request) { if (request.barcodeList == null || request.barcodeList.Count <= 0) { return new RetMessage { Status = 0, Message = "提交信息为空" }; } string tranType = "SUB_PICKMTRL"; 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 ISUBPICKMTRLRepository).SUBPICKMTRL(request, selBillList); } /// /// 委外退料 /// /// /// public async Task SUBRETURNMTRL(InputBarCode request) { if (request.barcodeList == null || request.barcodeList.Count <= 0) { return new RetMessage { Status = 0, Message = "提交信息为空" }; } string tranType = "SUB_RETURNMTRL"; 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 ISUBPICKMTRLRepository).SUBRETURNMTRL(request, selBillList); } } }