Files
GX.O3.WMS/APP.O3/Services/WMS/STKStockSchemeService.cs
T

60 lines
2.2 KiB
C#
Executable File

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<BaseEntity, ISTKStockSchemeRepository>, ISTKStockSchemeService
{
public STKStockSchemeService(ISTKStockSchemeRepository repository, IBarcodeRepository barcodeRepository) : base(repository)
{
Init(repository);
(repository as STKStockSchemeRepository).Init(barcodeRepository);
}
/// <summary>
/// 查询盘点方案
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public async Task<QuerySourceInvPrgReturnDto> QuerySourceInvPrg(STKStockScheme SData)
{
if (SData.sourceBillNO == "")
{
throw new O3AppException("传参信息错误,盘点方案编码为空", 400);
}
return await (repository as ISTKStockSchemeRepository).QuerySourceInvPrg(SData);
}
/// <summary>
/// 盘点方案提交
/// </summary>
/// <param name="SData"></param>
/// <returns></returns>
public async Task<string> 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);
}
}
}