Browse Source

Merge branch 'dev_DY_CC' of http://dev.ccwin-in.com:3000/BoXu.Zheng/WZC2 into dev_DY_CC

dev_DY_CC
周红军 1 year ago
parent
commit
98879ea5c8
  1. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/InjectionJobs/DTOs/InjectionJobDTO.cs
  2. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/InjectionJobs/Inputs/InjectionJobEditInput.cs
  3. 3
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductionReturnNotes/ProductionReturnNoteAppService.cs
  4. 94
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/CoatingIssueJobAutoMapperProfile.cs
  5. 23
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/CoatingIssueNoteAutoMapperProfile.cs
  6. 136
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/CoatingMaterialRequestAutoMapperProfile.cs
  7. 74
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ProductionReturnRequestAutoMapperProfile.cs
  8. 101
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ProductionReturnRequestEventHandler.cs
  9. 3
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/StoreEventAutoMapperProfile.cs

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/InjectionJobs/DTOs/InjectionJobDTO.cs

@ -33,9 +33,9 @@ public class InjectionJobDTO : SfsJobDTOBase<InjectionJobDetailDTO>
/// <summary> /// <summary>
/// 车间 /// 车间
/// </summary> /// </summary>
[Display(Name = "车间")] //[Display(Name = "车间")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] //[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string Workshop { get; set; } //public string Workshop { get; set; }
/// <summary> /// <summary>
/// 使用在途库 /// 使用在途库

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/InjectionJobs/Inputs/InjectionJobEditInput.cs

@ -62,9 +62,9 @@ public class InjectionJobEditInput : SfsJobCreateUpdateInputBase, ISfsJobCreateI
/// <summary> /// <summary>
/// 车间 /// 车间
/// </summary> /// </summary>
[Display(Name = "车间")] //[Display(Name = "车间")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] //[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string Workshop { get; set; } //public string Workshop { get; set; }
/// <summary> /// <summary>
/// 生产线 /// 生产线

3
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductionReturnNotes/ProductionReturnNoteAppService.cs

@ -43,4 +43,7 @@ public class ProductionReturnNoteAppService :
var dto = ObjectMapper.Map<ProductionReturnNote, ProductionReturnNoteDTO>(entity); var dto = ObjectMapper.Map<ProductionReturnNote, ProductionReturnNoteDTO>(entity);
return dto; return dto;
} }
} }

94
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/CoatingIssueJobAutoMapperProfile.cs

@ -0,0 +1,94 @@
using System;
using AutoMapper;
using Volo.Abp.AutoMapper;
using Win_in.Sfs.Shared.Application;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Jobs.IssueJobs;
using Win_in.Sfs.Wms.Store.Notes.IssueNotes;
namespace Win_in.Sfs.Wms.Store.Event;
public partial class StoreEventAutoMapperProfile : Profile
{
private void CoatingIssueJobAutoMapperProfile()
{
CreateMap<CoatingIssueJob, CoatingIssueNote>()
.ForMember(x => x.JobNumber, y => y.MapFrom(d => d.Number))
.ForMember(x => x.RequestNumber, y => y.MapFrom(d => d.MaterialRequestNumber))
.ForMember(x => x.ActiveDate, y => y.MapFrom(d => DateTime.Now))
.ForMember(x => x.Worker, y => y.MapFrom(d => d.CompleteUserName))
.Ignore(x => x.Confirmed)
.Ignore(x => x.Number)
.Ignore(x => x.ConfirmTime);
CreateMap<CoatingIssueJobDetail, CoatingIssueNoteDetail>()
.ForMember(x => x.FromPackingCode, y => y.MapFrom(d => d.HandledPackingCode))
.ForMember(x => x.ToPackingCode, y => y.MapFrom(d => d.HandledPackingCode))
.ForMember(x => x.SupplierBatch, y => y.MapFrom(d => d.HandledSupplierBatch))
.ForMember(x => x.ArriveDate, y => y.MapFrom(d => d.HandledArriveDate))
.ForMember(x => x.ProduceDate, y => y.MapFrom(d => d.HandledProduceDate))
.ForMember(x => x.ExpireDate, y => y.MapFrom(d => d.HandledExpireDate))
.ForMember(x => x.FromLot, y => y.MapFrom(d => d.HandledLot))
.ForMember(x => x.ToLot, y => y.MapFrom(d => d.HandledLot))
.ForMember(x => x.ToContainerCode, y => y.MapFrom(d => d.HandledContainerCode))
.ForMember(x => x.FromContainerCode, y => y.MapFrom(d => d.HandledContainerCode))
.ForMember(x => x.FromStatus, y => y.MapFrom(d => d.Status))
.ForMember(x => x.ToStatus, y => y.MapFrom(d => d.Status))
.ForMember(x => x.Qty, y => y.MapFrom(d => d.HandledQty))
.ForMember(x => x.IssueTime, y => y.MapFrom(d => DateTime.Now))
.ForMember(x => x.FromLocationCode, y => y.MapFrom(d => d.HandledFromLocationCode))
.ForMember(x => x.FromLocationArea, y => y.MapFrom(d => d.HandledFromLocationArea))
.ForMember(x => x.FromLocationGroup, y => y.MapFrom(d => d.HandledFromLocationGroup))
.ForMember(x => x.FromLocationErpCode, y => y.MapFrom(d => d.HandledFromLocationErpCode))
.ForMember(x => x.FromWarehouseCode, y => y.MapFrom(d => d.HandledFromWarehouseCode))
.ForMember(x => x.ToLocationCode, y => y.MapFrom(d => d.ToLocationCode))
.Ignore(x => x.ToLocationArea)
.Ignore(x => x.ToLocationGroup)
.Ignore(x => x.ToLocationErpCode)
;
CreateMap<CoatingIssueJobDetail, ExpectInEditInput>()
.MapExpectInOutFrom()
.Ignore(x => x.Worker)
.Ignore(x => x.SerialNumber)
.Ignore(x => x.ExtraProperties)
;
CreateMap<CoatingIssueJobDetail, ExpectOutEditInput>()
.MapExpectInOutFrom()
.Ignore(x => x.Worker)
.Ignore(x => x.SerialNumber)
.Ignore(x => x.ExtraProperties);
CreateMap<CoatingIssueJob, CoatingIssueNoteEditInput>()
.ForMember(x => x.RequestNumber, y => y.MapFrom(d => d.MaterialRequestNumber))
.Ignore(x => x.Confirmed)
.Ignore(x => x.JobNumber)
.Ignore(x => x.ActiveDate)
;
CreateMap<CoatingIssueJobDetail, CoatingIssueNoteDetailInput>()
.ForMember(x => x.Qty, y => y.MapFrom(d => d.HandledQty))
.ForMember(x => x.IssueTime, y => y.MapFrom(d => DateTime.Now))
.ForMember(x => x.FromPackingCode, y => y.MapFrom(d =>d.HandledPackingCode))
.ForMember(x => x.ToPackingCode, y => y.MapFrom(d => d.HandledPackingCode))
.ForMember(x => x.FromContainerCode, y => y.MapFrom(d => d.HandledContainerCode))
.ForMember(x => x.ToContainerCode, y => y.MapFrom(d => d.HandledContainerCode))
.ForMember(x => x.FromLot, y => y.MapFrom(d => d.HandledLot))
.ForMember(x => x.ToLot, y => y.MapFrom(d => d.HandledLot))
.ForMember(x => x.SupplierBatch, y => y.MapFrom(d => d.HandledSupplierBatch))
.ForMember(x => x.ArriveDate, y => y.MapFrom(d => d.HandledArriveDate))
.ForMember(x => x.ProduceDate, y => y.MapFrom(d => d.HandledProduceDate))
.ForMember(x => x.ExpireDate, y => y.MapFrom(d => d.ExpiredTime))
.ForMember(x => x.FromLocationCode, y => y.MapFrom(d => d.HandledFromLocationCode))
.ForMember(x => x.FromLocationArea, y => y.MapFrom(d => d.HandledFromLocationArea))
.ForMember(x => x.FromLocationGroup, y => y.MapFrom(d => d.HandledFromLocationGroup))
.ForMember(x => x.FromLocationErpCode, y => y.MapFrom(d => d.HandledFromLocationErpCode))
.ForMember(x => x.FromWarehouseCode, y => y.MapFrom(d => d.HandledFromWarehouseCode))
.ForMember(x => x.FromStatus, y => y.MapFrom(d => d.Status))
.ForMember(x => x.ToStatus, y => y.MapFrom(d => d.Status))
;
}
}

23
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/CoatingIssueNoteAutoMapperProfile.cs

@ -0,0 +1,23 @@
using AutoMapper;
using Volo.Abp.AutoMapper;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Notes.IssueNotes;
namespace Win_in.Sfs.Wms.Store.Event;
public partial class StoreEventAutoMapperProfile : Profile
{
private void CoatingIssueNoteAutoMapperProfile()
{
CreateMap<CoatingIssueNoteDetail, TransferLogEditInput>()
.Ignore(x => x.DocNumber)
.Ignore(x => x.JobNumber)
.Ignore(x => x.Worker)
.Ignore(x => x.TransType)
.Ignore(x => x.ExtraProperties)
.Ignore(x => x.TransSubType)
;
}
}

136
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/CoatingMaterialRequestAutoMapperProfile.cs

@ -0,0 +1,136 @@
using AutoMapper;
using Volo.Abp.AutoMapper;
using Win_in.Sfs.Shared.Application;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Jobs.IssueJobs;
using Win_in.Sfs.Wms.Store.Requests.MaterialRequests;
namespace Win_in.Sfs.Wms.Store.Event;
public partial class StoreEventAutoMapperProfile : Profile
{
private void CoatingMaterialRequestAutoMapperProfile()
{
CreateMap<CoatingMaterialRequest, CoatingIssueJobEditInput>()
.ForMember(x => x.MaterialRequestNumber, y => y.MapFrom(d => d.Number))
.ForMember(x => x.RequestType, y => y.MapFrom(d => d.Type))
.Ignore(x => x.WarehouseCode)
.Ignore(x => x.UpStreamJobNumber)
.Ignore(x => x.JobType)
.Ignore(x => x.IsAutoComplete)
.Ignore(x => x.ExpiredTime)
.Ignore(x => x.JobDescription)
.Ignore(x => x.JobStatus)
.Ignore(x => x.WorkGroupCode)
.Ignore(x => x.Priority)
.Ignore(x => x.PriorityIncrement)
.Ignore(x => x.AcceptUserId)
.Ignore(x => x.AcceptTime)
.Ignore(x => x.AcceptUserName)
.Ignore(x => x.CompleteUserId)
.Ignore(x => x.CompleteUserName)
.Ignore(x => x.CompleteTime)
.Ignore(x => x.Details)
;
CreateMap<CoatingMaterialRequestDetail, CoatingIssueJobDetailInput>()
.ForMember(x => x.RequestLocationCode, y => y.MapFrom(d => d.ToLocationCode))
.Ignore(x => x.RecommendFromLocationArea)
.Ignore(x => x.RecommendFromLocationGroup)
.Ignore(x => x.HandledFromLocationArea)
.Ignore(x => x.HandledFromLocationGroup)
.Ignore(x => x.RecommendFromWarehouseCode)
.Ignore(x => x.HandledFromWarehouseCode)
.Ignore(x => x.OnTheWayLocationCode)
.Ignore(x => x.DistributionType)
.Ignore(x => x.RoundedQty)
.Ignore(x => x.Operation)
.Ignore(x => x.ExpiredTime)
.Ignore(x => x.TruncType)
.Ignore(x => x.PlanBeginTime)
.Ignore(x => x.PlannedSplitRule)
.Ignore(x => x.DeliveryQty)
.Ignore(x => x.Status)
.Ignore(x => x.RecommendContainerCode)
.Ignore(x => x.StdPackQty)
.Ignore(x => x.RecommendPackingCode)
.Ignore(x => x.HandledContainerCode)
.Ignore(x => x.HandledPackingCode)
.Ignore(x => x.RecommendSupplierBatch)
.Ignore(x => x.RecommendProduceDate)
.Ignore(x => x.RecommendArriveDate)
.Ignore(x => x.RecommendExpireDate)
.Ignore(x => x.HandledFromLocationCode)
.Ignore(x => x.HandledFromLocationErpCode)
.Ignore(x => x.HandledUom)
.Ignore(x => x.RecommendFromLocationErpCode)
.Ignore(x => x.HandledExpireDate)
.Ignore(x => x.HandledLot)
.Ignore(x => x.HandledArriveDate)
.Ignore(x => x.HandledProduceDate)
.Ignore(x => x.HandledQty)
.Ignore(x => x.RecommendQty)
.Ignore(x => x.Uom)
.Ignore(x => x.HandledSupplierBatch)
.Ignore(x => x.RecommendFromLocationCode)
.Ignore(x => x.RecommendLot)
.IgnoreIHasRecommendAndHandledFrom();
CreateMap<BalanceDTO, CoatingIssueJobDetailInput>()
.ForMember(x => x.RecommendArriveDate, y => y.MapFrom(d => d.ArriveDate))
.ForMember(x => x.RecommendContainerCode, y => y.MapFrom(d => d.ContainerCode))
.ForMember(x => x.RecommendExpireDate, y => y.MapFrom(d => d.ExpireDate))
.ForMember(x => x.RecommendFromLocationCode, y => y.MapFrom(d => d.LocationCode))
.ForMember(x => x.RecommendFromLocationErpCode, y => y.MapFrom(d => d.LocationErpCode))
.ForMember(x => x.RecommendFromWarehouseCode, y => y.MapFrom(d => d.WarehouseCode))
.ForMember(x => x.RecommendFromLocationArea, y => y.MapFrom(d => d.LocationArea))
.ForMember(x => x.RecommendFromLocationGroup, y => y.MapFrom(d => d.LocationGroup))
.ForMember(x => x.RecommendLot, y => y.MapFrom(d => d.Lot))
.ForMember(x => x.RecommendPackingCode, y => y.MapFrom(d => d.PackingCode))
.ForMember(x => x.RecommendProduceDate, y => y.MapFrom(d => d.ProduceDate))
.ForMember(x => x.RecommendQty, y => y.MapFrom(d => d.Qty))
.ForMember(x => x.RecommendSupplierBatch, y => y.MapFrom(d => d.SupplierBatch))
.ForMember(x => x.Uom, y => y.MapFrom(d => d.Uom)).Ignore(x => x.HandledArriveDate)
.Ignore(x => x.HandledFromLocationArea)
.Ignore(x => x.HandledFromLocationGroup)
.Ignore(x => x.ToLocationErpCode)
.Ignore(x => x.ToWarehouseCode)
.Ignore(x => x.ToLocationArea)
.Ignore(x => x.ToLocationGroup)
.Ignore(x => x.HandledFromWarehouseCode)
.Ignore(x => x.RequestLocationCode)
.Ignore(x => x.ToLocationCode)
.Ignore(x => x.ProdLine)
.Ignore(x => x.WorkStation)
.Ignore(x => x.HandledContainerCode)
.Ignore(x => x.HandledExpireDate)
.Ignore(x => x.HandledFromLocationCode)
.Ignore(x => x.HandledFromLocationErpCode)
.Ignore(x => x.HandledLot)
.Ignore(x => x.HandledPackingCode)
.Ignore(x => x.HandledProduceDate)
.Ignore(x => x.HandledQty)
.Ignore(x => x.HandledSupplierBatch)
.Ignore(x => x.HandledUom)
.Ignore(x => x.Remark)
.Ignore(x => x.OnTheWayLocationCode)
.Ignore(x => x.DistributionType)
.Ignore(x => x.RoundedQty)
.Ignore(x => x.Operation)
.Ignore(x => x.ExpiredTime)
.Ignore(x => x.TruncType)
.Ignore(x => x.PlanBeginTime)
.Ignore(x => x.PlannedSplitRule)
.Ignore(x => x.DeliveryQty)
.Ignore(x => x.RequestLocationCode)
.Ignore(x => x.ToLocationCode)
.Ignore(x => x.ProdLine)
.Ignore(x => x.WorkStation)
.Ignore(x => x.PositionCode)
.Ignore(x => x.RecommendType)
.IgnoreIHasRecommendAndHandledFrom();
}
}

74
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ProductionReturnRequestAutoMapperProfile.cs

@ -5,12 +5,85 @@ using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Event; namespace Win_in.Sfs.Wms.Store.Event;
using System;
using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
public partial class StoreEventAutoMapperProfile : Profile public partial class StoreEventAutoMapperProfile : Profile
{ {
private void ProductionReturnRequestAutoMapperProfile() private void ProductionReturnRequestAutoMapperProfile()
{ {
//CreateMap<ProductionReturnRequest, ProductionReturnNoteEditInput>()
// .ForMember(x => x.JobNumber, y => y.MapFrom(d => d.Number))
// .ForMember(x => x.ReturnTime, y => y.MapFrom(d => d.CreationTime))
// .ForMember(x => x.Worker, y => y.MapFrom(d => d.Worker))
// .ForMember(x => x.ActiveDate, y => y.MapFrom(d => DateTime.Now))
// .Ignore(x => x.Number);
//CreateMap<ProductionReturnRequestDetail, ProductionReturnNoteDetailInput>()
// .ForMember(x => x.FromPackingCode, y => y.MapFrom(d => d.FromPackingCode))
// .ForMember(x => x.ToPackingCode, y => y.MapFrom(d => d.ToPackingCode))
// .ForMember(x => x.SupplierBatch, y => y.MapFrom(d => d.SupplierBatch))
// .ForMember(x => x.ArriveDate, y => y.MapFrom(d => d.ArriveDate))
// .ForMember(x => x.ProduceDate, y => y.MapFrom(d => d.ProduceDate))
// .ForMember(x => x.ExpireDate, y => y.MapFrom(d => d.ExpireDate))
// .ForMember(x => x.FromLot, y => y.MapFrom(d => string.Empty))
// .ForMember(x => x.ToLot, y => y.MapFrom(d => d.ToLot))
// .ForMember(x => x.ToContainerCode, y => y.MapFrom(d => d.ToContainerCode))
// .ForMember(x => x.FromContainerCode, y => y.MapFrom(d => d.FromContainerCode))
// .ForMember(x => x.FromStatus, y => y.MapFrom(d => d.FromStatus))
// .ForMember(x => x.ToStatus, y => y.MapFrom(d => d.ToStatus))
// .ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty))
// .ForMember(x => x.FromLocationCode, y => y.MapFrom(d => d.FromLocationCode))
// .ForMember(x => x.FromLocationArea, y => y.MapFrom(d => d.ToLocationArea))
// .ForMember(x => x.FromLocationGroup, y => y.MapFrom(d => d.ToLocationGroup))
// .ForMember(x => x.FromLocationErpCode, y => y.MapFrom(d => d.ToLocationErpCode))
// .ForMember(x => x.FromWarehouseCode, y => y.MapFrom(d => d.ToWarehouseCode))
// .ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty))
// .Ignore(x => x.ArriveDate)
// .Ignore(x => x.ToLocationCode)
// .Ignore(x => x.ToLocationArea)
// .Ignore(x => x.ToLocationGroup)
// .Ignore(x => x.ToLocationErpCode)
// .Ignore(x => x.ToWarehouseCode)
// .Ignore(x => x.HandledContainerCode)
// .Ignore(x => x.HandledPackingCode)
// .Ignore(x => x.HandledToLocationCode)
// .Ignore(x => x.HandledToLocationArea)
// .Ignore(x => x.HandledToLocationGroup)
// .Ignore(x => x.HandledToLocationErpCode)
// .Ignore(x => x.HandledToWarehouseCode)
// .Ignore(x => x.HandledExpireDate)
// .Ignore(x => x.HandledLot)
// .Ignore(x => x.HandledArriveDate)
// .Ignore(x => x.HandledProduceDate)
// .Ignore(x => x.HandledQty)
// .Ignore(x => x.HandledSupplierBatch);
//CreateMap<ProductionReturnRequestDetail, ExpectOutEditInput>()
// .MapExpectInOutTo()
// .Ignore(x => x.SerialNumber)
// .Ignore(x => x.Worker)
// .Ignore(x => x.ExtraProperties)
// ;
//CreateMap<ProductionReturnNoteDetail, ExpectInEditInput>()
// .MapExpectInOutTo()
// .ForMember(x => x.LocationCode, y => y.MapFrom(d => d.FromLocationCode))
// .ForMember(x => x.LocationArea, y => y.MapFrom(d => d.FromLocationArea))
// .ForMember(x => x.LocationGroup, y => y.MapFrom(d => d.FromLocationGroup))
// .ForMember(x => x.LocationErpCode, y => y.MapFrom(d => d.FromLocationErpCode))
// .ForMember(x => x.WarehouseCode, y => y.MapFrom(d => d.FromWarehouseCode))
// .Ignore(x => x.SerialNumber)
// .Ignore(x => x.Worker)
// .Ignore(x => x.ExtraProperties);
CreateMap<ProductionReturnRequest, ProductionReturnJobEditInput>() CreateMap<ProductionReturnRequest, ProductionReturnJobEditInput>()
.ForMember(x => x.ProductionReturnRequestNumber, y => y.MapFrom(t => t.Number)) .ForMember(x => x.ProductionReturnRequestNumber, y => y.MapFrom(t => t.Number))
.ForMember(x => x.IsAutoComplete, y => y.MapFrom(t => t.AutoCompleteJob)) .ForMember(x => x.IsAutoComplete, y => y.MapFrom(t => t.AutoCompleteJob))
@ -53,7 +126,6 @@ public partial class StoreEventAutoMapperProfile : Profile
.Ignore(x => x.HandledProduceDate) .Ignore(x => x.HandledProduceDate)
.Ignore(x => x.HandledQty) .Ignore(x => x.HandledQty)
.Ignore(x => x.HandledSupplierBatch) .Ignore(x => x.HandledSupplierBatch)
; ;
} }
} }

101
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ProductionReturnRequestEventHandler.cs

@ -1,5 +1,9 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Components.Forms;
using Omu.ValueInjecter;
using Volo.Abp.EventBus; using Volo.Abp.EventBus;
using Win_in.Sfs.Shared.Event; using Win_in.Sfs.Shared.Event;
using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts;
@ -14,19 +18,83 @@ public class ProductionReturnRequestEventHandler
{ {
private readonly IProductionReturnJobAppService _productionReturnJobApp; private readonly IProductionReturnJobAppService _productionReturnJobApp;
private readonly IProductionReturnNoteAppService _productionReturnNoteApp;
public ProductionReturnRequestEventHandler( public ProductionReturnRequestEventHandler(
IProductionReturnJobAppService productionReturnJobApp IProductionReturnJobAppService productionReturnJobApp,
IProductionReturnNoteAppService productionReturnNoteApp
) )
{ {
_productionReturnNoteApp= productionReturnNoteApp;
_productionReturnJobApp = productionReturnJobApp; _productionReturnJobApp = productionReturnJobApp;
} }
public virtual async Task HandleEventAsync(SfsHandledEntityEventData<ProductionReturnRequest> eventData) public virtual async Task HandleEventAsync(SfsHandledEntityEventData<ProductionReturnRequest> eventData)
{ {
var entity = eventData.Entity; var entity = eventData.Entity;
var job = await BuildProductionReturnJobCreateInputAsync(entity).ConfigureAwait(false);
await _productionReturnJobApp.CreateAsync(job).ConfigureAwait(false); //CreateMap<ProductionReturnRequest, ProductionReturnNoteEditInput>()
// .ForMember(x => x.JobNumber, y => y.MapFrom(d => d.Number))
// .ForMember(x => x.ReturnTime, y => y.MapFrom(d => d.CreationTime))
// .ForMember(x => x.Worker, y => y.MapFrom(d => d.Worker))
// .ForMember(x => x.ActiveDate, y => y.MapFrom(d => DateTime.Now))
// .Ignore(x => x.Number);
//CreateMap<ProductionReturnRequestDetail, ProductionReturnNoteDetailInput>()
// .ForMember(x => x.FromPackingCode, y => y.MapFrom(d => d.FromPackingCode))
// .ForMember(x => x.ToPackingCode, y => y.MapFrom(d => d.ToPackingCode))
// .ForMember(x => x.SupplierBatch, y => y.MapFrom(d => d.SupplierBatch))
// .ForMember(x => x.ArriveDate, y => y.MapFrom(d => d.ArriveDate))
// .ForMember(x => x.ProduceDate, y => y.MapFrom(d => d.ProduceDate))
// .ForMember(x => x.ExpireDate, y => y.MapFrom(d => d.ExpireDate))
// .ForMember(x => x.FromLot, y => y.MapFrom(d => string.Empty))
// .ForMember(x => x.ToLot, y => y.MapFrom(d => d.ToLot))
// .ForMember(x => x.ToContainerCode, y => y.MapFrom(d => d.ToContainerCode))
// .ForMember(x => x.FromContainerCode, y => y.MapFrom(d => d.FromContainerCode))
// .ForMember(x => x.FromStatus, y => y.MapFrom(d => d.FromStatus))
// .ForMember(x => x.ToStatus, y => y.MapFrom(d => d.ToStatus))
// .ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty))
// .ForMember(x => x.FromLocationCode, y => y.MapFrom(d => d.FromLocationCode))
// .ForMember(x => x.FromLocationArea, y => y.MapFrom(d => d.ToLocationArea))
// .ForMember(x => x.FromLocationGroup, y => y.MapFrom(d => d.ToLocationGroup))
// .ForMember(x => x.FromLocationErpCode, y => y.MapFrom(d => d.ToLocationErpCode))
// .ForMember(x => x.FromWarehouseCode, y => y.MapFrom(d => d.ToWarehouseCode))
// .ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty))
// .Ignore(x => x.ArriveDate)
// .Ignore(x => x.ToLocationCode)
// .Ignore(x => x.ToLocationArea)
// .Ignore(x => x.ToLocationGroup)
// .Ignore(x => x.ToLocationErpCode)
// .Ignore(x => x.ToWarehouseCode)
// .Ignore(x => x.HandledContainerCode)
// .Ignore(x => x.HandledPackingCode)
// .Ignore(x => x.HandledToLocationCode)
// .Ignore(x => x.HandledToLocationArea)
// .Ignore(x => x.HandledToLocationGroup)
// .Ignore(x => x.HandledToLocationErpCode)
// .Ignore(x => x.HandledToWarehouseCode)
// .Ignore(x => x.HandledExpireDate)
// .Ignore(x => x.HandledLot)
// .Ignore(x => x.HandledArriveDate)
// .Ignore(x => x.HandledProduceDate)
// .Ignore(x => x.HandledQty)
// .Ignore(x => x.HandledSupplierBatch);
ProductionReturnNoteEditInput input = new ProductionReturnNoteEditInput();
input.InjectFrom(entity);
input.ReturnTime = DateTime.Now;
input.ActiveDate=DateTime.Now;
input.JobNumber = input.Number;
List<ProductionReturnNoteDetailInput> inputdetail = new List<ProductionReturnNoteDetailInput>();
foreach (var itm in entity.Details)
{
ProductionReturnNoteDetailInput detail=new ProductionReturnNoteDetailInput();
detail.InjectFrom(itm);
inputdetail.Add(detail);
}
input.Details = inputdetail.ToList();
await _productionReturnNoteApp.CreateAsync(input).ConfigureAwait(false);
} }
public virtual async Task HandleEventAsync(SfsAbortedEntityEventData<ProductionReturnRequest> eventData) public virtual async Task HandleEventAsync(SfsAbortedEntityEventData<ProductionReturnRequest> eventData)
@ -36,26 +104,13 @@ public class ProductionReturnRequestEventHandler
await _productionReturnJobApp.CancelByProductionReturnRequestNumberAsync(entity.Number).ConfigureAwait(false); await _productionReturnJobApp.CancelByProductionReturnRequestNumberAsync(entity.Number).ConfigureAwait(false);
} }
private async Task<ProductionReturnJobEditInput> BuildProductionReturnJobCreateInputAsync(ProductionReturnRequest request) //private PurchaseReturnNoteEditInput BuildProductionReturn(PurchaseReturnJob entity)
{ //{
var job = ObjectMapper.Map<ProductionReturnRequest, ProductionReturnJobEditInput>(request); // var input = ObjectMapper.Map<PurchaseReturnJob, PurchaseReturnNoteEditInput>(entity);
job.Details = new List<ProductionReturnJobDetailInput>();
foreach (var detail in request.Details) // input.Details.RemoveAll(p => p.Qty == 0);
{
var inputDetail =
ObjectMapper.Map<ProductionReturnRequestDetail, ProductionReturnJobDetailInput>(detail);
// return input;
var location = await LocationAclService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false); //}
job.WorkGroupCode = location.WorkGroupCode;
job.Details.Add(inputDetail);
}
return job;
}
} }

3
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/StoreEventAutoMapperProfile.cs

@ -103,6 +103,9 @@ public partial class StoreEventAutoMapperProfile : Profile
InventoryInitialNoteAutoMapperProfile(); InventoryInitialNoteAutoMapperProfile();
TransferLibNoteAutoMapperProfile(); TransferLibNoteAutoMapperProfile();
CoatingIssueJobAutoMapperProfile();
CoatingIssueNoteAutoMapperProfile();
CoatingMaterialRequestAutoMapperProfile();
} }
} }

Loading…
Cancel
Save