diff --git a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Win_in.Sfs.Wms.Store.HttpApi.Host.csproj b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Win_in.Sfs.Wms.Store.HttpApi.Host.csproj index 922ab1a43..b9b8b2ea8 100644 --- a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Win_in.Sfs.Wms.Store.HttpApi.Host.csproj +++ b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Win_in.Sfs.Wms.Store.HttpApi.Host.csproj @@ -33,18 +33,22 @@ + + + + diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/CountJobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/CountJobController.cs index fc116e2aa..7ed1b4d54 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/CountJobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/CountJobController.cs @@ -75,7 +75,7 @@ public class CountJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; + List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase @@ -133,7 +133,7 @@ public class CountJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonWlgCodes = JsonSerializer.Serialize(wlgCodes); - var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; + var status = new List() {EnumJobStatus.Open.ToString(),EnumJobStatus.Doing.ToString() }; var jsonStatus = JsonSerializer.Serialize(status); var requestInput = new SfsJobRequestInputBase @@ -165,7 +165,7 @@ public class CountJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; + List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/DeliverJobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/DeliverJobController.cs index a25d23869..0b93cc8db 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/DeliverJobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/DeliverJobController.cs @@ -75,7 +75,7 @@ public class DeliverJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); _ = JsonSerializer.Serialize(wlgCodes); - List status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; + List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase @@ -132,7 +132,7 @@ public class DeliverJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; + List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/InspectJobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/InspectJobController.cs index 205fd3dd8..aabb49b1c 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/InspectJobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/InspectJobController.cs @@ -64,7 +64,7 @@ public class InspectJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; + List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase @@ -108,7 +108,7 @@ public class InspectJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; + List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobController.cs index d998499a7..c6763da04 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobController.cs @@ -65,7 +65,7 @@ public class IssueJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonWlgCodes = JsonSerializer.Serialize(wlgCodes); - var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; + var status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase @@ -143,7 +143,7 @@ public class IssueJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonWlgCodes = JsonSerializer.Serialize(wlgCodes); - var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; + var status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var jsonStatus = JsonSerializer.Serialize(status); var requestInput = new SfsJobRequestInputBase @@ -175,7 +175,7 @@ public class IssueJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; + List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JisDeliverJobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JisDeliverJobController.cs index 2901b2130..420840bed 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JisDeliverJobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JisDeliverJobController.cs @@ -74,7 +74,7 @@ public class JisDeliverJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; + List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase @@ -106,7 +106,7 @@ public class JisDeliverJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; + List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JobController.cs index aee711c16..4c88f25d3 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JobController.cs @@ -76,7 +76,7 @@ public class JobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; + List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var jsonStatus = JsonSerializer.Serialize(status); var list = new List(); diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ProductReceiveJobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ProductReceiveJobController.cs index e075dac29..cbbab2341 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ProductReceiveJobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ProductReceiveJobController.cs @@ -62,7 +62,7 @@ public class ProductReceiveJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; + List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase @@ -106,7 +106,7 @@ public class ProductReceiveJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; + List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ProductionReturnJobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ProductionReturnJobController.cs index 3bf10c4c1..ca0f1946e 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ProductionReturnJobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ProductionReturnJobController.cs @@ -69,7 +69,7 @@ public class ProductionReturnJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; + List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase @@ -113,7 +113,7 @@ public class ProductionReturnJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; + List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReturnJobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReturnJobController.cs index e3f7a8fc3..c6a071cce 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReturnJobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReturnJobController.cs @@ -63,7 +63,7 @@ public class PurchaseReturnJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; + List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase @@ -132,7 +132,7 @@ public class PurchaseReturnJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; + List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PutawayJobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PutawayJobController.cs index adc29f621..88cb5d770 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PutawayJobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PutawayJobController.cs @@ -62,7 +62,7 @@ public class PutawayJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; + List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase @@ -106,7 +106,7 @@ public class PutawayJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; + List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/TransferRequestController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/TransferRequestController.cs index c8bdffb8f..e1b686f6f 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/TransferRequestController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/TransferRequestController.cs @@ -74,7 +74,7 @@ public class TransferRequestController : AbpController Filters = new List { new(nameof(TransferRequestDTO.Type),EnumTransSubType.Transfer_Area.ToString(),"=="), - new(nameof(TransferRequestDTO.RequestStatus),((int)EnumRequestStatus.New).ToString(),"==") + new(nameof(TransferRequestDTO.RequestStatus),EnumRequestStatus.New.ToString(),"==") } } }; @@ -98,7 +98,7 @@ public class TransferRequestController : AbpController Filters = new List { new(nameof(TransferRequestDTO.Type),EnumTransSubType.Transfer_Area.ToString(),"=="), - new(nameof(TransferRequestDTO.RequestStatus),((int)EnumRequestStatus.New).ToString(),"==") + new(nameof(TransferRequestDTO.RequestStatus),EnumRequestStatus.New.ToString(),"==") } } }; diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemPacks/ItemPackAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemPacks/ItemPackAutoMapperProfile.cs index 76a8f48e9..3b5b405af 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemPacks/ItemPackAutoMapperProfile.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemPacks/ItemPackAutoMapperProfile.cs @@ -19,5 +19,12 @@ public partial class BasedataApplicationAutoMapperProfile : Profile .Ignore(x => x.ConcurrencyStamp) ; + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.TenantId) + .Ignore(x => x.ExtraProperties) + .Ignore(x => x.ConcurrencyStamp) + ; + } } diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/ExpectIns/ExpectInAutoMapperProfile.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/ExpectIns/ExpectInAutoMapperProfile.cs index 28508901f..0fd6ac6d7 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/ExpectIns/ExpectInAutoMapperProfile.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/ExpectIns/ExpectInAutoMapperProfile.cs @@ -1,4 +1,5 @@ using AutoMapper; +using Volo.Abp.AutoMapper; using Win_in.Sfs.Wms.Inventory.Application.Contracts; using Win_in.Sfs.Wms.Inventory.Domain; @@ -10,5 +11,13 @@ public partial class InventoryApplicationAutoMapperProfile : Profile { CreateMap() .ReverseMap(); + + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.ConcurrencyStamp) + .Ignore(x => x.Id) + .Ignore(x => x.Remark) + .Ignore(x => x.ExtraProperties) + ; } } diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/ExpectOuts/ExpectOutAppService.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/ExpectOuts/ExpectOutAppService.cs index 340b1860f..fddb1bbff 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/ExpectOuts/ExpectOutAppService.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/ExpectOuts/ExpectOutAppService.cs @@ -66,6 +66,7 @@ public class ExpectOutAppService LocationArea = first.LocationArea, LocationGroup = first.LocationGroup, LocationCode = s.Key.LocationCode, + LocationErpCode = first.LocationErpCode, Lot = s.Key.Lot, ContainerCode = s.Key.ContainerCode, ItemCode = s.Key.ItemCode, diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/ExpectOuts/ExpectOutAutoMapperProfile.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/ExpectOuts/ExpectOutAutoMapperProfile.cs index b78019d93..d83dcbff0 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/ExpectOuts/ExpectOutAutoMapperProfile.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/ExpectOuts/ExpectOutAutoMapperProfile.cs @@ -19,5 +19,14 @@ public partial class InventoryApplicationAutoMapperProfile : Profile .Ignore(x => x.JobNumber) .Ignore(x => x.ConcurrencyStamp) .Ignore(x => x.Remark); + + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.ConcurrencyStamp) + .Ignore(x => x.Id) + .Ignore(x => x.Remark) + .Ignore(x => x.ExtraProperties) + ; +; } } diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/Balance.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/Balance.cs index d3502cf10..f8d05b5f5 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/Balance.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/Balance.cs @@ -298,8 +298,6 @@ public class Balance : SfsInventoryAggregateRootBase LastCountPlanNumber = other.LastCountPlanNumber; LastCountTime = other.LastCountTime; LastModificationTime = other.LastModificationTime; - LocationCode = other.LocationCode; - LocationErpCode = other.LocationErpCode; Lot = other.Lot; Uom = other.Uom; Qty = other.Qty; @@ -317,9 +315,17 @@ public class Balance : SfsInventoryAggregateRootBase ArriveDate = other.ArriveDate; ProduceDate = other.ProduceDate; ExpireDate = other.ExpireDate; + + ItemCode = other.ItemCode; ItemName = other.ItemName; ItemDesc1 = other.ItemDesc1; ItemDesc2 = other.ItemDesc2; + + LocationArea= other.LocationArea; + LocationGroup= other.LocationGroup; + LocationCode = other.LocationCode; + LocationErpCode = other.LocationErpCode; + } public override string ToString() diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs index 448fdb114..e7643873e 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs @@ -582,6 +582,10 @@ public abstract class SfsCrudWithDetailsAppServiceBase [Display(Name = "目标库位")] [Required] - [Key] public string ToLocationCode { get; set; } /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs index d2cc0d803..73face06e 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs @@ -21,9 +21,10 @@ namespace Win_in.Sfs.Wms.Store.Application; [Authorize] [Route($"{StoreConsts.RootPath}material-request")] - -public class MaterialRequestAppService : SfsStoreRequestAppServiceBase, - IMaterialRequestAppService +public class MaterialRequestAppService : SfsStoreRequestAppServiceBase, + IMaterialRequestAppService { private readonly IMaterialRequestManager _materialRequestManager; @@ -33,20 +34,65 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase + /// 用来重写 导入数据时可以加工数据 + /// + /// + /// + protected override async Task> ImportProcessingEntityAsync( + Dictionary dictionary) + { + var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key); + + foreach (var materialRequest in addList) + { + materialRequest.Worker = CurrentUser.GetUserName(); + materialRequest.CreatorId = CurrentUser.Id; + foreach (var detail in materialRequest.Details) + { + var locationDto= await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false); + var itemBasicDto=await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); + + detail.ToLocationArea = locationDto.AreaCode; + detail.ToLocationErpCode = locationDto.ErpLocationCode; + detail.ToLocationGroup = locationDto.LocationGroupCode; + detail.ToWarehouseCode = locationDto.WarehouseCode; + detail.ItemDesc1 = itemBasicDto.Desc1; + detail.ItemDesc2= itemBasicDto.Desc2; + detail.ItemName= itemBasicDto.Name; + detail.Uom = itemBasicDto.BasicUom; + } + } + + return await base.ImportProcessingEntityAsync(dictionary).ConfigureAwait(false); } + #endregion + [HttpPost("")] //[Authorize(MaterialRequestPermissions.Create)] public override async Task CreateAsync(MaterialRequestEditInput input) @@ -85,7 +131,7 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase - /// 创建并且执行叫料请求 + /// 创建并且执行叫料请求 /// /// /// @@ -134,7 +180,7 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase - /// 根据备料计划生成 叫料请求 + /// 根据备料计划生成 叫料请求 /// /// [HttpPost("create-and-handle-by-preparation-plan/{number}")] @@ -142,10 +188,7 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase - /// 检验备料计划是否存在要料请求 + /// 检验备料计划是否存在要料请求 /// /// /// private async Task> CheckExistByPreparationPlanAsync(string preparationPlanNumber) { - var entities = await _repository.GetListAsync(c => c.PreparationPlanNumber == preparationPlanNumber).ConfigureAwait(false); + var entities = await _repository.GetListAsync(c => c.PreparationPlanNumber == preparationPlanNumber) + .ConfigureAwait(false); return entities; } /// - /// 根据类型获取叫料请求 + /// 根据类型获取叫料请求 /// /// /// @@ -199,7 +243,6 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase> expression = p => p.Type == type; if (requestInput.Condition.Filters?.Count > 0) { @@ -210,8 +253,7 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase validationRresult) + /// + /// 导入验证 + /// + /// + /// + /// + protected override async Task ValidateImportModelAsync(MaterialRequestImportInput model, + List validationRresult) { _ = new Dictionary(); _ = await CheckItemBasicAsync(model, validationRresult).ConfigureAwait(false); @@ -236,11 +285,14 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase ValidateImportEntities(Dictionary dict) { foreach (var entity in dict.Keys) { - var tranType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Issue, EnumTransSubType.None).ConfigureAwait(false); + var tranType = await TransactionTypeAclService + .GetByTransTypeAsync(EnumTransType.Issue, EnumTransSubType.None).ConfigureAwait(false); Check.NotNull(tranType, "事务类型", "事务类型不存在"); @@ -250,84 +302,71 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase CheckItemBasicAsync(MaterialRequestImportInput importInput, List validationRresult) + protected async Task CheckItemBasicAsync(MaterialRequestImportInput importInput, + List validationRresult) { var item = await ItemBasicAclService.GetByCodeAsync(importInput.ItemCode).ConfigureAwait(false); if (item == null) { - validationRresult.Add(new ValidationResult($"物品代码{importInput.ItemCode}不存在", new string[] { "物品代码" })); + validationRresult.Add(new ValidationResult($"物品代码{importInput.ItemCode}不存在", new[] { "物品代码" })); } else if (item.StdPackQty == 0) { - validationRresult.Add(new ValidationResult($"物品代码{importInput.ItemCode}的标准包装不存在", new string[] { "标准包装" })); + validationRresult.Add( + new ValidationResult($"物品代码{importInput.ItemCode}的物品信息中标准包装等于0或不存在", new[] { "标准包装" })); } + return item; } - protected async Task CheckLocationAsync(MaterialRequestImportInput importInput, List validationRresult) + protected async Task CheckLocationAsync(MaterialRequestImportInput importInput, + List validationRresult) { - var location = await LocationAclService.GetByCodeAsync(importInput.ToLocationCode).ConfigureAwait(false); + var location = await _locationAppService.GetByCodeAsync(importInput.ToLocationCode).ConfigureAwait(false); if (location == null) { - validationRresult.Add(new ValidationResult($"目标库位{importInput.ToLocationCode}不存在", new string[] { "目标库位" })); + validationRresult.Add(new ValidationResult($"目标库位{importInput.ToLocationCode}不存在", new[] { "目标库位" })); } + return location; } - protected async Task CheckAreaAsync(MaterialRequestImportInput importInput, List validationRresult) + protected async Task CheckAreaAsync(MaterialRequestImportInput importInput, + List validationRresult) { var area = await _areaApp.GetByCodeAsync(importInput.FromLocationArea).ConfigureAwait(false); if (area == null) { - validationRresult.Add(new ValidationResult($"调出库区{importInput.FromLocationArea}不存在", new string[] { "调出库区" })); + validationRresult.Add(new ValidationResult($"调出库区{importInput.FromLocationArea}不存在", new[] { "调出库区" })); } } - protected async Task CheckStoreRelationAsync(MaterialRequestImportInput importInput, List validationRresult) + protected async Task CheckStoreRelationAsync(MaterialRequestImportInput importInput, + List validationRresult) { - var itemStoreRelation = await _itemStoreRelationApp.GetFirstAsync(importInput.ItemCode, importInput.ToLocationCode).ConfigureAwait(false); + var itemStoreRelation = await _itemStoreRelationApp + .GetFirstAsync(importInput.ItemCode, importInput.ToLocationCode).ConfigureAwait(false); if (itemStoreRelation == null) { - validationRresult.Add(new ValidationResult($"物品代码{importInput.ItemCode}与目标库位{importInput.ToLocationCode}不存在对应关", new string[] { "物品库位对应关系" })); + validationRresult.Add(new ValidationResult( + $"物品代码{importInput.ItemCode}与目标库位{importInput.ToLocationCode}不存在对应关", new[] { "物品库位对应关系" })); } } - protected override async Task SaveImportAsync(Dictionary dict) - { - var entityList = dict.Keys.ToList(); - foreach (var entity in entityList) - { - foreach (var detail in entity.Details) - { - var item = await ItemBasicAclService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); - - if (item != null) - { - detail.ItemName = item.Name; - detail.ItemDesc1 = item.Desc1; - detail.ItemDesc2 = item.Desc2; - detail.StdPackQty = item.StdPackQty; - } - - var location = await LocationAclService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false); - - if (location != null) - { - detail.ToLocationErpCode = location.ErpLocationCode; - detail.ToWarehouseCode = location.WarehouseCode; - } - } - } - await base.SaveImportAsync(dict).ConfigureAwait(false); - } + #endregion #endregion + /// + /// 根据类型 获取叫料申请 + /// + /// + /// [HttpGet("list/by-type/{type}")] - public virtual async Task> GetListByTypeAsync(string type) { var entities = await _repository.GetListAsync(c => c.Type == type).ConfigureAwait(false); @@ -335,6 +374,5 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase, List>(entities); return dtos; - } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/IssueJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/IssueJobAutoMapperProfile.cs index 9bc2cfa77..22713c44a 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/IssueJobAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/IssueJobAutoMapperProfile.cs @@ -43,15 +43,14 @@ public partial class StoreEventAutoMapperProfile : Profile .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.ToWarehouseCode) + .Ignore(x => x.ToLocationArea) + .Ignore(x => x.ToLocationGroup) .Ignore(x => x.ToLocationErpCode) ; - CreateMap() + CreateMap< + IssueJobDetail, ExpectInEditInput>() .MapExpectInOutFrom() - .Ignore(x => x.LocationArea) - .Ignore(x => x.LocationGroup) - .Ignore(x => x.WarehouseCode) .Ignore(x => x.Worker) .Ignore(x => x.SerialNumber) .Ignore(x => x.ExtraProperties) @@ -59,9 +58,6 @@ public partial class StoreEventAutoMapperProfile : Profile CreateMap() .MapExpectInOutFrom() - .Ignore(x => x.LocationArea) - .Ignore(x => x.LocationGroup) - .Ignore(x => x.WarehouseCode) .Ignore(x => x.Worker) .Ignore(x => x.SerialNumber) .Ignore(x => x.ExtraProperties); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/ExpectInOuts/IssueJobEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/ExpectInOuts/IssueJobEventHandler.cs index 61b396cdb..70d496dfa 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/ExpectInOuts/IssueJobEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/ExpectInOuts/IssueJobEventHandler.cs @@ -54,7 +54,11 @@ public class IssueJobEventHandler : var expectOuts = new List(); foreach (var entity in entities) { - var entityExpectOuts = BuildExpectOutInventoryAsync(entity); + var entityExpectOuts = BuildExpectOutInventoryAsync(entity.Details, entity.Number); + entityExpectOuts.ForEach(p => + { + p.JobNumber = entity.Number; + }); expectOuts.AddRange(entityExpectOuts); } await ExpectOutAppService.AddManyAsync(expectOuts).ConfigureAwait(false); @@ -65,33 +69,25 @@ public class IssueJobEventHandler : var expectIns = new List(); foreach (var entity in entities) { - var entityExpectIns = BuildExpectInInventoryAsync(entity); + var entityExpectIns = BuildExpectInInventoryAsync(entity.Details, entity.Number); + entityExpectIns.ForEach(p => + { + p.JobNumber = entity.Number; + }); expectIns.AddRange(entityExpectIns); } await ExpectInAppService.AddManyAsync(expectIns).ConfigureAwait(false); } - private List BuildExpectInInventoryAsync(IssueJob issueJob) + private List BuildExpectInInventoryAsync(List balanceDto, string jobNumber) { - var inputs = ObjectMapper.Map, List>(issueJob.Details); - foreach (var input in inputs) - { - input.WarehouseCode = issueJob.WarehouseCode; - input.Worker = issueJob.Worker; - input.JobNumber = issueJob.Number; - } + var inputs = ObjectMapper.Map, List>(balanceDto); return inputs; } - private List BuildExpectOutInventoryAsync(IssueJob issueJob) + private List BuildExpectOutInventoryAsync(List balanceDto, string jobNumber) { - var inputs = ObjectMapper.Map, List>(issueJob.Details); - foreach (var input in inputs) - { - input.WarehouseCode = issueJob.WarehouseCode; - input.Worker = issueJob.Worker; - input.JobNumber = issueJob.Number; - } + var inputs = ObjectMapper.Map, List>(balanceDto); return inputs; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/IssueJobEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/IssueJobEventHandler.cs index 152c231a4..d2b597995 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/IssueJobEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/IssueJobEventHandler.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using Microsoft.Extensions.Configuration; -using StackExchange.Redis; using Volo.Abp.EventBus; using Volo.Abp.Uow; +using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Event; using Win_in.Sfs.Wms.Store.Application.Contracts; @@ -15,147 +15,116 @@ namespace Win_in.Sfs.Wms.Store.Event.BusinessJob; public class IssueJobEventHandler : StoreEventHandlerBase - , ILocalEventHandler> - , ILocalEventHandler>> , ILocalEventHandler> { - private const string MaterialRequestPrefix = "MaterialRequest"; + private const EnumTransType TransType = EnumTransType.Issue; - private readonly IMaterialRequestManager _materialRequestManager; - private readonly IIssueNoteManager _issueNoteManager; - - public IssueJobEventHandler( - IIssueNoteManager issueNoteManager - , IMaterialRequestManager materialRequestManager - , IConfiguration configuration) + private readonly IIssueNoteAppService _issueNoteAppService; + private readonly ILocationAppService _locationAppService; + public IssueJobEventHandler(IIssueNoteAppService issueNoteAppService, ILocationAppService locationAppService) { - _issueNoteManager = issueNoteManager; - _materialRequestManager = materialRequestManager; - var redisConnectionString = configuration["Redis:Configuration"]; - var redisConnection = ConnectionMultiplexer.Connect(redisConnectionString); - RedisDB = redisConnection.GetDatabase(); - + _issueNoteAppService = issueNoteAppService; + _locationAppService = locationAppService; } - - public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) - { - var entity = eventData.Entity; - var cacheKey = GetCacheKey(entity.MaterialRequestNumber); - var jobNumber = entity.Number; - await RedisDB.HashSetAsync(cacheKey, jobNumber, true).ConfigureAwait(false); - } - - public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) - { - var entities = eventData.Entity; - foreach (var entity in entities) - { - var cacheKey = GetCacheKey(entity.MaterialRequestNumber); - var jobNumber = entity.Number; - await RedisDB.HashSetAsync(cacheKey, jobNumber, true).ConfigureAwait(false); - } - } - - + /// + /// 执行后 + /// + /// + /// [UnitOfWork] public virtual async Task HandleEventAsync(SfsCompletedEntityEventData eventData) { var entity = eventData.Entity; - - #region 更新叫料请求状态 - - var cacheKey = GetCacheKey(entity.MaterialRequestNumber); - var jobNumber = entity.Number; - await RedisDB.HashDeleteAsync(cacheKey, jobNumber).ConfigureAwait(false); - var count = await RedisDB.HashLengthAsync(cacheKey).ConfigureAwait(false); - if (count == 0) - { - await _materialRequestManager.CompleteAsync(entity.MaterialRequestNumber).ConfigureAwait(false); - } - #endregion - var issueNote = await BuildIssueNoteAsync(entity).ConfigureAwait(false); - await _issueNoteManager.CreateAsync(issueNote).ConfigureAwait(false); - + await _issueNoteAppService.CreateAsync(issueNote).ConfigureAwait(false); } + #region 私有 + /// - /// 创建补料记录实体 + /// 创建补料记录实体 /// /// /// - private async Task BuildIssueNoteAsync(IssueJob entity) + private async Task BuildIssueNoteAsync(IssueJob entity) { - var issueNote = ObjectMapper.Map(entity); - var locationCodes = issueNote.Details.Select(p => p.ToLocationCode).Distinct().ToList(); - var locations = await LocationAclService.GetByCodesAsync(locationCodes).ConfigureAwait(false); + var issueNoteCreateInput = ObjectMapper.Map(entity); + var locationCodes = issueNoteCreateInput.Details.Select(p => p.ToLocationCode).Distinct().ToList(); + var locations = await _locationAppService.GetByCodesAsync(locationCodes).ConfigureAwait(false); - issueNote.Details.RemoveAll(p => p.Qty == 0); + issueNoteCreateInput.Details.RemoveAll(p => p.Qty == 0); - foreach (var detail in issueNote.Details) + foreach (var detail in issueNoteCreateInput.Details) { var location = locations.First(p => p.Code == detail.ToLocationCode); - await RemovePackingCodeAndContainerCodeAndLot(detail, location.Type).ConfigureAwait(false);//去箱 去托 去批 + await RemovePackingCodeAndContainerCodeAndLotAsync(detail, location.Type); //去箱 去托 去批 + + detail.ToLocationArea = location.AreaCode; + detail.ToLocationGroup = location.LocationGroupCode; detail.ToLocationErpCode = location.ErpLocationCode; detail.ToWarehouseCode = location.WarehouseCode; - detail.FromWarehouseCode = location.WarehouseCode; } - return issueNote; + return issueNoteCreateInput; } /// - /// 去除箱码 托码 批次 + /// 去除箱码 托码 批次 /// - private async Task RemovePackingCodeAndContainerCodeAndLot(IssueNoteDetail issueNoteDetail, EnumLocationType locationType) + private async Task RemovePackingCodeAndContainerCodeAndLotAsync(IssueNoteDetailInput issueNoteDetail, + EnumLocationType locationType) { switch (locationType) { case EnumLocationType.WIP: + { + //用开关控制 发料到线边后去除箱码和托码 ??? + if (await SettingManager.IsTrueAsync(StoreSettings.Issue.ToWip.IsRemovePackingCode) + .ConfigureAwait(false)) + { + issueNoteDetail.ToPackingCode = ""; + } + + if (await SettingManager.IsTrueAsync(StoreSettings.Issue.ToWip.IsRemoveContainerCode) + .ConfigureAwait(false)) { - //用开关控制 发料到线边后去除箱码和托码 ??? - if (await SettingManager.IsTrueAsync(StoreSettings.Issue.ToWip.IsRemovePackingCode).ConfigureAwait(false)) - { - issueNoteDetail.ToPackingCode = ""; - } - if (await SettingManager.IsTrueAsync(StoreSettings.Issue.ToWip.IsRemoveContainerCode).ConfigureAwait(false)) - { - issueNoteDetail.ToContainerCode = ""; - } - if (await SettingManager.IsTrueAsync(StoreSettings.Issue.ToWip.IsRemoveLot).ConfigureAwait(false)) - { - issueNoteDetail.ToLot = ""; - } - - break; + issueNoteDetail.ToContainerCode = ""; } + + if (await SettingManager.IsTrueAsync(StoreSettings.Issue.ToWip.IsRemoveLot).ConfigureAwait(false)) + { + issueNoteDetail.ToLot = ""; + } + + break; + } case EnumLocationType.SEMI: + { + //用开关控制 发料到后去除箱码和托码 ??? + if (await SettingManager.IsTrueAsync(StoreSettings.Issue.ToSemi.IsRemovePackingCode) + .ConfigureAwait(false)) { - //用开关控制 发料到后去除箱码和托码 ??? - if (await SettingManager.IsTrueAsync(StoreSettings.Issue.ToSemi.IsRemovePackingCode).ConfigureAwait(false)) - { - issueNoteDetail.ToPackingCode = ""; - } - if (await SettingManager.IsTrueAsync(StoreSettings.Issue.ToSemi.IsRemoveContainerCode).ConfigureAwait(false)) - { - issueNoteDetail.ToContainerCode = ""; - } - if (await SettingManager.IsTrueAsync(StoreSettings.Issue.ToSemi.IsRemoveLot).ConfigureAwait(false)) - { - issueNoteDetail.ToLot = ""; - } - - break; + issueNoteDetail.ToPackingCode = ""; } - } - } + if (await SettingManager.IsTrueAsync(StoreSettings.Issue.ToSemi.IsRemoveContainerCode) + .ConfigureAwait(false)) + { + issueNoteDetail.ToContainerCode = ""; + } - private static string GetCacheKey(string requestNumber) - { - return $"{StoreConsts.CachePrefix}:{MaterialRequestPrefix}:{requestNumber}"; + if (await SettingManager.IsTrueAsync(StoreSettings.Issue.ToSemi.IsRemoveLot).ConfigureAwait(false)) + { + issueNoteDetail.ToLot = ""; + } + + break; + } + } } + + #endregion } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/MaterialRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/MaterialRequestEventHandler.cs index 2c42c9098..830bba2b0 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/MaterialRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/MaterialRequestEventHandler.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using FluentValidation.Validators; using Volo.Abp; using Volo.Abp.EventBus; using Volo.Abp.SettingManagement; @@ -20,19 +21,61 @@ public class MaterialRequestEventHandler , ILocalEventHandler> , ILocalEventHandler> , ILocalEventHandler> + , ILocalEventHandler> + , ILocalEventHandler>> { private readonly IIssueJobAppService _issueJobAppService; private readonly IProductionLineAppService _productionLineAppService; + private readonly IMaterialRequestManager _materialRequestManager; + private readonly ILocationAppService _locationAppService; public MaterialRequestEventHandler( IIssueJobAppService issueJobAppService , IProductionLineAppService productionLineAppService - ) + , IMaterialRequestManager materialRequestManager + , ILocationAppService locationAppService) { _issueJobAppService = issueJobAppService; _productionLineAppService = productionLineAppService; + _materialRequestManager = materialRequestManager; + _locationAppService = locationAppService; } + /// + /// 创建后 + /// + /// Event data + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) + { + var entity = eventData.Entity; + + if (entity.AutoSubmit) + { + await _materialRequestManager.SubmitAsync(entity).ConfigureAwait(false); + } + } + + /// + /// 批量创建后 + /// + /// Event data + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) + { + var entitys = eventData.Entity; + foreach (var entity in entitys) + { + if (entity.AutoSubmit) + { + await _materialRequestManager.SubmitAsync(entity).ConfigureAwait(false); + } + } + } + + /// + /// 执行后 + /// + /// + /// public virtual async Task HandleEventAsync(SfsHandledEntityEventData eventData) { var entity = eventData.Entity; @@ -43,12 +86,22 @@ public class MaterialRequestEventHandler } } + /// + /// 驳回后 + /// + /// + /// public virtual async Task HandleEventAsync(SfsAbortedEntityEventData eventData) { var entity = eventData.Entity; await _issueJobAppService.CancelByMaterialRequestAsync(entity.Number).ConfigureAwait(false); } + /// + /// 完成后 + /// + /// + /// public virtual async Task HandleEventAsync(SfsCompletedEntityEventData eventData) { _ = eventData.Entity; @@ -63,7 +116,7 @@ public class MaterialRequestEventHandler var transactionType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Issue, EnumTransSubType.None).ConfigureAwait(false); var toLocationCodes = materialRequest.Details.Select(p => p.ToLocationCode).Distinct().ToList(); - var toLocations = await LocationAclService.GetByCodesAsync(toLocationCodes).ConfigureAwait(false); + var toLocations = await _locationAppService.GetByCodesAsync(toLocationCodes).ConfigureAwait(false); foreach (var materialRequestDetail in materialRequest.Details.Where(p => p.ToBeIssuedQty > 0)) { @@ -76,7 +129,7 @@ public class MaterialRequestEventHandler } var fromLocationCode = jobDetails[0].RecommendFromLocationCode; - var fromLocation = await LocationAclService.GetByCodeAsync(fromLocationCode).ConfigureAwait(false); + var fromLocation = await _locationAppService.GetByCodeAsync(fromLocationCode).ConfigureAwait(false); var job = jobs.FirstOrDefault(p => p.WorkGroupCode == fromLocation?.WorkGroupCode); if (job == null || job.Details.Any(p => p.ToLocationCode != materialRequestDetail.ToLocationCode)) { @@ -170,10 +223,27 @@ public class MaterialRequestEventHandler var detail = ObjectMapper.Map(balance); detail.RequestLocationCode = materialRequestDetail.ToLocationCode; - detail.ToLocationCode = materialRequestDetail.ToLocationCode; - detail.ToLocationErpCode = materialRequestDetail.ToLocationErpCode; detail.WorkStation = materialRequestDetail.WorkStation; detail.ExpiredTime = materialRequestDetail.ExpiredTime; + + detail.RecommendPackingCode = balance.PackingCode; + detail.RecommendContainerCode = balance.ContainerCode; + detail.RecommendSupplierBatch = balance.SupplierBatch; + detail.RecommendProduceDate= balance.ProduceDate; + detail.RecommendExpireDate= balance.ExpireDate; + detail.RecommendLot= balance.Lot; + detail.RecommendProduceDate=balance.ProduceDate; + detail.RecommendArriveDate= balance.ArriveDate; + detail.RecommendFromLocationArea = balance.LocationArea; + detail.RecommendFromLocationCode= balance.LocationCode; + detail.RecommendFromLocationErpCode= balance.LocationErpCode; + detail.RecommendFromLocationGroup= balance.LocationGroup; + detail.RecommendFromWarehouseCode= balance.WarehouseCode; + + detail.ToLocationCode = materialRequestDetail.ToLocationCode; + detail.ToLocationErpCode = materialRequestDetail.ToLocationErpCode; + detail.ToWarehouseCode = materialRequestDetail.ToWarehouseCode; + detail.ToLocationGroup = materialRequestDetail.ToLocationGroup; //detail.Operation = //TODO //detail.DistributionType =//TODO //detail.TruncType = //TODO @@ -206,4 +276,5 @@ public class MaterialRequestEventHandler } + } diff --git a/build/src/docker/publish/conf/settings/appsettings.Development.json b/build/src/docker/publish/conf/settings/appsettings.Development.json index d7703852e..38d969c76 100644 --- a/build/src/docker/publish/conf/settings/appsettings.Development.json +++ b/build/src/docker/publish/conf/settings/appsettings.Development.json @@ -122,10 +122,10 @@ "BaseUrl": "http://dev.ccwin-in.com:21292/" }, "Inventory": { - "BaseUrl": "http://dev.ccwin-in.com:21295/" + "BaseUrl": "http://localhost:59095/" }, "Job": { - "BaseUrl": "http://dev.ccwin-in.com:21295/" + "BaseUrl": "http://localhost:59095/" }, "Label": { "BaseUrl": "http://dev.ccwin-in.com:21292/" @@ -134,7 +134,7 @@ "BaseUrl": "http://dev.ccwin-in.com:21292/" }, "Store": { - "BaseUrl": "http://dev.ccwin-in.com:21295/" + "BaseUrl": "http://localhost:59095/" } }, "Serilog": {