225 lines
8.0 KiB
C#
Executable File
225 lines
8.0 KiB
C#
Executable File
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Newtonsoft.Json.Linq;
|
|
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(IOutStockService), ServiceLifetime.Transient)]
|
|
public class OutStockService : ServiceBase<BaseEntity, IOutStockRepository>, IOutStockService
|
|
{
|
|
private readonly ISelBillRepository _selBillRepository;
|
|
public OutStockService(IOutStockRepository repository, ISelBillRepository selBillRepository) : base(repository)
|
|
{
|
|
Init(repository);
|
|
Init(selBillRepository);
|
|
_selBillRepository = selBillRepository;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 销售出库信息
|
|
/// </summary>
|
|
/// <param name="data"></param>
|
|
/// <returns></returns>
|
|
public async Task<RetMessage> SaleOutStockSubmit(InputBarCode<BD_BARCODERS2> request)
|
|
{
|
|
if (request.barcodeList == null || request.barcodeList.Count <= 0)
|
|
{
|
|
return new RetMessage
|
|
{
|
|
Status = 0,
|
|
Message = "提交信息为空"
|
|
};
|
|
}
|
|
string tranType = "SAL_OUTSTOCK";
|
|
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 IOutStockRepository).SaleOutStockSubmit(request, selBillList);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 销售退货信息
|
|
/// </summary>
|
|
/// <param name="data"></param>
|
|
/// <returns></returns>
|
|
public async Task<RetMessage> SaleInStockSubmit(InputBarCode<BD_BARCODERS2> request)
|
|
{
|
|
if (request.barcodeList == null || request.barcodeList.Count <= 0)
|
|
{
|
|
return new RetMessage
|
|
{
|
|
Status = 0,
|
|
Message = "提交信息为空"
|
|
};
|
|
}
|
|
string tranType = "SAL_RETURNSTOCK";
|
|
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 IOutStockRepository).SaleInStockSubmit(request,selBillList);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 销售出库(套件)信息
|
|
/// </summary>
|
|
/// <param name="data"></param>
|
|
/// <returns></returns>
|
|
public async Task<RetMessage> SaleOutStockSuitSubmit(InputBarCode<BD_BARCODERS2> request)
|
|
{
|
|
if (request.barcodeList == null || request.barcodeList.Count <= 0)
|
|
{
|
|
return new RetMessage
|
|
{
|
|
Status = 0,
|
|
Message = "提交信息为空"
|
|
};
|
|
}
|
|
string tranType = "SAL_OUTSTOCK_SUIT";
|
|
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 IOutStockRepository).SaleOutStockSuitSubmit(request,selBillList);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 销售退库(套件)信息
|
|
/// </summary>
|
|
/// <param name="data"></param>
|
|
/// <returns></returns>
|
|
public async Task<RetMessage> SaleInStockSuitSubmit(InputBarCode<BD_BARCODERS2> request)
|
|
{
|
|
if (request.barcodeList == null || request.barcodeList.Count <= 0)
|
|
{
|
|
return new RetMessage
|
|
{
|
|
Status = 0,
|
|
Message = "提交信息为空"
|
|
};
|
|
}
|
|
string tranType = "SAL_RETURNSTOCK_SUIT";
|
|
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 IOutStockRepository).SaleInStockSuitSubmit(request,selBillList);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 销售复核(扫源单)
|
|
/// </summary>
|
|
/// <param name="data"></param>
|
|
/// <returns></returns>
|
|
public async Task<RetMessage> SaleCheckScanSourceBill(JObject request)
|
|
{
|
|
if (request == null)
|
|
{
|
|
return new RetMessage
|
|
{
|
|
Status = 0,
|
|
Message = "提交信息为空"
|
|
};
|
|
}
|
|
|
|
return await (repository as IOutStockRepository).SaleCheckScanSourceBill(request);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 销售复核(扫源单)
|
|
/// </summary>
|
|
/// <param name="data"></param>
|
|
/// <returns></returns>
|
|
public async Task<RetMessage> SaleCheckScanCode(JObject request)
|
|
{
|
|
if (request == null)
|
|
{
|
|
return new RetMessage
|
|
{
|
|
Status = 0,
|
|
Message = "提交信息为空"
|
|
};
|
|
}
|
|
|
|
return await (repository as IOutStockRepository).SaleCheckScanCode(request);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 销售复核(暂存)
|
|
/// </summary>
|
|
/// <param name="data"></param>
|
|
/// <returns></returns>
|
|
public async Task<RetMessage> SaleCheckTemporaryStorage(string FBILLNO, string orgID, List<BarCodeMsg<BD_BARCODERS2>> barcodeList)
|
|
{
|
|
if (barcodeList == null)
|
|
{
|
|
return new RetMessage
|
|
{
|
|
Status = 0,
|
|
Message = "提交信息为空"
|
|
};
|
|
}
|
|
|
|
return await (repository as IOutStockRepository).SaleCheckTemporaryStorage(FBILLNO, orgID,barcodeList);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 销售复核(提交)
|
|
/// </summary>
|
|
/// <param name="data"></param>
|
|
/// <returns></returns>
|
|
public async Task<RetMessage> SaleCheckSubmit(string FBILLNO, string orgID, List<BarCodeMsg<BD_BARCODERS2>> barcodeList)
|
|
{
|
|
if (barcodeList == null)
|
|
{
|
|
return new RetMessage
|
|
{
|
|
Status = 0,
|
|
Message = "提交信息为空"
|
|
};
|
|
}
|
|
|
|
return await (repository as IOutStockRepository).SaleCheckSubmit(FBILLNO, orgID, barcodeList);
|
|
}
|
|
|
|
|
|
}
|
|
}
|