Browse Source

修改上架记录

集成Redis
郑勃旭 2 years ago
parent
commit
d8ad1a1869
  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. 20
      be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Transactions/TransactionAppService.cs
  7. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/PurchaseReceiptNotes/IPurchaseReceiptNoteAppService.cs
  8. 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 System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc;
@ -47,4 +49,21 @@ public class PurchaseReceiptNoteController : AbpController
{ {
return await _purchaseReceiptNoteAppService.GetDetailByItemAndPackingAsync(itemCode, packingCode).ConfigureAwait(false); 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 System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Volo.Abp.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": { //"RemoteServices": {
// "Default": { "BaseUrl": "http://dev.ccwin-in.com:21293/" }, // "Default": { "BaseUrl": "http://dev.ccwin-in.com:21293/" },
// "BaseData": { "BaseUrl": "http://dev.ccwin-in.com:21294/" }, // "BaseData": { "BaseUrl": "http://dev.ccwin-in.com:21294/" },
// "Store": { "BaseUrl": "http://dev.ccwin-in.com:21295/" }, "Store": { "BaseUrl": "http://localhost:59095/" },
// "Job": { "BaseUrl": "http://dev.ccwin-in.com:21295/" }, "Job": { "BaseUrl": "http://localhost:59095/" },
// "Inventory": { "BaseUrl": "http://dev.ccwin-in.com:21295/" }, "Inventory": { "BaseUrl": "http://localhost:59095/" }
// "FileStorage": { "BaseUrl": "http://dev.ccwin-in.com:21292/" }, // "FileStorage": { "BaseUrl": "http://dev.ccwin-in.com:21292/" },
// "Message": { "BaseUrl": "http://dev.ccwin-in.com:21292/" }, // "Message": { "BaseUrl": "http://dev.ccwin-in.com:21292/" },
// "Label": { "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> /// </summary>
Task UpdateItemBasicInfoAsync(BalanceUpdateItemBasicInfoDto balanceUpdateItemBasicInfoDto); 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; 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>
/// 根据发料任务需求,算出推荐的库存 (在获取时 已经添加预占用) /// 根据发料任务需求,算出推荐的库存 (在获取时 已经添加预占用)
/// </summary> /// </summary>

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

@ -133,22 +133,31 @@ public class TransactionAppService
public virtual async Task<List<ReportItemSerialDto>> GetItemSerialList(List<string> itemCodes,string erpLocationCode,DateTime startDateTime,DateTime endDateTime) public virtual async Task<List<ReportItemSerialDto>> GetItemSerialList(List<string> itemCodes,string erpLocationCode,DateTime startDateTime,DateTime endDateTime)
{ {
var itemSerialDtos = new List<ReportItemSerialDto>(); 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);
if (!itemCodes.Any()) if (!itemCodes.Any())
{ {
var itemBasicDtos_i= await _itemBasicAppService.GetAllListByFilterAsync(new SfsBaseDataRequestInputBase()).ConfigureAwait(false); var itemBasicDtos_i= await _itemBasicAppService.GetAllListByFilterAsync(new SfsBaseDataRequestInputBase()).ConfigureAwait(false);
var itemBasicDtos_t = await _repository.GetListAsync().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_i.Select(p => p.Code));
itemCodes.AddRange(itemBasicDtos_t.Select(p => p.ItemCode)); itemCodes.AddRange(itemBasicDtos_t.Select(p => p.ItemCode));
itemCodes=itemCodes.Distinct().ToList(); itemCodes=itemCodes.Distinct().ToList();
} }
foreach (var itemCode in itemCodes) foreach (var itemCode in itemCodes)
{ {
var itemSerialDto = new ReportItemSerialDto(); var itemSerialDto = new ReportItemSerialDto();
var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(itemCode).ConfigureAwait(false); var itemBasicDto = allItemBasicDtos.FirstOrDefault(p=>p.Code== itemCode);
if (itemBasicDto==null) if (itemBasicDto==null)
{ {
throw new UserFriendlyException($"物品代码{itemCode}不存在"); throw new UserFriendlyException($"物品代码{itemCode}不存在");
@ -161,13 +170,12 @@ public class TransactionAppService
itemSerialDto.ItemName = itemBasicDto.Name; 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)) if (!string.IsNullOrEmpty(erpLocationCode))
{ {
transactions = transactions.Where(p => p.LocationErpCode == erpLocationCode).ToList(); transactions = transactions.Where(p => p.LocationErpCode == erpLocationCode).ToList();
} }
var locationDtos=await _locationAppService.GetAllAsync().ConfigureAwait(false);
if (!string.IsNullOrEmpty(erpLocationCode)) if (!string.IsNullOrEmpty(erpLocationCode))
{ {
locationDtos = locationDtos.Where(p => p.ErpLocationCode == erpLocationCode).ToList(); locationDtos = locationDtos.Where(p => p.ErpLocationCode == erpLocationCode).ToList();
@ -219,10 +227,8 @@ public class TransactionAppService
decimal tempNowSum = 0; decimal tempNowSum = 0;
try try
{ {
var balanceDtos = await _balanceAppService var balanceDtosWithLocation = balanceDtos.Where(p =>p.ItemCode== itemCode && p.LocationCode == locationDto.Code);
.GetListByLocationCodeAndItemCodeAsync(locationDto.Code, itemSerialDto.ItemCode) tempNowSum = balanceDtosWithLocation.Sum(p => p.Qty);
.ConfigureAwait(false);
tempNowSum = balanceDtos.Sum(p => p.Qty);
} }
catch catch
{ {

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); string packingCode);
Task<List<PurchaseReceiptNoteDTO>> GetListByAsnNumbers(IEnumerable<string> asnNumbers); 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 System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Volo.Abp.ObjectMapping;
using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain;
@ -29,6 +30,14 @@ public class PurchaseReceiptNoteAppService :
_purchaseReceiptNoteManager = purchaseReceiptNoteManager; _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}")] [HttpPost("{id}/set-po-number/{poNumber}")]
public async Task SetPoNumber(string poNumber) public async Task SetPoNumber(string poNumber)
{ {

Loading…
Cancel
Save