diff --git a/be/DataExchange/Iac/Win_in.Sfs.Wms.DataExchange.Application.Iac.Qad/PurchaseOrderAppService.cs b/be/DataExchange/Iac/Win_in.Sfs.Wms.DataExchange.Application.Iac.Qad/PurchaseOrderAppService.cs index 085cf9304..441352764 100644 --- a/be/DataExchange/Iac/Win_in.Sfs.Wms.DataExchange.Application.Iac.Qad/PurchaseOrderAppService.cs +++ b/be/DataExchange/Iac/Win_in.Sfs.Wms.DataExchange.Application.Iac.Qad/PurchaseOrderAppService.cs @@ -22,7 +22,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Application.Iac.Qad; [ApiExplorerSettings(GroupName = SwaggerGroupConsts.WmsWebApi)] public class PurchaseOrderAppService : ApplicationService, IPurchaseOrderAppService { - private readonly Store.Application.Contracts.IPurchaseOrderAppService _purchaseOrderAppService; + //private readonly Store.Application.Contracts.IPurchaseOrderAppService _purchaseOrderAppService; private readonly IPo_mstrRepository _po_mstrRepository; @@ -34,7 +34,7 @@ public class PurchaseOrderAppService : ApplicationService, IPurchaseOrderAppServ IConfiguration configuration ) { - _purchaseOrderAppService = purchaseOrderAppService; + //_purchaseOrderAppService = purchaseOrderAppService; _po_mstrRepository = po_mstrRepository; _configuration = configuration; } @@ -77,7 +77,7 @@ public class PurchaseOrderAppService : ApplicationService, IPurchaseOrderAppServ targetObj.ContactEmail = ""; #endregion - await _purchaseOrderAppService.UpsertAsync(targetObj).ConfigureAwait(false); + //await _purchaseOrderAppService.UpsertAsync(targetObj).ConfigureAwait(false); } catch (Exception ex) { diff --git a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql index 472671bb6..f10be54b4 100644 --- a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql +++ b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql @@ -3069,6 +3069,7 @@ CREATE TABLE [Store_InspectNoteDetail] ( [Weight] nvarchar(max) NULL, [OtherPropertyJson] nvarchar(max) NULL, [StdPackQty] decimal(18,6) NOT NULL, + [InspectDate] datetime2 NOT NULL, [CreationTime] datetime2 NOT NULL, [CreatorId] uniqueidentifier NULL, [LastModificationTime] datetime2 NULL, @@ -5614,4 +5615,96 @@ CREATE UNIQUE INDEX [IX_Store_ScrapNote_Number] ON [Store_ScrapNote] ([Number]) CREATE INDEX [IX_Store_ScrapNoteDetail_MasterID] ON [Store_ScrapNoteDetail] ([MasterID]) -CREATE UNIQUE INDEX [IX_Store_ScrapNoteDetail_Number_ItemCode_FromPackingCode_FromLocationCode_ToLocationCode_FromLot_FromStatus] ON [Store_ScrapNoteDetail] ([Number], [ItemCode], [FromPackingCode], [FromLocationCode], [ToLocationCode], [ \ No newline at end of file +CREATE UNIQUE INDEX [IX_Store_ScrapNoteDetail_Number_ItemCode_FromPackingCode_FromLocationCode_ToLocationCode_FromLot_FromStatus] ON [Store_ScrapNoteDetail] ([Number], [ItemCode], [FromPackingCode], [FromLocationCode], [ToLocationCode], [FromLot], [FromStatus]) WHERE [FromPackingCode] IS NOT NULL AND [FromLot] IS NOT NULL + + +CREATE UNIQUE INDEX [IX_Store_ScrapRequest_Number] ON [Store_ScrapRequest] ([Number]) + + +CREATE INDEX [IX_Store_ScrapRequestDetail_MasterID] ON [Store_ScrapRequestDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_ScrapRequestDetail_Number_ItemCode_LocationCode] ON [Store_ScrapRequestDetail] ([Number], [ItemCode], [LocationCode]) + + +CREATE UNIQUE INDEX [IX_Store_SupplierAsn_Number] ON [Store_SupplierAsn] ([Number]) + + +CREATE INDEX [IX_Store_SupplierAsn_SupplierCode] ON [Store_SupplierAsn] ([SupplierCode]) + + +CREATE INDEX [IX_Store_SupplierAsnDetail_MasterID] ON [Store_SupplierAsnDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_SupplierAsnDetail_Number_ItemCode_PackingCode] ON [Store_SupplierAsnDetail] ([Number], [ItemCode], [PackingCode]) + + +CREATE UNIQUE INDEX [IX_Store_TransferNote_Number] ON [Store_TransferNote] ([Number]) + + +CREATE INDEX [IX_Store_TransferNoteDetail_MasterID] ON [Store_TransferNoteDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_TransferNoteDetail_Number_FromPackingCode_FromLocationCode_ToLocationCode_FromStatus_ToStatus] ON [Store_TransferNoteDetail] ([Number], [FromPackingCode], [FromLocationCode], [ToLocationCode], [FromStatus], [ToStatus]) WHERE [FromPackingCode] IS NOT NULL + + +CREATE UNIQUE INDEX [IX_Store_TransferRequest_Number] ON [Store_TransferRequest] ([Number]) + + +CREATE INDEX [IX_Store_TransferRequestDetail_MasterID] ON [Store_TransferRequestDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_UnplannedIssueNote_Number] ON [Store_UnplannedIssueNote] ([Number]) + + +CREATE INDEX [IX_Store_UnplannedIssueNoteDetail_MasterID] ON [Store_UnplannedIssueNoteDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_UnplannedIssueNoteDetail_Number_PackingCode_ItemCode_Lot_Status] ON [Store_UnplannedIssueNoteDetail] ([Number], [PackingCode], [ItemCode], [Lot], [Status]) WHERE [Lot] IS NOT NULL + + +CREATE UNIQUE INDEX [IX_Store_UnplannedIssueRequest_Number] ON [Store_UnplannedIssueRequest] ([Number]) + + +CREATE INDEX [IX_Store_UnplannedIssueRequestDetail_MasterID] ON [Store_UnplannedIssueRequestDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_UnplannedIssueRequestDetail_Number_PackingCode_ItemCode_Lot_Status] ON [Store_UnplannedIssueRequestDetail] ([Number], [PackingCode], [ItemCode], [Lot], [Status]) WHERE [Lot] IS NOT NULL + + +CREATE UNIQUE INDEX [IX_Store_UnplannedReceiptNote_Number] ON [Store_UnplannedReceiptNote] ([Number]) + + +CREATE INDEX [IX_Store_UnplannedReceiptNoteDetail_MasterID] ON [Store_UnplannedReceiptNoteDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_UnplannedReceiptNoteDetail_Number_PackingCode_ItemCode_Lot_Status] ON [Store_UnplannedReceiptNoteDetail] ([Number], [PackingCode], [ItemCode], [Lot], [Status]) WHERE [Lot] IS NOT NULL + + +CREATE UNIQUE INDEX [IX_Store_UnplannedReceiptRequest_Number] ON [Store_UnplannedReceiptRequest] ([Number]) + + +CREATE INDEX [IX_Store_UnplannedReceiptRequestDetail_MasterID] ON [Store_UnplannedReceiptRequestDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_UnplannedReceiptRequestDetail_Number_PackingCode_ItemCode_Lot_Status] ON [Store_UnplannedReceiptRequestDetail] ([Number], [PackingCode], [ItemCode], [Lot], [Status]) WHERE [Lot] IS NOT NULL + + +CREATE UNIQUE INDEX [IX_Store_WarehouseTransferNote_Number] ON [Store_WarehouseTransferNote] ([Number]) + + +CREATE INDEX [IX_Store_WarehouseTransferNoteDetail_MasterID] ON [Store_WarehouseTransferNoteDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_WarehouseTransferNoteDetail_Number_FromPackingCode_FromLocationCode_ToLocationCode] ON [Store_WarehouseTransferNoteDetail] ([Number], [FromPackingCode], [FromLocationCode], [ToLocationCode]) WHERE [FromPackingCode] IS NOT NULL + + +CREATE UNIQUE INDEX [IX_Store_WorkOrder_Number] ON [Store_WorkOrder] ([Number]) + + +CREATE INDEX [IX_Store_WorkOrderDetail_MasterID] ON [Store_WorkOrderDetail] ([MasterID]) + + +CREATE UNIQUE INDEX [IX_Store_WorkOrderDetail_Number_ItemCode] ON [Store_WorkOrderDetail] ([Number], [ItemCode]) + + diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReceiptJobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReceiptJobController.cs index dc0477c94..907793da8 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReceiptJobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReceiptJobController.cs @@ -53,7 +53,7 @@ public class PurchaseReceiptJobController : AbpController [HttpGet("{id}")] public virtual async Task> GetAsync(Guid id) { - var result = await _purchaseReceiptJobAppService.GetNoCacheAsync(id).ConfigureAwait(false); + var result = await _purchaseReceiptJobAppService.GetAsync(id).ConfigureAwait(false); var supplier = await _supplierAppService.GetByCodeAsync(result.SupplierCode).ConfigureAwait(false); result.SupplierName = supplier.Name; diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs index 450e9326c..86c329304 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs @@ -33,7 +33,7 @@ public class IssueNoteController : AbpController [HttpPost("")] public virtual async Task CreateAsync([FromBody] IssueNoteEditInput input) { - input.RequestType = EnumMaterialRequestType.Direct_Issue.ToString(); + input.RequestType = EnumMaterialRequestType.Issue_Direct.ToString(); input.Details.ForEach(p => { @@ -54,5 +54,4 @@ public class IssueNoteController : AbpController { return await _issueNoteAppService.ConfirmAsync(id).ConfigureAwait(false); } - } diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/L7Controller.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/L7Controller.cs index a3b534eaa..6b6a9fd09 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/L7Controller.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/L7Controller.cs @@ -54,7 +54,7 @@ public class L7Controller : AbpController [HttpPost("create-product-recycle-note-with-l7")] public virtual async Task CreateProductRecycleNoteWithL7Async(ProductRecycleNoteEditInput input) { - return await _productRecycleNoteAppService.CreateWithL7Async(input).ConfigureAwait(false); + return await _productRecycleNoteAppService.CreateAsync(input).ConfigureAwait(false); } /// diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/RecycledMaterialReceiptNoteController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/RecycledMaterialReceiptNoteController.cs index 0fd4dd012..c5682b153 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/RecycledMaterialReceiptNoteController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/RecycledMaterialReceiptNoteController.cs @@ -26,7 +26,7 @@ public class RecycledMaterialReceiptNoteController : AbpController } /// - /// 获取盘点任务详情 + /// 回收料调整 /// /// /// diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs index 7eb2e6173..65dd8b377 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs @@ -423,9 +423,12 @@ public class BalanceManager : DomainService, IBalanceManager expression = expression.And(p => p.ExpireDate > DateTime.Now); } //筛选有效库区 - if (validLocationAreas.Any()) + if (validLocationAreas.Any() ) { - expression = expression.And(p => validLocationAreas.Contains(p.LocationArea)); + if (!string.IsNullOrEmpty(validLocationAreas[0])) + { + expression = expression.And(p => validLocationAreas.Contains(p.LocationArea)); + } } var allBalances = await (await _balanceRepository.GetDbSetAsync().ConfigureAwait(false)) diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransSubType.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransSubType.cs index f99e6672e..451f73df2 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransSubType.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Inventory/EnumTransSubType.cs @@ -127,6 +127,12 @@ public enum EnumTransSubType [Display(Name = "安全库存拉动")] Issue_SafetyStock = 1504, + /// + /// 直接发料 + /// + [Display(Name = "直接发料")] + Issue_Direct = 1505, + /// /// 标准发货 /// diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumMaterialRequestType.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumMaterialRequestType.cs index 245c1f9e8..0fa48dec0 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumMaterialRequestType.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumMaterialRequestType.cs @@ -28,5 +28,5 @@ public enum EnumMaterialRequestType //Issue_SfaetyStock = 1504, [Display(Name = "直接发料")] - Direct_Issue = 1505 + Issue_Direct = 1505 } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/PurchaseReceiptJobs/IPurchaseReceiptJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/PurchaseReceiptJobs/IPurchaseReceiptJobAppService.cs index 791a05915..027134838 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/PurchaseReceiptJobs/IPurchaseReceiptJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/PurchaseReceiptJobs/IPurchaseReceiptJobAppService.cs @@ -42,15 +42,7 @@ public interface IPurchaseReceiptJobAppService Task> SetInspectWithNotInspectAsync(Guid id); /// - /// 按Id获取实体 不走缓存 - /// - /// 实体Id - /// - /// - Task GetNoCacheAsync(Guid id); - - /// - /// 根据收货编号获取收货任务 + /// 根据供应商编号获取收货任务 /// /// Task> GetListBySupplierCodeOnTodayAsync(string supplierCode); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/IDeliverNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/IDeliverNoteAppService.cs index eb39e36ee..b0aab9524 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/IDeliverNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/IDeliverNoteAppService.cs @@ -1,4 +1,9 @@ +using System.Threading; using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.Application.Dtos; +using Win_in.Sfs.Shared.Application.Contracts; +using Win_in.Sfs.Wms.Store.Domain; namespace Win_in.Sfs.Wms.Store.Application.Contracts; @@ -9,4 +14,25 @@ public interface IDeliverNoteAppService : Task CreateWithL7Async(DeliverNoteEditInput input); + Task> GetForFisListAsync( + SfsStoreRequestInputBase sfsRequestDTO, + bool includeDetails = false, + CancellationToken cancellationToken = default); + + Task> GetForNormalListAsync( + SfsStoreRequestInputBase sfsRequestDTO, + bool includeDetails = false, + CancellationToken cancellationToken = default); + + Task> GetForRAWListAsync( + SfsStoreRequestInputBase sfsRequestDTO, + bool includeDetails = false, + CancellationToken cancellationToken = default); + + + Task ExportForNormalAsync(SfsStoreRequestInputBase requestInput); + + Task ExportForRAWAsync(SfsExportRequestInput requestInput); + + Task SumPrintAsync(string number); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ProductRecycleNotes/IProductRecycleNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ProductRecycleNotes/IProductRecycleNoteAppService.cs index 8a4425a1e..426677c67 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ProductRecycleNotes/IProductRecycleNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ProductRecycleNotes/IProductRecycleNoteAppService.cs @@ -7,5 +7,4 @@ public interface IProductRecycleNoteAppService : { Task CreateAsync(ProductRecycleNoteEditInput input); - Task CreateWithL7Async(ProductRecycleNoteEditInput input); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ProductReceiptRequests/Inputs/ProductReceiptRequestEditInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ProductReceiptRequests/Inputs/ProductReceiptRequestEditInput.cs index 09f948138..b91d9c807 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ProductReceiptRequests/Inputs/ProductReceiptRequestEditInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ProductReceiptRequests/Inputs/ProductReceiptRequestEditInput.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using Win_in.Sfs.Shared.Domain; +using Win_in.Sfs.Shared.Domain.Shared; namespace Win_in.Sfs.Wms.Store.Application.Contracts; @@ -70,7 +71,7 @@ public class ProductReceiptRequestEditInput : SfsStoreRequestCreateOrUpdateInput /// 类型 /// [Display(Name = "类型")] - public string EnumProductReceiptType { get; set; } + public EnumProductReceiptType Type { get; set; } /// /// 明细列表 diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobAppService.cs index a72b629b6..e1c099ab0 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobAppService.cs @@ -22,31 +22,21 @@ public class PurchaseReceiptJobAppService : , IPurchaseReceiptJobAppService { private readonly IFileAppService _fileAppService; - private readonly IInspectJobManager _inspectJobManager; - private readonly IInspectRequestAppService _inspectRequestAppService; private readonly IPurchaseReceiptJobManager _purchaseReceiptJobManager; - private readonly IPurchaseReceiptNoteAppService _purchaseReceiptNoteAppService; /// /// /// - /// /// /// - /// /// public PurchaseReceiptJobAppService(IPurchaseReceiptJobRepository repository, - IInspectJobManager inspectJobManager, IPurchaseReceiptJobManager purchaseReceiptJobManager, IPurchaseReceiptNoteAppService purchaseReceiptNoteAppService, - IInspectRequestAppService inspectRequestAppService, IFileAppService fileAppService) : base(repository, purchaseReceiptJobManager) { _purchaseReceiptJobManager = purchaseReceiptJobManager; - _purchaseReceiptNoteAppService = purchaseReceiptNoteAppService; - _inspectRequestAppService = inspectRequestAppService; _fileAppService = fileAppService; - _inspectJobManager = inspectJobManager; } #region 东阳使用 @@ -151,27 +141,28 @@ public class PurchaseReceiptJobAppService : var dict = await _fileAppService.CreateManyHasDictAsync(input.FilesList).ConfigureAwait(false); detail.InspectPhotoJson = JsonSerializer.Serialize(dict); } - - if (detail != null) + else { - detail.FailedReason = input.FailedReason; - detail.MassDefect = input.MassDefect; - detail.PurchaseReceiptInspectStatus = input.PurchaseReceiptInspectStatus; - detail.HandledLot = detail.RecommendLot; - detail.HandledSupplierBatch = detail.RecommendSupplierBatch; - detail.HandledArriveDate = detail.RecommendArriveDate; - detail.HandledProduceDate = detail.RecommendProduceDate; - detail.HandledExpireDate = detail.RecommendExpireDate; - detail.HandledToLocationArea=detail.RecommendToLocationArea; - detail.HandledToLocationGroup=detail.RecommendToLocationGroup; - detail.HandledContainerCode = detail.RecommendContainerCode; - detail.HandledToLocationCode = detail.RecommendToLocationCode; - detail.HandledToLocationErpCode = detail.RecommendToLocationErpCode; - detail.HandledToWarehouseCode = detail.RecommendToWarehouseCode; - detail.HandledPackingCode = detail.RecommendPackingCode; - detail.HandledQty = detail.RecommendQty; + detail.InspectPhotoJson = string.Empty; } + detail.FailedReason = input.FailedReason; + detail.MassDefect = input.MassDefect; + detail.PurchaseReceiptInspectStatus = input.PurchaseReceiptInspectStatus; + detail.HandledLot = detail.RecommendLot; + detail.HandledSupplierBatch = detail.RecommendSupplierBatch; + detail.HandledArriveDate = detail.RecommendArriveDate; + detail.HandledProduceDate = detail.RecommendProduceDate; + detail.HandledExpireDate = detail.RecommendExpireDate; + detail.HandledToLocationArea = detail.RecommendToLocationArea; + detail.HandledToLocationGroup = detail.RecommendToLocationGroup; + detail.HandledContainerCode = detail.RecommendContainerCode; + detail.HandledToLocationCode = detail.RecommendToLocationCode; + detail.HandledToLocationErpCode = detail.RecommendToLocationErpCode; + detail.HandledToWarehouseCode = detail.RecommendToWarehouseCode; + detail.HandledPackingCode = detail.RecommendPackingCode; + detail.HandledQty = detail.RecommendQty; + var entity = await _repository.UpdateAsync(job).ConfigureAwait(false); return ObjectMapper.Map( @@ -191,24 +182,10 @@ public class PurchaseReceiptJobAppService : return ObjectMapper.Map(entity); } - /// - /// 根据供应商编号获取收货任务 - /// - /// - [HttpPost("get-by-supplier-code-on-today/{supplierCode}")] - public virtual async Task> GetListBySupplierCodeOnTodayAsync(string supplierCode) - { - var purchaseReceiptJobs = await _repository.GetListAsync(p => - p.SupplierCode == supplierCode && - p.PlanArriveDate.Year == DateTime.Now.Year && - p.PlanArriveDate.Month == DateTime.Now.Month && - p.PlanArriveDate.Day == DateTime.Now.Day); - var dto = ObjectMapper.Map, List>(purchaseReceiptJobs); - return dto; - } #endregion /// + /// 取消收货 /// /// [HttpPost("cancel-by-request/{purchaseReceiptRequestNumber}")] @@ -222,6 +199,37 @@ public class PurchaseReceiptJobAppService : } } + /// + /// 根据供应商编号获取收货任务 + /// + /// + [HttpPost("get-by-supplier-code-on-today/{supplierCode}")] + public virtual async Task> GetListBySupplierCodeOnTodayAsync(string supplierCode) + { + var purchaseReceiptJobs = await _repository.GetListAsync(p => + p.SupplierCode == supplierCode && + p.PlanArriveDate.Year == DateTime.Now.Year && + p.PlanArriveDate.Month == DateTime.Now.Month && + p.PlanArriveDate.Day == DateTime.Now.Day).ConfigureAwait(false); + var dto = ObjectMapper.Map, List>(purchaseReceiptJobs); + return dto; + } + + ///// + ///// 取消请求 + ///// + ///// + //[HttpPost("cancel-by-request/{purchaseReceiptRequestNumber}")] + //public virtual async Task CancelByPurchaseReceiptRequestAsync(string purchaseReceiptRequestNumber) + //{ + // var entities = await _repository + // .GetListAsync(p => p.PurchaseReceiptRequestNumber == purchaseReceiptRequestNumber).ConfigureAwait(false); + // foreach (var entity in entities) + // { + // await _purchaseReceiptJobManager.CancelAsync(entity).ConfigureAwait(false); + // } + //} + /* /// /// 承接收货任务 diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CountNotes/CountNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CountNotes/CountNoteAppService.cs index 015825e1f..501ef2e4a 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CountNotes/CountNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CountNotes/CountNoteAppService.cs @@ -1,11 +1,13 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Volo.Abp; using Volo.Abp.Domain.Repositories; +using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; @@ -35,6 +37,45 @@ public class CountNoteAppService : _countPlanAppService = countPlanAppService; } + #region 东阳 + + /// + /// 用来重写 导入数据时可以加工数据 + /// + /// + /// + protected async override Task> ImportProcessingEntityAsync(Dictionary dictionary) + { + var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key); + + foreach (var countNote in addList) + { + var countPlanDto=await _countPlanAppService.GetByNumberAsync(countNote.CountPlanNumber).ConfigureAwait(false); + if (countPlanDto.RequestType != CountPlanRequestType.Import) + { + throw new UserFriendlyException("非Excel盘点执行方式不能使用导入"); + } + //特殊处理 因为盘点记录可以重复导入 所以每次导入前删除调原有记录 + //_repository.DeleteAsync(p=>p.CountPlanNumber==CountPlan) + + countNote.Worker = CurrentUser.GetUserName(); + countNote.CreatorId = CurrentUser.Id; + countNote.BeginTime= DateTime.Now; + countNote.Adjusted = false; + countNote.EndTime=DateTime.Now; + countNote.Stage = EnumCountStage.Audit; + + //foreach (var detail in purchaseReturnRequest.Details) + //{ + + //} + } + + return dictionary; + } + + #endregion + /// /// 新增接口 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/IssueNotes/IssueNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/IssueNotes/IssueNoteAppService.cs index ea96420d5..af6df5643 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/IssueNotes/IssueNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/IssueNotes/IssueNoteAppService.cs @@ -8,7 +8,9 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Volo.Abp; using Volo.Abp.Application.Dtos; +using Volo.Abp.Domain.Entities; using Win_in.Sfs.Shared.Domain; +using Win_in.Sfs.Shared.Event; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain.Shared; @@ -50,9 +52,11 @@ public class IssueNoteAppService : [HttpPost("confirm/{id}")] public virtual async Task ConfirmAsync(Guid id) { - var entity = await _issueNoteManager.ConfirmAsync(id).ConfigureAwait(false); - var dto = ObjectMapper.Map(entity); - return dto; + var issueNote= await _repository.GetAsync(id).ConfigureAwait(false); + issueNote.Confirmed = true; + issueNote=await _repository.UpdateAsync(issueNote).ConfigureAwait(false); + await LocalEventBus.PublishAsync(new SfsConfirmedEntityEventData(issueNote), false).ConfigureAwait(false); + return ObjectMapper.Map(issueNote); } [HttpPost("confirm-by-number/{number}")] diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductRecycleNotes/ProductRecycleNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductRecycleNotes/ProductRecycleNoteAppService.cs index 36e876a07..db384ee8f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductRecycleNotes/ProductRecycleNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductRecycleNotes/ProductRecycleNoteAppService.cs @@ -54,23 +54,6 @@ public class ProductRecycleNoteAppService : return dto; } - /// - /// 新增退货接口 - /// - /// - /// - [HttpPost("create-with-l7")] - public virtual async Task CreateWithL7Async(ProductRecycleNoteEditInput input) - { - var entity = ObjectMapper.Map(input); - - await _productRecycleNoteManager.CreateAsync(entity).ConfigureAwait(false); - - var dto = ObjectMapper.Map(entity); - - return dto; - } - [HttpGet("note-and-back-flush/{id}")] public virtual async Task GetNoteAndBackFlushAsync(Guid id) { diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductionReturnNotes/ProductionReturnNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductionReturnNotes/ProductionReturnNoteAppService.cs index 302071a0f..35db79092 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductionReturnNotes/ProductionReturnNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductionReturnNotes/ProductionReturnNoteAppService.cs @@ -28,7 +28,7 @@ public class ProductionReturnNoteAppService : } /// - /// 新增接口 + /// 新增实体 /// /// /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAppService.cs index ad717ec51..d502ec9d8 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAppService.cs @@ -1,6 +1,11 @@ using System.Threading.Tasks; +using DocumentFormat.OpenXml.Bibliography; +using FluentValidation.Validators; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Volo.Abp.ObjectMapping; +using Win_in.Sfs.Basedata.Application.Contracts; +using Win_in.Sfs.Shared.Event; using Win_in.Sfs.Wms.Inventory.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; @@ -22,24 +27,53 @@ public class RecycledMaterialReceiptNoteAppService : { private readonly IRecycledMaterialReceiptNoteManager _RecycledMaterialReceiptNoteManager; private readonly ILocationCapacityAppService _locationCapacityAppService; + private readonly ILocationAppService _locationAppService; + private readonly IItemBasicAppService _itemBasicAppService; public RecycledMaterialReceiptNoteAppService(IRecycledMaterialReceiptNoteRepository repository, IRecycledMaterialReceiptNoteManager RecycledMaterialReceiptNoteManager, - ILocationCapacityAppService locationCapacityAppService) : base(repository) + ILocationCapacityAppService locationCapacityAppService, + ILocationAppService locationAppService, + IItemBasicAppService itemBasicAppService) : base(repository) { _RecycledMaterialReceiptNoteManager = RecycledMaterialReceiptNoteManager; _locationCapacityAppService = locationCapacityAppService; + _locationAppService = locationAppService; + _itemBasicAppService = itemBasicAppService; } - [HttpPost("")] - //[Authorize(RecycledMaterialReceiptNotePermissions.Create)] + /// + /// 新增实体 + /// + /// CreateInput public override async Task CreateAsync(RecycledMaterialReceiptNoteEditInput input) { - var entity = ObjectMapper.Map(input); - await _RecycledMaterialReceiptNoteManager.CreateAsync(entity).ConfigureAwait(false); + var entity= ObjectMapper.Map(input); - var dto = ObjectMapper.Map(entity); + entity.Number=string.IsNullOrEmpty(input.Number) + ? await GenerateNumberAsync(nameof(RecycledMaterialReceiptNote), input.ActiveDate) + .ConfigureAwait(false) + : input.Number; - return dto; + foreach (var detail in entity.Details) + { + var detailNumber = await GenerateNumberAsync(nameof(RecycledMaterialReceiptNote), input.ActiveDate) + .ConfigureAwait(false); + detail.Number=detailNumber; + var locationDto = await _locationAppService.GetByCodeAsync(detail.LocationCode).ConfigureAwait(false); + detail.LocationErpCode = locationDto.ErpLocationCode; + detail.LocationArea = locationDto.AreaCode; + detail.LocationGroup = locationDto.LocationGroupCode; + detail.WarehouseCode=locationDto.WarehouseCode; + var itemBasicDto=await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); + detail.StdPackQty = itemBasicDto.StdPackQty; + detail.Uom = itemBasicDto.BasicUom; + } + + entity=await _repository.InsertAsync(entity).ConfigureAwait(false); + + await LocalEventBus.PublishAsync(new SfsCreatedEntityEventData(entity),false).ConfigureAwait(false); + + return ObjectMapper.Map(entity); } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAutoMapperProfile.cs index edd59fb19..35ee6a020 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAutoMapperProfile.cs @@ -22,5 +22,14 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.TenantId) .Ignore(x => x.Number) .Ignore(x => x.Id); + + CreateMap< RecycledMaterialReceiptNoteEditInput,RecycledMaterialReceiptNote > () + .IgnoreAuditedObjectProperties() + .Ignore(x => x.Remark) + .Ignore(x => x.ExtraProperties) + .Ignore(x => x.TenantId) + .Ignore(x => x.Number) + .Ignore(x => x.Id); + ; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs index 8c91beb97..533107d6b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs @@ -3,23 +3,15 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; -using DocumentFormat.OpenXml.Office2010.ExcelAc; -using DocumentFormat.OpenXml.Spreadsheet; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Volo.Abp; -using Volo.Abp.Uow; -using Volo.Abp.Users; using Win_in.Sfs.Basedata.Application.Contracts; -using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Domain.Shared; -using Win_in.Sfs.Shared.Event; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain.Shared; -using PurchaseOrderDetail = Win_in.Sfs.Wms.Store.Domain.PurchaseOrderDetail; namespace Win_in.Sfs.Wms.Store.Application; @@ -34,7 +26,8 @@ public class PurchaseOrderAppService : private readonly IPurchaseOrderManager _purchaseOrderManager; private readonly ISupplierAppService _supplierAppService; private readonly IItemBasicAppService _itemBasicAppService; - + private readonly IPurchaseReceiptJobAppService _purchaseReceiptJobAppService; + public PurchaseOrderAppService( IPurchaseOrderRepository repository, IPurchaseOrderManager purchaseOrderManager, @@ -53,30 +46,31 @@ public class PurchaseOrderAppService : #region 东阳使用 /// - /// 用来重写 导入数据时可以加工数据 + /// 用来重写 导入数据时可以加工数据 /// /// /// protected override async Task> ImportProcessingEntityAsync( Dictionary dictionary) { - var addList= dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key); + var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key); foreach (var purchaseOrder in addList) { purchaseOrder.CreatorId = CurrentUser.Id; purchaseOrder.Worker = CurrentUser.Name; - var supplierDto=await _supplierAppService.GetByCodeAsync(purchaseOrder.SupplierCode).ConfigureAwait(false); + var supplierDto = + await _supplierAppService.GetByCodeAsync(purchaseOrder.SupplierCode).ConfigureAwait(false); purchaseOrder.SupplierCode = supplierDto.Code; purchaseOrder.SupplierAddress = supplierDto.Address; - purchaseOrder.SupplierName= supplierDto.Name; + purchaseOrder.SupplierName = supplierDto.Name; foreach (var detail in purchaseOrder.Details) { - var itemBasicDto= await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); + var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); - detail.ItemName= itemBasicDto.Name; + detail.ItemName = itemBasicDto.Name; detail.ItemDesc1 = itemBasicDto.Desc1; detail.ItemDesc2 = itemBasicDto.Desc2; } @@ -87,10 +81,8 @@ public class PurchaseOrderAppService : #endregion - - /// - /// 【创建】采购订单 + /// 【创建】采购订单 /// /// /// @@ -111,7 +103,7 @@ public class PurchaseOrderAppService : } /// - /// 【批量创建】采购订单 + /// 【批量创建】采购订单 /// /// /// @@ -163,8 +155,6 @@ public class PurchaseOrderAppService : await _repository.UpdateAsync(entity).ConfigureAwait(false); } - #region Function - [HttpPost("complete/{number}")] public async Task CompleteAsync(string number) { @@ -173,9 +163,6 @@ public class PurchaseOrderAppService : } [HttpPost("cancel/{id}")] - - #endregion - [HttpPost("{id}/detail/open/{detailId}")] public virtual async Task OpenDetailAsync(Guid id, Guid detailId) { @@ -188,13 +175,6 @@ public class PurchaseOrderAppService : await _purchaseOrderManager.CloseDetailAsync(id, detailId).ConfigureAwait(false); } - [HttpPost("check-status")] - public virtual async Task CheckStatusAsync(string number) - { - await Task.CompletedTask.ConfigureAwait(false); - throw new NotImplementedException(); - } - [HttpPost("upsert")] public virtual async Task UpsertAsync(PurchaseOrderEditInput input) { @@ -202,6 +182,27 @@ public class PurchaseOrderAppService : await _repository.UpsertAsync(entity).ConfigureAwait(false); } + + [HttpGet("get-list-by-item-code")] + public virtual async Task> GetListByItemCodeAsync(string itemCode) + { + var entitys = await _repository.GetListAsync(p => p.Details.Any(y => y.ItemCode == itemCode)) + .ConfigureAwait(false); + + var dtos = ObjectMapper.Map, List>(entitys); + + return dtos; + } + + #region 校验 + + [HttpPost("check-status")] + public virtual async Task CheckStatusAsync(string number) + { + await Task.CompletedTask.ConfigureAwait(false); + throw new NotImplementedException(); + } + protected virtual async Task CheckImportInputBusinessAsync(PurchaseOrderImportInput importInput, EnumImportMethod importMethod, List validationRresult) { @@ -231,47 +232,17 @@ public class PurchaseOrderAppService : Check.NotNull(item, "供应商代码", "供应商不存在"); } - protected override async Task GetEntityAsync(PurchaseOrderImportInput importInput) - { - return await _repository.FindAsync(t => t.Number == importInput.Number).ConfigureAwait(false); - } - - protected virtual async Task ImportDataAsync(List entites, List deleteEntities) - { - await _purchaseOrderManager.ImportDataAsync(entites, deleteEntities).ConfigureAwait(false); - } - - protected override Func GetEntityExpression() - { - return t => t.Number; - } - - [HttpGet("get-list-by-item-code")] - public virtual async Task> GetListByItemCodeAsync(string itemCode) - { - var entitys = await _repository.GetListAsync(p => p.Details.Any(y => y.ItemCode == itemCode)) - .ConfigureAwait(false); - - var dtos = ObjectMapper.Map, List>(entitys); - - return dtos; - } + #endregion [HttpGet("get-list-by-supplier-code-and-item-code")] public virtual async Task> GetListBySupplierCodeAsync(string supplierCode, string itemCode) { - var entitys = await _repository.GetListAsync(p => p.Details.Any(y => y.ItemCode == itemCode) && p.SupplierCode == supplierCode); - - List list = new List(); + var entitys = await _repository.GetListAsync(p => p.Details.Any(y => y.ItemCode == itemCode) && p.SupplierCode == supplierCode).ConfigureAwait(false); - foreach (var entity in entitys) - { - var purchaseOrder = await _repository.GetAsync(entity.Id); - list.Add(purchaseOrder); - } - - var dtos = ObjectMapper.Map, List>(list); + var dtos = ObjectMapper.Map, List>(entitys); return dtos; } + + } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/CountPlans/CountPlanAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/CountPlans/CountPlanAppService.cs index 597a98ee4..a750ba193 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/CountPlans/CountPlanAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/CountPlans/CountPlanAppService.cs @@ -121,23 +121,6 @@ public class CountPlanAppService : await _countPlanManager.CompleteAsync(id, type).ConfigureAwait(false); } - /* - /// - /// 校正库存 - /// - /// - /// - [HttpPost("adjust/{id}")] - public virtual async Task AdjustAsync(Guid id) - { - - var entity = await _repository.FindAsync(id); - Check.NotNull(entity, EntityClassName); - - await _countPlanManager.AdjustAsync(entity); - - } - */ [HttpPost("check-status")] public virtual async Task CheckStatusAsync(string number) { 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 d7f3a3545..fb06276e5 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 @@ -42,7 +42,7 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase(input); + foreach (var detail in entity.Details) + { + var toLocationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false); + var productionLineDto = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationDto.LocationGroupCode).ConfigureAwait(false); + + detail.ToLocationArea= toLocationDto.AreaCode; + detail.ToLocationErpCode = toLocationDto.ErpLocationCode; + detail.ToLocationGroup = toLocationDto.LocationGroupCode; + detail.ToWarehouseCode= toLocationDto.WarehouseCode; + } + + entity.UseOnTheWayLocation = true; var result = await _materialRequestManager.CreateBynNumberAsync(entity).ConfigureAwait(false); @@ -372,7 +390,7 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase CheckItemBasicAsync(MaterialRequestImportInput importInput, List validationRresult) { - var item = await ItemBasicAclService.GetByCodeAsync(importInput.ItemCode).ConfigureAwait(false); + var item = await _itemBasicAppService.GetByCodeAsync(importInput.ItemCode).ConfigureAwait(false); if (item == null) { validationRresult.Add(new ValidationResult($"物品代码{importInput.ItemCode}不存在", new[] { "物品代码" })); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductReceiptRequests/ProductReceiptRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductReceiptRequests/ProductReceiptRequestAppService.cs index 5a388cefe..54689060c 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductReceiptRequests/ProductReceiptRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductReceiptRequests/ProductReceiptRequestAppService.cs @@ -6,12 +6,14 @@ using System.Linq.Expressions; using System.Threading; using System.Threading.Tasks; using DocumentFormat.OpenXml.Office.CustomUI; +using FluentValidation; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.Domain.Entities; +using Volo.Abp.Validation; using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Domain; @@ -176,7 +178,12 @@ public class ProductReceiptRequestAppService : bool includeDetails = false, CancellationToken cancellationToken = default) { - Expression> expression = p => p.Type.ToString() == type; + if (!EnumProductReceiptType.TryParse(type, true, out EnumProductReceiptType enumType)) + { + throw new AbpValidationException($"type {type} is not valid"); + } + + Expression> expression = p => p.Type == enumType; if (requestInput.Condition.Filters?.Count > 0) { expression = expression.And(requestInput.Condition.Filters.ToLambda()); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAutoMapperProfile.cs index 1f074962d..18c6c170f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAutoMapperProfile.cs @@ -20,7 +20,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile CreateMap() .IgnoreAuditedObjectProperties() - .Ignore(x => x.ToWarehouseCode) .Ignore(x => x.MasterID) .Ignore(x => x.TenantId) .Ignore(x => x.Number) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/IssueJobManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/IssueJobManager.cs index 7590d0ddc..ead66142e 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/IssueJobManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/IssueJobManager.cs @@ -33,8 +33,17 @@ public class IssueJobManager : SfsJobManagerBase, IIss foreach (var detail in input.Details) { //发料子任务 赋值实际转移 - await entity.BuildDetail(detail.Id, detail.HandledFromLocationCode, detail.HandledFromLocationErpCode, detail.HandledFromWarehouseCode, - detail.HandledQty, detail.HandledSupplierBatch, detail.HandledArriveDate, detail.HandledProduceDate, detail.HandledExpireDate, detail.HandledContainerCode, detail.HandledLot, + await entity.BuildDetail(detail.Id, + detail.HandledFromLocationCode, + detail.HandledFromLocationErpCode, + detail.HandledFromWarehouseCode, + detail.HandledQty, + detail.HandledSupplierBatch, + detail.HandledArriveDate, + detail.HandledProduceDate, + detail.HandledExpireDate, + detail.HandledContainerCode, + detail.HandledLot, detail.HandledPackingCode).ConfigureAwait(false); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/RecycledMaterialReceiptNotes/IRecycledMaterialReceiptNoteManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/RecycledMaterialReceiptNotes/IRecycledMaterialReceiptNoteManager.cs index f45395934..7a96bcad8 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/RecycledMaterialReceiptNotes/IRecycledMaterialReceiptNoteManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/RecycledMaterialReceiptNotes/IRecycledMaterialReceiptNoteManager.cs @@ -4,5 +4,5 @@ namespace Win_in.Sfs.Wms.Store.Domain; public interface IRecycledMaterialReceiptNoteManager : ISfsStoreManager { - Task CreateByPurchaseReceiptNoteAsync(PurchaseReceiptNote purchaseReceiptNote); + } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteManager.cs index 1ccb6c7b1..0b0ea9e7f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteManager.cs @@ -10,18 +10,4 @@ public class RecycledMaterialReceiptNoteManager : SfsStoreManagerBase CreateAsync(RecycledMaterialReceiptNote entity) - { - return await base.CreateAsync(entity).ConfigureAwait(false); - - } - - public virtual async Task CreateByPurchaseReceiptNoteAsync(PurchaseReceiptNote purchaseReceiptNote) - { - var RecycledMaterialReceiptNote = ObjectMapper.Map(purchaseReceiptNote); - - await base.CreateAsync(RecycledMaterialReceiptNote).ConfigureAwait(false); - } - } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/CountPlans/CountPlanManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/CountPlans/CountPlanManager.cs index bebfabce1..a48c1c1cb 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/CountPlans/CountPlanManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/CountPlans/CountPlanManager.cs @@ -14,12 +14,14 @@ namespace Win_in.Sfs.Wms.Store.Domain; public class CountPlanManager : SfsStoreRequestManagerBase, ICountPlanManager { + private readonly ICountPlanRepository _repository; public CountPlanManager( ICountPlanRepository repository ) : base(repository) { + _repository = repository; } /// @@ -107,9 +109,11 @@ public class CountPlanManager : SfsStoreRequestManagerBase 0) { - SfsBaseDataRequestInputBase itemInput = new SfsBaseDataRequestInputBase(); - itemInput.Condition = partCondition; - itemInput.MaxResultCount = 99999; + var itemInput = new SfsBaseDataRequestInputBase + { + Condition = partCondition, + MaxResultCount = 99999 + }; var itemBaseList = await ItemBasicAppService.GetAllListByFilterAsync(itemInput, false).ConfigureAwait(false); @@ -119,16 +123,18 @@ public class CountPlanManager : SfsStoreRequestManagerBase 0) { - SfsBaseDataRequestInputBase locInput = new SfsBaseDataRequestInputBase(); - locInput.Condition = locCondition; - locInput.MaxResultCount = 99999; + var locInput = new SfsBaseDataRequestInputBase + { + Condition = locCondition, + MaxResultCount = 99999 + }; var locList = await LocationAppService.GetAllListByFilterAsync(locInput, false).ConfigureAwait(false); //库位列表 selectLocationCodes = locList.Select(p => p.Code).Distinct().ToList(); } //状态查询 - string statusStr = System.Text.Json.JsonSerializer.Serialize(selectStatusList.Select(p => (int)p).ToList()); + var statusStr = System.Text.Json.JsonSerializer.Serialize(selectStatusList.Select(p => (int)p).ToList()); //最终的查询条件语句 SfsInventoryRequestInputBase banlanceInput = new SfsInventoryRequestInputBase(); @@ -196,10 +202,8 @@ public class CountPlanManager : SfsStoreRequestManagerBase(entity), false) + .ConfigureAwait(false); + await _repository.InsertAsync(entity).ConfigureAwait(false); + return entity; } @@ -128,6 +128,13 @@ public class MaterialRequestManager oldEntity.ReplaceDetail(newDetail.Id, newDetail); } + var flag=oldEntity.Details.Any(p => p.ReceivedQty < p.Qty);//还有补料完 没收到的货 + + if (!flag) + { + oldEntity.Complete(); + } + await Repository.UpdateAsync(oldEntity).ConfigureAwait(false); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/ProductionReturnJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/ProductionReturnJobAutoMapperProfile.cs index 2bef49393..f75b41476 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/ProductionReturnJobAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/ProductionReturnJobAutoMapperProfile.cs @@ -52,9 +52,6 @@ public partial class StoreEventAutoMapperProfile : Profile CreateMap() .MapExpectInOutTo() - .Ignore(x => x.LocationArea) - .Ignore(x => x.LocationGroup) - .Ignore(x => x.WarehouseCode) .Ignore(x => x.SerialNumber) .Ignore(x => x.Worker) .Ignore(x => x.ExtraProperties) @@ -63,10 +60,10 @@ public partial class StoreEventAutoMapperProfile : Profile CreateMap() .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.LocationArea) - .Ignore(x => x.LocationGroup) .Ignore(x => x.SerialNumber) .Ignore(x => x.Worker) .Ignore(x => x.ExtraProperties); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/ExpectInOuts/ProductionReturnStoreEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/ExpectInOuts/ProductionReturnJobEventHandler.cs similarity index 98% rename from be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/ExpectInOuts/ProductionReturnStoreEventHandler.cs rename to be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/ExpectInOuts/ProductionReturnJobEventHandler.cs index 4c80640e3..5635bf206 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/ExpectInOuts/ProductionReturnStoreEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/ExpectInOuts/ProductionReturnJobEventHandler.cs @@ -9,7 +9,7 @@ using Win_in.Sfs.Wms.Store.Event.Inventories; namespace Win_in.Sfs.Wms.Store.Event.ExpectInOuts; -public class ProductionReturnStoreEventHandler : +public class ProductionReturnJobEventHandler : StoreExpectInOutEventHandlerBase , ILocalEventHandler> , ILocalEventHandler> 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 845a07a72..df7782591 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 @@ -214,7 +214,10 @@ public class MaterialRequestEventHandler var detail = await BuildIssueJobDetailAsync(materialRequestDetail, recommend, toLocationGroupCode).ConfigureAwait(false); if (materialRequest.UseOnTheWayLocation) { - detail.OnTheWayLocationCode = await SettingManager.GetOrNullGlobalAsync(StoreSettings.Common.IssueOnTheWayLocation).ConfigureAwait(false); + //获取在途库 + var locationDto= await _locationAppService.GetFirstByTypeAsync(EnumLocationType.TRANSPORT).ConfigureAwait(false); + + detail.OnTheWayLocationCode = locationDto.Code; } jobDetails.Add(detail); @@ -251,6 +254,7 @@ public class MaterialRequestEventHandler detail.ToLocationCode = materialRequestDetail.ToLocationCode; detail.ToLocationErpCode = materialRequestDetail.ToLocationErpCode; + detail.ToLocationArea= materialRequestDetail.ToLocationArea; detail.ToWarehouseCode = materialRequestDetail.ToWarehouseCode; detail.ToLocationGroup = materialRequestDetail.ToLocationGroup; //detail.Operation = //TODO diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/IssueNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/IssueNoteEventHandler.cs index e113d92e4..94d4e8369 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/IssueNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/IssueNoteEventHandler.cs @@ -46,7 +46,7 @@ public class IssueNoteEventHandler var materialRequest = await _materialRequestManager.GetByNumberAsync(entity.RequestNumber).ConfigureAwait(false); - if (entity.RequestType != EnumMaterialRequestType.Direct_Issue.ToString()) + if (entity.RequestType != EnumMaterialRequestType.Issue_Direct.ToString()) { //更新叫料请求的已收数量 foreach (var materialRequestDetail in materialRequest.Details) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/RecycledMaterialReceiptNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/RecycledMaterialReceiptNoteEventHandler.cs index 4aae5fc63..cee202461 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/RecycledMaterialReceiptNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/RecycledMaterialReceiptNoteEventHandler.cs @@ -12,13 +12,18 @@ namespace Win_in.Sfs.Wms.Store.Event.Transactions; public class RecycledMaterialReceiptNoteEventHandler : StoreInventoryEventHandlerBase - , ILocalEventHandler> - , ILocalEventHandler>> + , ILocalEventHandler> + , ILocalEventHandler>> { private const EnumTransInOut TransInOut = EnumTransInOut.In; private const EnumTransType TransType = EnumTransType.UnplannedReceipt; private const EnumTransSubType TransSubType = EnumTransSubType.UnplannedReceipt_RecycledMaterialReceipt; + /// + /// 创建后 + /// + /// + /// [UnitOfWork] public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) { @@ -26,6 +31,20 @@ public class RecycledMaterialReceiptNoteEventHandler await AddTransactionsAsync(entity).ConfigureAwait(false); } + /// + /// 批量创建后 + /// + /// + /// + [UnitOfWork] + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) + { + var entities = eventData.Entity; + await AddTransactionsAsync(entities).ConfigureAwait(false); + } + + #region 私有 + private async Task AddTransactionsAsync(RecycledMaterialReceiptNote RecycledMaterialReceiptNote) { var inboundTransactions = new List(); @@ -33,19 +52,10 @@ public class RecycledMaterialReceiptNoteEventHandler inboundTransactions.AddRange(BuildTransactions(RecycledMaterialReceiptNote)); await TransactionAppService.AddManyAsync(inboundTransactions).ConfigureAwait(false); - - } - - [UnitOfWork] - public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) - { - var entities = eventData.Entity; - await AddTransactionsAsync(entities).ConfigureAwait(false); } private async Task AddTransactionsAsync(List RecycledMaterialReceiptNotes) { - var inboundTransactions = new List(); //如果要做库存事务汇总,可以修改此处 @@ -74,7 +84,9 @@ public class RecycledMaterialReceiptNoteEventHandler transactions.Add(transaction); } + return transactions; } + #endregion }