Browse Source

修改 发料 和 盘点

集成Redis
郑勃旭 2 years ago
parent
commit
a2639d7d94
  1. 18
      be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs
  2. 9
      be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceValidateExtension.cs
  3. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/BackFlusNotes/IBackFlushNoteAppService.cs
  4. 8
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/BackFlushNotes/BackFlushNoteAppService.cs
  5. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CountNotes/CountNoteAppService.cs
  6. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/CountAdjustRequestEventHandler.cs

18
be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs

@ -451,14 +451,14 @@ public class BalanceManager : DomainService, IBalanceManager
{
expression = expression.And(p => p.ExpireDate > DateTime.Now);
}
//筛选有效库区
if (validLocationAreas.Any() )
{
if (!string.IsNullOrEmpty(validLocationAreas[0]))
{
expression = expression.And(p => validLocationAreas.Contains(p.LocationArea));
}
}
//筛选有效库区 2023-6-29 李智慧 王旭 袁静雯 确认不需要做区域校验
//if (validLocationAreas.Any())
//{
// if (!string.IsNullOrEmpty(validLocationAreas[0]))
// {
// expression = expression.And(p => validLocationAreas.Contains(p.LocationArea));
// }
//}
var allBalances = await
(await _balanceRepository.GetDbSetAsync().ConfigureAwait(false))
.Where(expression)
@ -606,7 +606,7 @@ public class BalanceManager : DomainService, IBalanceManager
Logger.LogDebug($"{traceId}:RequestQty:{requestQty},RemainQty:{remainingQty},AvailableQty:{balanceQty},RecommendQty:{recommendQty}");
return recommendQty;
}
/// <summary>
/// 计算推荐库位
/// </summary>

9
be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceValidateExtension.cs

@ -108,13 +108,12 @@ public static class BalanceValidateExtension
/// <returns></returns>
public static List<Balance> SortByFifo(this List<Balance> balances)
{
return balances
.OrderBy(p => p.Lot)
.ThenBy(p => p.ArriveDate)
.ThenByDescending(p => p.Qty)
.ThenBy(p => p.LocationCode)
.ThenBy(p => p.PackingCode)
//.ThenBy(p => p.ArriveDate)
//.ThenByDescending(p => p.Qty)
//.ThenBy(p => p.LocationCode)
//.ThenBy(p => p.PackingCode)
.ToList();
}

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/BackFlusNotes/IBackFlushNoteAppService.cs

@ -9,5 +9,5 @@ ISfsStoreMasterReadOnlyAppServiceBase<BackFlushNoteDTO, SfsStoreRequestInputBase
{
Task<List<BackFlushNoteDTO>> CreateManyAsync(List<BackFlushNoteEditInput> inputs);
Task<List<BackFlushNoteDTO>> GetListByProductRecycleNumber(string number);
Task<List<BackFlushNoteDTO>> GetListByProductRecycleNumberAsync(string number);
}

8
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/BackFlushNotes/BackFlushNoteAppService.cs

@ -32,7 +32,7 @@ public class BackFlushNoteAppService :
{
var entities = ObjectMapper.Map<List<BackFlushNoteEditInput>, List<BackFlushNote>>(inputs);
entities = await ProcessingBackFlushNoteData(entities).ConfigureAwait(false);
entities = await ProcessingBackFlushNoteDataAsync(entities).ConfigureAwait(false);
entities = await _backFlushNoteManager.CreateManyAsync(entities).ConfigureAwait(false);
@ -42,7 +42,7 @@ public class BackFlushNoteAppService :
}
[HttpGet("by-product-recyle-number")]
public async Task<List<BackFlushNoteDTO>> GetListByProductRecycleNumber(string number)
public async Task<List<BackFlushNoteDTO>> GetListByProductRecycleNumberAsync(string number)
{
var entities = await _repository.GetListAsync(t => t.ProductRecycleNumber == number, true)
.ConfigureAwait(false);
@ -54,12 +54,12 @@ public class BackFlushNoteAppService :
/// 处理数据
/// </summary>
/// <returns></returns>
private async Task<List<BackFlushNote>> ProcessingBackFlushNoteData(List<BackFlushNote> backFlushNotes)
private async Task<List<BackFlushNote>> ProcessingBackFlushNoteDataAsync(List<BackFlushNote> backFlushNotes)
{
if (backFlushNotes != null && backFlushNotes.Count > 0)
{
var itemCodes = backFlushNotes.Select(t => t.ItemCode);
List<ItemBasicDTO> itemBasicDtos = await _itemBasicAppService.GetByCodesAsync(itemCodes).ConfigureAwait(false);
var itemBasicDtos = await _itemBasicAppService.GetByCodesAsync(itemCodes).ConfigureAwait(false);
backFlushNotes.ForEach(t =>
{

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CountNotes/CountNoteAppService.cs

@ -95,6 +95,8 @@ public class CountNoteAppService :
detail.LocationGroup = locationDto.LocationGroupCode;
detail.LocationErpCode = locationDto.ErpLocationCode;
detail.WarehouseCode = locationDto.WarehouseCode;
detail.PackingCode=detail.PackingCode ?? "";
detail.Lot = detail.Lot ?? "";
detail.ItemCode = itemcBasicDto.Code;
detail.ItemDesc1 = itemcBasicDto.Desc1;

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/CountAdjustRequestEventHandler.cs

@ -50,6 +50,12 @@ public class CountAdjustRequestEventHandler
{
if (entity.DirectCreateNote)
{
entity.Details.ForEach(p =>
{
p.PackingCode = p.PackingCode ?? "";
p.Lot = p.Lot ?? "";
p.ContainerCode = p.ContainerCode ?? "";
});
await ThawBalancesAsync(entity).ConfigureAwait(false);
var note = await BuildCountAdjustNoteCreateInputAsync(entity).ConfigureAwait(false);

Loading…
Cancel
Save