lvzb 2 years ago
parent
commit
6fa4705a1a
  1. 19
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReceiptNoteController.cs
  2. 1
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/SupplierAsnController.cs
  3. 6
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/appsettings.Development.json
  4. 7
      be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/Balances/IBalanceAppService.cs
  5. 14
      be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs
  6. 28
      be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Transactions/TransactionAppService.cs
  7. 3
      be/Modules/Shared/src/Win_in.Sfs.Shared.Application/ExportAndImport/ClosedXmlExportImportService.cs
  8. 4
      be/Modules/Shared/src/Win_in.Sfs.Shared.Host/ModuleBase.cs
  9. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/PurchaseReceiptNotes/IPurchaseReceiptNoteAppService.cs
  10. 9
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReceiptNotes/PurchaseReceiptNoteAppService.cs

19
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);
}
/// <summary>
/// 获取收货记录下所有箱码
/// </summary>
/// <returns></returns>
[HttpPost("get-packing-by-purchase-recepit-note")]
public virtual async Task<List<string>> GetPackingCodeByPurchaseRecepitNote(string poNumber)
{
var dtos = await _purchaseReceiptNoteAppService.GetListByPoNumberAsync(poNumber).ConfigureAwait(false);
var packingCodes=new List<string>();
foreach (var dto in dtos)
{
packingCodes.AddRange(dto.Details.Select(p=>p.PackingCode));
}
return packingCodes.Distinct().ToList();
}
}

1
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;

6
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/" },

7
be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/Balances/IBalanceAppService.cs

@ -157,4 +157,11 @@ public interface IBalanceAppService
/// </summary>
Task UpdateItemBasicInfoAsync(BalanceUpdateItemBasicInfoDto balanceUpdateItemBasicInfoDto);
/// <summary>
/// 获取【库存】根据 库位代码 和 物品代码
/// </summary>
/// <param name="erplocationCode"></param>
/// <param name="itemCode"></param>
/// <returns></returns>
Task<List<BalanceDTO>> GetListByErpLocationCodeAndItemCodeAsync(string erplocationCode, string itemCode);
}

14
be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs

@ -426,6 +426,20 @@ public class BalanceAppService
return dtos;
}
/// <summary>
/// 获取【库存】根据 库位代码 和 物品代码
/// </summary>
/// <param name="erplocationCode"></param>
/// <param name="itemCode"></param>
/// <returns></returns>
[HttpGet("list/by-erplocation-and-item")]
public virtual async Task<List<BalanceDTO>> GetListByErpLocationCodeAndItemCodeAsync(string erplocationCode, string itemCode)
{
var entitys = await _repository.GetListAsync(p => p.LocationErpCode == erplocationCode && p.ItemCode == itemCode).ConfigureAwait(false);
var dtos = ObjectMapper.Map<List<Balance>, List<BalanceDTO>>(entitys);
return dtos;
}
/// <summary>
/// 根据发料任务需求,算出推荐的库存 (在获取时 已经添加预占用)
/// </summary>

28
be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Transactions/TransactionAppService.cs

@ -133,22 +133,37 @@ public class TransactionAppService
public virtual async Task<List<ReportItemSerialDto>> GetItemSerialList(List<string> itemCodes,string erpLocationCode,DateTime startDateTime,DateTime endDateTime)
{
var itemSerialDtos = new List<ReportItemSerialDto>();
var allItemBasicDtos = new List<ItemBasicDTO>();
var allTransactions = new List<Transaction>();
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);
allTransactions = itemBasicDtos_t;
itemCodes.AddRange(itemBasicDtos_i.Select(p => p.Code));
itemCodes.AddRange(itemBasicDtos_t.Select(p => p.ItemCode));
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)
{
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 +176,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 +233,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
{

3
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);

4
be/Modules/Shared/src/Win_in.Sfs.Shared.Host/ModuleBase.cs

@ -445,8 +445,8 @@ public abstract class ModuleBase<T> : AbpModule where T : AbpModule
{
ServiceConfigurationContext.Services.Configure<FormOptions>(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
});
}

1
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<List<PurchaseReceiptNoteDTO>> GetListByAsnNumbers(IEnumerable<string> asnNumbers);
Task<List<PurchaseReceiptNoteDTO>> GetListByPoNumberAsync(string poNumber);
}

9
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<List<PurchaseReceiptNoteDTO>> GetListByPoNumberAsync(string poNumber)
{
var entitys= await _repository.GetListAsync(p => p.PoNumber == poNumber,string.Empty,true).ConfigureAwait(false);
var dtos=ObjectMapper.Map<List<PurchaseReceiptNote>,List< PurchaseReceiptNoteDTO>>(entitys);
return dtos;
}
[HttpPost("{id}/set-po-number/{poNumber}")]
public async Task SetPoNumber(string poNumber)
{

Loading…
Cancel
Save