Browse Source

修改创建库移

dev_DY_CC
郑勃旭 12 months ago
parent
commit
ee73cde048
  1. 55
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/AssembleIssueJobEventHandler.cs
  2. 55
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/CoatingIssueJobEventHandler.cs
  3. 20
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/InjectionIssueJobEventHandler.cs
  4. 20
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/KittingIssueJobEventHandler.cs

55
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/AssembleIssueJobEventHandler.cs → be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/AssembleIssueJobEventHandler.cs

@ -2,6 +2,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Castle.Components.DictionaryAdapter;
using Volo.Abp;
using Volo.Abp.EventBus;
using Volo.Abp.Uow;
using Win_in.Sfs.Basedata.Application.Contracts;
@ -19,16 +20,14 @@ public class AssembleIssueJobEventHandler :
, ILocalEventHandler<SfsCreatedEntityEventData<AssembleIssueJob>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<AssembleIssueJob>>>
{
private readonly IAssembleIssueNoteAppService _assembleIssueNoteAppService;
private readonly IExpectOutAppService _expectOutAppService;
private readonly ILocationAppService _locationAppService;
private readonly ITransferLibRequestAppService _transferLibRequestAppService;
public AssembleIssueJobEventHandler(IAssembleIssueNoteAppService assembleIssueNoteAppService,
public AssembleIssueJobEventHandler(
IExpectOutAppService expectOutAppService,
ILocationAppService locationAppService, ITransferLibRequestAppService transferLibRequestAppService)
{
_assembleIssueNoteAppService = assembleIssueNoteAppService;
_expectOutAppService = expectOutAppService;
_locationAppService = locationAppService;
_transferLibRequestAppService = transferLibRequestAppService;
@ -128,6 +127,25 @@ public class AssembleIssueJobEventHandler :
{
var locationDto = await _locationAppService.GetByCodeAsync(detail.RecommendFromLocationCode)
.ConfigureAwait(false);
var locationList = await _locationAppService.GetListByGroupsAsync(
new List<string> { detail.RecommendFromLocationGroup }).ConfigureAwait(false);
var locationListSort = locationList.OrderBy(p => p.RowCode);
var locationDtoRowOne = new LocationDTO();
if (locationListSort.Any())
{
locationDtoRowOne = locationListSort.FirstOrDefault();
}
else
{
locationDtoRowOne = await _locationAppService.GetFirstRowOneAsync().ConfigureAwait(false);
if (locationDtoRowOne == null)
{
throw new UserFriendlyException("没有找到1层的库位");
}
}
if (locationDto.Type == EnumLocationType.RAW)
{
if (!await IsMinRowAsync(assembleIssueJob).ConfigureAwait(false))
@ -154,7 +172,7 @@ public class AssembleIssueJobEventHandler :
detailInput.RecommendFromQty = detail.RecommendFromQty;
detailInput.RecommendFromLot = detail.RecommendFromLot;
detailInput.RecommendFromPackingCode = detailInput.RecommendFromPackingCode;
detailInput.RecommendFromPackingCode = detail.RecommendFromPackingCode;
detailInput.RecommendToLot = detail.RecommendToLot;
detailInput.RecommendFromArriveDate = detail.RecommendFromArriveDate;
@ -170,7 +188,7 @@ public class AssembleIssueJobEventHandler :
detailInput.RecommendToQty = detail.RecommendToQty;
detailInput.RecommendToLot = detail.RecommendToLot;
detailInput.RecommendToPackingCode = detailInput.RecommendToPackingCode;
detailInput.RecommendToPackingCode = detail.RecommendToPackingCode;
detailInput.RecommendToLot = detail.RecommendToLot;
detailInput.RecommendToArriveDate = detail.RecommendToArriveDate;
@ -178,13 +196,13 @@ public class AssembleIssueJobEventHandler :
detailInput.RecommendToProduceDate = detail.RecommendToProduceDate;
detailInput.RecommendToSupplierBatch = detail.RecommendToSupplierBatch;
detailInput.RecommendToLocationCode = detail.RecommendToLocationCode;
detailInput.RecommendToLocationGroup = detail.RecommendToLocationGroup;
detailInput.RecommendToLocationArea = detail.RecommendToLocationArea;
detailInput.RecommendToLocationErpCode = detail.RecommendToLocationErpCode;
detailInput.RecommendToWarehouseCode = detail.RecommendToWarehouseCode;
detailInput.RecommendToLocationCode = locationDtoRowOne.Code;
detailInput.RecommendToLocationGroup = locationDtoRowOne.LocationGroupCode;
detailInput.RecommendToLocationArea = locationDtoRowOne.AreaCode;
detailInput.RecommendToLocationErpCode = locationDtoRowOne.ErpLocationCode;
detailInput.RecommendToWarehouseCode = locationDtoRowOne.WarehouseCode;
input.Details = new EditableList<TransferLibRequestDetailInput>() { detailInput };
input.Details = new EditableList<TransferLibRequestDetailInput> { detailInput };
await _transferLibRequestAppService.CreateAsync(input).ConfigureAwait(false);
}
@ -192,21 +210,6 @@ public class AssembleIssueJobEventHandler :
}
}
/// <summary>
/// 创建补料记录实体
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
private async Task<AssembleIssueNoteEditInput> BuildAssembleIssueNoteAsync(AssembleIssueJob entity)
{
var assembleIssueNoteCreateInput = ObjectMapper.Map<AssembleIssueJob, AssembleIssueNoteEditInput>(entity);
assembleIssueNoteCreateInput.JobNumber = entity.Number;
await Task.CompletedTask.ConfigureAwait(false);
return assembleIssueNoteCreateInput;
}
/// <summary>
/// 判断是不是在最底层 如果不是则把状态变更为等待
/// </summary>

55
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/CoatingIssueJobEventHandler.cs → be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/CoatingIssueJobEventHandler.cs

@ -2,6 +2,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Castle.Components.DictionaryAdapter;
using Volo.Abp;
using Volo.Abp.EventBus;
using Volo.Abp.Uow;
using Win_in.Sfs.Basedata.Application.Contracts;
@ -19,16 +20,14 @@ public class CoatingIssueJobEventHandler :
, ILocalEventHandler<SfsCreatedEntityEventData<CoatingIssueJob>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<CoatingIssueJob>>>
{
private readonly ICoatingIssueNoteAppService _coatingIssueNoteAppService;
private readonly IExpectOutAppService _expectOutAppService;
private readonly ILocationAppService _locationAppService;
private readonly ITransferLibRequestAppService _transferLibRequestAppService;
public CoatingIssueJobEventHandler(ICoatingIssueNoteAppService coatingIssueNoteAppService,
public CoatingIssueJobEventHandler(
IExpectOutAppService expectOutAppService,
ILocationAppService locationAppService, ITransferLibRequestAppService transferLibRequestAppService)
{
_coatingIssueNoteAppService = coatingIssueNoteAppService;
_expectOutAppService = expectOutAppService;
_locationAppService = locationAppService;
_transferLibRequestAppService = transferLibRequestAppService;
@ -128,6 +127,25 @@ public class CoatingIssueJobEventHandler :
{
var locationDto = await _locationAppService.GetByCodeAsync(detail.RecommendFromLocationCode)
.ConfigureAwait(false);
var locationList = await _locationAppService.GetListByGroupsAsync(
new List<string> { detail.RecommendFromLocationGroup }).ConfigureAwait(false);
var locationListSort = locationList.OrderBy(p => p.RowCode);
var locationDtoRowOne = new LocationDTO();
if (locationListSort.Any())
{
locationDtoRowOne = locationListSort.FirstOrDefault();
}
else
{
locationDtoRowOne = await _locationAppService.GetFirstRowOneAsync().ConfigureAwait(false);
if (locationDtoRowOne == null)
{
throw new UserFriendlyException("没有找到1层的库位");
}
}
if (locationDto.Type == EnumLocationType.RAW)
{
if (!await IsMinRowAsync(coatingIssueJob).ConfigureAwait(false))
@ -154,7 +172,7 @@ public class CoatingIssueJobEventHandler :
detailInput.RecommendFromQty = detail.RecommendFromQty;
detailInput.RecommendFromLot = detail.RecommendFromLot;
detailInput.RecommendFromPackingCode = detailInput.RecommendFromPackingCode;
detailInput.RecommendFromPackingCode = detail.RecommendFromPackingCode;
detailInput.RecommendToLot = detail.RecommendToLot;
detailInput.RecommendFromArriveDate = detail.RecommendFromArriveDate;
@ -170,7 +188,7 @@ public class CoatingIssueJobEventHandler :
detailInput.RecommendToQty = detail.RecommendToQty;
detailInput.RecommendToLot = detail.RecommendToLot;
detailInput.RecommendToPackingCode = detailInput.RecommendToPackingCode;
detailInput.RecommendToPackingCode = detail.RecommendToPackingCode;
detailInput.RecommendToLot = detail.RecommendToLot;
detailInput.RecommendToArriveDate = detail.RecommendToArriveDate;
@ -178,13 +196,13 @@ public class CoatingIssueJobEventHandler :
detailInput.RecommendToProduceDate = detail.RecommendToProduceDate;
detailInput.RecommendToSupplierBatch = detail.RecommendToSupplierBatch;
detailInput.RecommendToLocationCode = detail.RecommendToLocationCode;
detailInput.RecommendToLocationGroup = detail.RecommendToLocationGroup;
detailInput.RecommendToLocationArea = detail.RecommendToLocationArea;
detailInput.RecommendToLocationErpCode = detail.RecommendToLocationErpCode;
detailInput.RecommendToWarehouseCode = detail.RecommendToWarehouseCode;
detailInput.RecommendToLocationCode = locationDtoRowOne.Code;
detailInput.RecommendToLocationGroup = locationDtoRowOne.LocationGroupCode;
detailInput.RecommendToLocationArea = locationDtoRowOne.AreaCode;
detailInput.RecommendToLocationErpCode = locationDtoRowOne.ErpLocationCode;
detailInput.RecommendToWarehouseCode = locationDtoRowOne.WarehouseCode;
input.Details = new EditableList<TransferLibRequestDetailInput>() { detailInput };
input.Details = new EditableList<TransferLibRequestDetailInput> { detailInput };
await _transferLibRequestAppService.CreateAsync(input).ConfigureAwait(false);
}
@ -192,21 +210,6 @@ public class CoatingIssueJobEventHandler :
}
}
/// <summary>
/// 创建补料记录实体
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
private async Task<CoatingIssueNoteEditInput> BuildCoatingIssueNoteAsync(CoatingIssueJob entity)
{
var coatingIssueNoteCreateInput = ObjectMapper.Map<CoatingIssueJob, CoatingIssueNoteEditInput>(entity);
coatingIssueNoteCreateInput.JobNumber = entity.Number;
await Task.CompletedTask.ConfigureAwait(false);
return coatingIssueNoteCreateInput;
}
/// <summary>
/// 判断是不是在最底层 如果不是则把状态变更为等待
/// </summary>

20
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/InjectionIssueJobEventHandler.cs → be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/InjectionIssueJobEventHandler.cs

@ -20,16 +20,14 @@ public class InjectionIssueJobEventHandler :
, ILocalEventHandler<SfsCreatedEntityEventData<InjectionIssueJob>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<InjectionIssueJob>>>
{
private readonly IInjectionIssueNoteAppService _injectionIssueNoteAppService;
private readonly IExpectOutAppService _expectOutAppService;
private readonly ILocationAppService _locationAppService;
private readonly ITransferLibRequestAppService _transferLibRequestAppService;
public InjectionIssueJobEventHandler(IInjectionIssueNoteAppService injectionIssueNoteAppService,
public InjectionIssueJobEventHandler(
IExpectOutAppService expectOutAppService,
ILocationAppService locationAppService, ITransferLibRequestAppService transferLibRequestAppService)
{
_injectionIssueNoteAppService = injectionIssueNoteAppService;
_expectOutAppService = expectOutAppService;
_locationAppService = locationAppService;
_transferLibRequestAppService = transferLibRequestAppService;
@ -147,7 +145,6 @@ public class InjectionIssueJobEventHandler :
}
}
if (locationDto.Type == EnumLocationType.RAW)
{
if (!await IsMinRowAsync(injectionIssueJob).ConfigureAwait(false))
@ -212,21 +209,6 @@ public class InjectionIssueJobEventHandler :
}
}
/// <summary>
/// 创建补料记录实体
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
private async Task<InjectionIssueNoteEditInput> BuildInjectionIssueNoteAsync(InjectionIssueJob entity)
{
var injectionIssueNoteCreateInput = ObjectMapper.Map<InjectionIssueJob, InjectionIssueNoteEditInput>(entity);
injectionIssueNoteCreateInput.JobNumber = entity.Number;
await Task.CompletedTask.ConfigureAwait(false);
return injectionIssueNoteCreateInput;
}
/// <summary>
/// 判断是不是在最底层 如果不是则把状态变更为等待
/// </summary>

20
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/KittingIssueJobEventHandler.cs → be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/KittingIssueJobEventHandler.cs

@ -20,16 +20,13 @@ public class KittingIssueJobEventHandler :
, ILocalEventHandler<SfsCreatedEntityEventData<KittingIssueJob>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<KittingIssueJob>>>
{
private readonly IKittingIssueNoteAppService _kittingIssueNoteAppService;
private readonly IExpectOutAppService _expectOutAppService;
private readonly ILocationAppService _locationAppService;
private readonly ITransferLibRequestAppService _transferLibRequestAppService;
public KittingIssueJobEventHandler(IKittingIssueNoteAppService kittingIssueNoteAppService,
IExpectOutAppService expectOutAppService,
public KittingIssueJobEventHandler(IExpectOutAppService expectOutAppService,
ILocationAppService locationAppService, ITransferLibRequestAppService transferLibRequestAppService)
{
_kittingIssueNoteAppService = kittingIssueNoteAppService;
_expectOutAppService = expectOutAppService;
_locationAppService = locationAppService;
_transferLibRequestAppService = transferLibRequestAppService;
@ -212,21 +209,6 @@ public class KittingIssueJobEventHandler :
}
}
/// <summary>
/// 创建补料记录实体
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
private async Task<KittingIssueNoteEditInput> BuildKittingIssueNoteAsync(KittingIssueJob entity)
{
var kittingIssueNoteCreateInput = ObjectMapper.Map<KittingIssueJob, KittingIssueNoteEditInput>(entity);
kittingIssueNoteCreateInput.JobNumber = entity.Number;
await Task.CompletedTask.ConfigureAwait(false);
return kittingIssueNoteCreateInput;
}
/// <summary>
/// 判断是不是在最底层 如果不是则把状态变更为等待
/// </summary>
Loading…
Cancel
Save