88 lines
3.3 KiB
C#
Executable File
88 lines
3.3 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.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
|
|
{
|
|
/// <summary>
|
|
/// 委外入库/委外退货
|
|
/// </summary>
|
|
[MapTo(typeof(ISUBInStkPickmtlService), ServiceLifetime.Transient)]
|
|
public class SUBInStkPickmtlService : ServiceBase<BaseEntity, ISUBInStkPickmtlRepository>, ISUBInStkPickmtlService
|
|
{
|
|
private readonly ISelBillRepository _selBillRepository;
|
|
public SUBInStkPickmtlService(ISUBInStkPickmtlRepository repository, ISelBillRepository selBillRepository) : base(repository)
|
|
{
|
|
Init(repository);
|
|
Init(selBillRepository);
|
|
_selBillRepository = selBillRepository;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 委外入库
|
|
/// </summary>
|
|
/// <param name="data"></param>
|
|
/// <returns></returns>
|
|
public async Task<RetMessage> SUBInStkPickmtl(InputBarCode<BD_BARCODERS2> request)
|
|
{
|
|
if (request.barcodeList == null || request.barcodeList.Count <= 0)
|
|
{
|
|
return new RetMessage
|
|
{
|
|
Status = 0,
|
|
Message = "提交信息为空"
|
|
};
|
|
}
|
|
string tranType = "SUB_INSTKPICKMTL";
|
|
List<BOS_SELBILL> 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 ISUBInStkPickmtlRepository).SUBInStkPickmtl(request, selBillList);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 委外退货
|
|
/// </summary>
|
|
/// <param name="data"></param>
|
|
/// <returns></returns>
|
|
public async Task<RetMessage> SUBOutStkPickmtl(InputBarCode<BD_BARCODERS2> request)
|
|
{
|
|
if (request.barcodeList == null || request.barcodeList.Count <= 0)
|
|
{
|
|
return new RetMessage
|
|
{
|
|
Status = 0,
|
|
Message = "提交信息为空"
|
|
};
|
|
}
|
|
string tranType = "SUB_OUTSTKPICKMTL";
|
|
List<BOS_SELBILL> 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 ISUBInStkPickmtlRepository).SUBOutStkPickmtl(request, selBillList);
|
|
}
|
|
}
|
|
}
|