优化接口
This commit is contained in:
@@ -256,6 +256,13 @@ namespace WMS.Web.Domain.Services
|
||||
/// <returns></returns>
|
||||
private async Task<Result<InStock>> ShelfSave(PurchaseShelfRequest dto, InstockType type, LoginInDto loginInfo, bool isTransaction = true)
|
||||
{
|
||||
_logger.LogInformation($"采购上架-保存:{JsonConvert.SerializeObject(dto)} 操作人:{loginInfo.UserInfo.StaffId}");
|
||||
//入库的时候:不能扫同样的箱
|
||||
if (dto.Details != null && dto.Details.Count != 0)
|
||||
{
|
||||
if (dto.Details.Select(x => x.BoxId).Distinct().Count() != dto.Details.Select(x => x.BoxId).Count())
|
||||
return Result<InStock>.ReFailure(ResultCodes.BoxOutStockTaskBoxError);
|
||||
}
|
||||
|
||||
//1.获取来源单
|
||||
var taskIds = dto.Details.GroupBy(x => x.TaskId).Select(x => x.Key).ToList();
|
||||
@@ -379,6 +386,15 @@ namespace WMS.Web.Domain.Services
|
||||
/// <returns></returns>
|
||||
private async Task<Result> ShelfNoPurchaseSave(NoPurchaseShelfRequest dto, LoginInDto loginInfo, bool isTransaction = true)
|
||||
{
|
||||
_logger.LogInformation($"非采购上架-保存:{JsonConvert.SerializeObject(dto)} 操作人:{loginInfo.UserInfo.StaffId}");
|
||||
|
||||
//非采购入库的时候:不能扫同样的箱,按箱入库时候
|
||||
if (dto.Boxs != null && dto.Boxs.Count != 0 && dto.ShelfMethod==(int)ShelfMethod.Box)
|
||||
{
|
||||
if (dto.Boxs.Select(x => x.BoxId).Distinct().Count() != dto.Boxs.Select(x => x.BoxId).Count())
|
||||
return Result<InStock>.ReFailure(ResultCodes.BoxOutStockTaskBoxError);
|
||||
}
|
||||
|
||||
//1.1过滤的明细:0数量入库的明细要过滤掉
|
||||
dto.Boxs.ForEach(x =>
|
||||
{
|
||||
@@ -596,7 +612,13 @@ namespace WMS.Web.Domain.Services
|
||||
/// <returns></returns>
|
||||
public async Task<Result<InStockTask>> Receive(UpdateInStockTaskRequest dto, int staffId, bool isTransaction)
|
||||
{
|
||||
|
||||
_logger.LogInformation($"收货:{JsonConvert.SerializeObject(dto)} 操作人:{staffId}");
|
||||
//收货的时候:不能扫同样的箱
|
||||
if (dto.Boxs != null && dto.Boxs.Count != 0)
|
||||
{
|
||||
if (dto.Boxs.Select(x => x.BoxId).Distinct().Count() != dto.Boxs.Select(x => x.BoxId).Count())
|
||||
return Result<InStockTask>.ReFailure(ResultCodes.BoxOutStockTaskBoxError);
|
||||
}
|
||||
//1.修改任务单的数据
|
||||
var entity = await _inStockTaskRepositories.Get(dto.Id);
|
||||
if (entity == null)
|
||||
@@ -677,6 +699,7 @@ namespace WMS.Web.Domain.Services
|
||||
/// <returns></returns>
|
||||
public async Task<Result<ContrastMaterialsResponse>> Contrast(ContrastMaterialsRequest dto)
|
||||
{
|
||||
_logger.LogInformation($"采购订单明细和箱物料明细-对比:{JsonConvert.SerializeObject(dto)}");
|
||||
//1.找到任务单的明细信息
|
||||
var task = await _inStockTaskRepositories.Get(dto.TaskId);
|
||||
if (task == null)
|
||||
@@ -761,6 +784,7 @@ namespace WMS.Web.Domain.Services
|
||||
/// <returns></returns>
|
||||
private async Task<Result> PurchaseInStock(InStock entity, LoginInDto loginInfo)
|
||||
{
|
||||
_logger.LogInformation($"采购下推-同步:{JsonConvert.SerializeObject(entity)} 操作人:{loginInfo.UserInfo.StaffId}");
|
||||
var scope = _serviceScopeFactory.CreateScope();
|
||||
var sc_InStockRepositories = scope.ServiceProvider.GetRequiredService<IInStockRepositories>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user