From d8ad1a1869b101a08afa6033abf61cfc6ef23d2b Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Thu, 24 Aug 2023 11:13:36 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8A=E6=9E=B6?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Stores/PurchaseReceiptNoteController.cs | 19 ++++++++++++++++++ .../Stores/SupplierAsnController.cs | 1 + .../appsettings.Development.json | 6 +++--- .../Balances/IBalanceAppService.cs | 7 +++++++ .../Balances/BalanceAppService.cs | 14 +++++++++++++ .../Transactions/TransactionAppService.cs | 20 ++++++++++++------- .../IPurchaseReceiptNoteAppService.cs | 1 + .../PurchaseReceiptNoteAppService.cs | 9 +++++++++ 8 files changed, 67 insertions(+), 10 deletions(-) diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReceiptNoteController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReceiptNoteController.cs index cf0ecabc6..686f72267 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReceiptNoteController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReceiptNoteController.cs @@ -1,3 +1,5 @@ +using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc; @@ -47,4 +49,21 @@ public class PurchaseReceiptNoteController : AbpController { return await _purchaseReceiptNoteAppService.GetDetailByItemAndPackingAsync(itemCode, packingCode).ConfigureAwait(false); } + + /// + /// 获取收货记录下所有箱码 + /// + /// + [HttpPost("get-packing-by-purchase-recepit-note")] + public virtual async Task> GetPackingCodeByPurchaseRecepitNote(string poNumber) + { + var dtos = await _purchaseReceiptNoteAppService.GetListByPoNumberAsync(poNumber).ConfigureAwait(false); + var packingCodes=new List(); + foreach (var dto in dtos) + { + packingCodes.AddRange(dto.Details.Select(p=>p.PackingCode)); + } + + return packingCodes.Distinct().ToList(); + } } diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/SupplierAsnController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/SupplierAsnController.cs index f102b70ee..08e2711c0 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/SupplierAsnController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/SupplierAsnController.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc; diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/appsettings.Development.json b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/appsettings.Development.json index 10fb7993c..386a6d7ee 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/appsettings.Development.json +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/appsettings.Development.json @@ -2,9 +2,9 @@ //"RemoteServices": { // "Default": { "BaseUrl": "http://dev.ccwin-in.com:21293/" }, // "BaseData": { "BaseUrl": "http://dev.ccwin-in.com:21294/" }, - // "Store": { "BaseUrl": "http://dev.ccwin-in.com:21295/" }, - // "Job": { "BaseUrl": "http://dev.ccwin-in.com:21295/" }, - // "Inventory": { "BaseUrl": "http://dev.ccwin-in.com:21295/" }, + "Store": { "BaseUrl": "http://localhost:59095/" }, + "Job": { "BaseUrl": "http://localhost:59095/" }, + "Inventory": { "BaseUrl": "http://localhost:59095/" } // "FileStorage": { "BaseUrl": "http://dev.ccwin-in.com:21292/" }, // "Message": { "BaseUrl": "http://dev.ccwin-in.com:21292/" }, // "Label": { "BaseUrl": "http://dev.ccwin-in.com:21292/" }, diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/Balances/IBalanceAppService.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/Balances/IBalanceAppService.cs index cf79d0628..a9c62ad15 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/Balances/IBalanceAppService.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/Balances/IBalanceAppService.cs @@ -157,4 +157,11 @@ public interface IBalanceAppService /// Task UpdateItemBasicInfoAsync(BalanceUpdateItemBasicInfoDto balanceUpdateItemBasicInfoDto); + /// + /// 获取【库存】根据 库位代码 和 物品代码 + /// + /// + /// + /// + Task> GetListByErpLocationCodeAndItemCodeAsync(string erplocationCode, string itemCode); } diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs index 6a96bbdd2..4668b56a8 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs @@ -426,6 +426,20 @@ public class BalanceAppService return dtos; } + /// + /// 获取【库存】根据 库位代码 和 物品代码 + /// + /// + /// + /// + [HttpGet("list/by-erplocation-and-item")] + public virtual async Task> GetListByErpLocationCodeAndItemCodeAsync(string erplocationCode, string itemCode) + { + var entitys = await _repository.GetListAsync(p => p.LocationErpCode == erplocationCode && p.ItemCode == itemCode).ConfigureAwait(false); + var dtos = ObjectMapper.Map, List>(entitys); + return dtos; + } + /// /// 根据发料任务需求,算出推荐的库存 (在获取时 已经添加预占用) /// diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Transactions/TransactionAppService.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Transactions/TransactionAppService.cs index e54d7b221..b87c87bc3 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Transactions/TransactionAppService.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Transactions/TransactionAppService.cs @@ -133,22 +133,31 @@ public class TransactionAppService public virtual async Task> GetItemSerialList(List itemCodes,string erpLocationCode,DateTime startDateTime,DateTime endDateTime) { var itemSerialDtos = new List(); + var allItemBasicDtos = new List(); + var allTransactions = new List(); + var locationDtos = await _locationAppService.GetAllAsync().ConfigureAwait(false); + var balanceDtos = await _balanceAppService + .GetAllListByFilterAsync(new SfsInventoryRequestInputBase()).ConfigureAwait(false); if (!itemCodes.Any()) { var itemBasicDtos_i= await _itemBasicAppService.GetAllListByFilterAsync(new SfsBaseDataRequestInputBase()).ConfigureAwait(false); var itemBasicDtos_t = await _repository.GetListAsync().ConfigureAwait(false); + allItemBasicDtos = itemBasicDtos_i; + allTransactions = itemBasicDtos_t; + itemCodes.AddRange(itemBasicDtos_i.Select(p => p.Code)); itemCodes.AddRange(itemBasicDtos_t.Select(p => p.ItemCode)); itemCodes=itemCodes.Distinct().ToList(); + } foreach (var itemCode in itemCodes) { var itemSerialDto = new ReportItemSerialDto(); - var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(itemCode).ConfigureAwait(false); + var itemBasicDto = allItemBasicDtos.FirstOrDefault(p=>p.Code== itemCode); if (itemBasicDto==null) { throw new UserFriendlyException($"物品代码{itemCode}不存在"); @@ -161,13 +170,12 @@ public class TransactionAppService itemSerialDto.ItemName = itemBasicDto.Name; //所有这个零件的事务 - var transactions=await _repository.GetListAsync(p => p.ItemCode == itemCode).ConfigureAwait(false); + var transactions = allTransactions.Where(p => p.ItemCode == itemCode); if (!string.IsNullOrEmpty(erpLocationCode)) { transactions = transactions.Where(p => p.LocationErpCode == erpLocationCode).ToList(); } - var locationDtos=await _locationAppService.GetAllAsync().ConfigureAwait(false); if (!string.IsNullOrEmpty(erpLocationCode)) { locationDtos = locationDtos.Where(p => p.ErpLocationCode == erpLocationCode).ToList(); @@ -219,10 +227,8 @@ public class TransactionAppService decimal tempNowSum = 0; try { - var balanceDtos = await _balanceAppService - .GetListByLocationCodeAndItemCodeAsync(locationDto.Code, itemSerialDto.ItemCode) - .ConfigureAwait(false); - tempNowSum = balanceDtos.Sum(p => p.Qty); + var balanceDtosWithLocation = balanceDtos.Where(p =>p.ItemCode== itemCode && p.LocationCode == locationDto.Code); + tempNowSum = balanceDtosWithLocation.Sum(p => p.Qty); } catch { diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/PurchaseReceiptNotes/IPurchaseReceiptNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/PurchaseReceiptNotes/IPurchaseReceiptNoteAppService.cs index 1d9936c35..bc3f32af9 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/PurchaseReceiptNotes/IPurchaseReceiptNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/PurchaseReceiptNotes/IPurchaseReceiptNoteAppService.cs @@ -56,4 +56,5 @@ public interface IPurchaseReceiptNoteAppService : string packingCode); Task> GetListByAsnNumbers(IEnumerable asnNumbers); + Task> GetListByPoNumberAsync(string poNumber); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReceiptNotes/PurchaseReceiptNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReceiptNotes/PurchaseReceiptNoteAppService.cs index 282d1ec8e..ea0259e7a 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReceiptNotes/PurchaseReceiptNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReceiptNotes/PurchaseReceiptNoteAppService.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Volo.Abp.ObjectMapping; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; @@ -29,6 +30,14 @@ public class PurchaseReceiptNoteAppService : _purchaseReceiptNoteManager = purchaseReceiptNoteManager; } + [HttpPost("get-list-by-po/{poNumber}")] + public async Task> GetListByPoNumberAsync(string poNumber) + { + var entitys= await _repository.GetListAsync(p => p.PoNumber == poNumber,string.Empty,true).ConfigureAwait(false); + var dtos=ObjectMapper.Map,List< PurchaseReceiptNoteDTO>>(entitys); + return dtos; + } + [HttpPost("{id}/set-po-number/{poNumber}")] public async Task SetPoNumber(string poNumber) { From 2d1d7995d998cd46a3107d09a577701fb2159f79 Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Thu, 24 Aug 2023 17:17:24 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=A9=E5=93=81?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Transactions/TransactionAppService.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Transactions/TransactionAppService.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Transactions/TransactionAppService.cs index b87c87bc3..5189f32ca 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Transactions/TransactionAppService.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Transactions/TransactionAppService.cs @@ -138,12 +138,15 @@ public class TransactionAppService var locationDtos = await _locationAppService.GetAllAsync().ConfigureAwait(false); var balanceDtos = await _balanceAppService .GetAllListByFilterAsync(new SfsInventoryRequestInputBase()).ConfigureAwait(false); + + var itemBasicDtos_i = await _itemBasicAppService.GetAllListByFilterAsync(new SfsBaseDataRequestInputBase()).ConfigureAwait(false); + allItemBasicDtos = itemBasicDtos_i; + if (!itemCodes.Any()) { - var itemBasicDtos_i= await _itemBasicAppService.GetAllListByFilterAsync(new SfsBaseDataRequestInputBase()).ConfigureAwait(false); var itemBasicDtos_t = await _repository.GetListAsync().ConfigureAwait(false); - allItemBasicDtos = itemBasicDtos_i; + allTransactions = itemBasicDtos_t; itemCodes.AddRange(itemBasicDtos_i.Select(p => p.Code)); From d287f0d4082512ac5f3b8d2521338d40e0a997d7 Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Mon, 28 Aug 2023 11:39:11 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Transactions/TransactionAppService.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Transactions/TransactionAppService.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Transactions/TransactionAppService.cs index 5189f32ca..561f462db 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Transactions/TransactionAppService.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Transactions/TransactionAppService.cs @@ -145,8 +145,6 @@ public class TransactionAppService if (!itemCodes.Any()) { var itemBasicDtos_t = await _repository.GetListAsync().ConfigureAwait(false); - - allTransactions = itemBasicDtos_t; itemCodes.AddRange(itemBasicDtos_i.Select(p => p.Code)); @@ -155,6 +153,11 @@ public class TransactionAppService itemCodes=itemCodes.Distinct().ToList(); } + else + { + var itemBasicDtos_t = await _repository.GetListAsync(p=> itemCodes.Contains(p.ItemCode)).ConfigureAwait(false); + allTransactions = itemBasicDtos_t; + } foreach (var itemCode in itemCodes) { From 18aaf08866c360b208278f8d2a9fb192aead4565 Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Wed, 30 Aug 2023 15:22:09 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E6=80=A7=E8=83=BD=E5=B7=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ExportAndImport/ClosedXmlExportImportService.cs | 3 ++- be/Modules/Shared/src/Win_in.Sfs.Shared.Host/ModuleBase.cs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/ExportAndImport/ClosedXmlExportImportService.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/ExportAndImport/ClosedXmlExportImportService.cs index 91d1cb82c..316297788 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/ExportAndImport/ClosedXmlExportImportService.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/ExportAndImport/ClosedXmlExportImportService.cs @@ -61,7 +61,8 @@ public class ClosedXmlExportImportService : IExportImportService ignoreList.AddRange(defaultPropertyNames.Keys); } SetWorkSheet(ws, list, defaultPropertyNames, ignoreList, detailsProptyName); - SetWorkSheetStyle(ws); + //影响性能 + //SetWorkSheetStyle(ws); // var stream = new MemoryStream(); workbook.SaveAs(stream); diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Host/ModuleBase.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Host/ModuleBase.cs index 6d8f3e1f9..a1e0b142d 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Host/ModuleBase.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Host/ModuleBase.cs @@ -445,8 +445,8 @@ public abstract class ModuleBase : AbpModule where T : AbpModule { ServiceConfigurationContext.Services.Configure(options => { - options.ValueCountLimit = 5000; // 5000 items max - options.ValueLengthLimit = 1024 * 1024 * 100; // 100MB max len form data + options.ValueCountLimit = int.MaxValue; // 5000 items max + options.ValueLengthLimit = 1024 * 1024 * 1000; // 100MB max len form data }); }