Browse Source

增加 中文提示

集成Redis
郑勃旭 2 years ago
parent
commit
2eeaff7238
  1. 50
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReturnRequests/PurchaseReturnRequestAppService.cs
  2. 12
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/SupplierAsns/SupplierAsnManager.cs
  3. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/MaterialRequestManager.cs
  4. 7
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Orders/PurchaseOrderEventHandler.cs
  5. 23
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ProductReceiptNoteEventHandler.cs

50
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReturnRequests/PurchaseReturnRequestAppService.cs

@ -99,6 +99,10 @@ public class PurchaseReturnRequestAppService :
var labelDto = await _inventoryLabelApp.GetByCodeAsync(detail.PackingCode).ConfigureAwait(false);
var balanceDto = await BalanceAclService.GetByPackingCodeAsync(detail.PackingCode).ConfigureAwait(false);
var locationDto= await _locationAppService.GetByCodeAsync(balanceDto.LocationCode).ConfigureAwait(false);
CheckLabel(labelDto, detail);
CheckBalance(balanceDto, detail);
CheckLocation(locationDto, balanceDto);
var purchaseOrderDto= await _purchaseOrderAppService.GetByNumberAsync(labelDto.PoNumber).ConfigureAwait(false);
purchaseOrderDto = await _purchaseOrderAppService.GetAsync(purchaseOrderDto.Id).ConfigureAwait(false);
@ -187,6 +191,52 @@ public class PurchaseReturnRequestAppService :
}
}
#region 校验
/// <summary>
/// 校验库位
/// </summary>
/// <param name="locationDto"></param>
/// <param name="balanceDto"></param>
/// <exception cref="UserFriendlyException"></exception>
private static void CheckLocation(LocationDTO locationDto, BalanceDTO balanceDto)
{
if (locationDto == null)
{
throw new UserFriendlyException($"库位为【{balanceDto.LocationCode}】不存在");
}
}
/// <summary>
/// 校验库存
/// </summary>
/// <param name="balanceDto"></param>
/// <param name="detail"></param>
/// <exception cref="UserFriendlyException"></exception>
private static void CheckBalance(BalanceDTO balanceDto, PurchaseReturnRequestDetail detail)
{
if (balanceDto == null)
{
throw new UserFriendlyException($"库存为【{detail.PackingCode}】不存在");
}
}
/// <summary>
/// 校验标签
/// </summary>
/// <param name="labelDto"></param>
/// <param name="detail"></param>
/// <exception cref="UserFriendlyException"></exception>
private static void CheckLabel(InventoryLabelDto labelDto, PurchaseReturnRequestDetail detail)
{
if (labelDto == null)
{
throw new UserFriendlyException($"标签为【{detail.PackingCode}】不存在");
}
}
#endregion
#endregion
#region 校验

12
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/SupplierAsns/SupplierAsnManager.cs

@ -1,7 +1,12 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Data;
using Volo.Abp.Uow;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Label.Application.Contracts;
using Win_in.Sfs.Label.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Domain;
@ -14,10 +19,14 @@ public class SupplierAsnManager : SfsStoreManagerBase<SupplierAsn, SupplierAsnDe
{
_repository = repository;
}
#region 东阳使用
#endregion
[UnitOfWork]
public override async Task<SupplierAsn> CreateAsync(SupplierAsn entity)
{
if (!string.IsNullOrWhiteSpace(entity.Number))//考虑 接口过来的数据是有Number的
if (!string.IsNullOrWhiteSpace(entity.Number))//接口过来的数据是有Number的
{
entity.SetIdAndNumberWithDetails(GuidGenerator, entity.Number);
entity = await Repository.InsertAsync(entity).ConfigureAwait(false);
@ -86,7 +95,6 @@ public class SupplierAsnManager : SfsStoreManagerBase<SupplierAsn, SupplierAsnDe
// await PublishSupplierAsnAsync(entity);
//}
}
private async Task SetDetailAsync(List<SupplierAsnDetail> details)
{
foreach (var detail in details)

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/MaterialRequestManager.cs

@ -85,7 +85,7 @@ public class MaterialRequestManager
var issueJobs = await _issueJobRepository.GetListAsync(t => t.MaterialRequestNumber == materialRequest.Number).ConfigureAwait(false);
if (issueJobs.Count > 0)
{
if (issueJobs.All(t => t.JobStatus == EnumJobStatus.Done || t.JobStatus == EnumJobStatus.Closed || t.JobStatus == EnumJobStatus.Cancelled))
if (issueJobs.All(t => t.JobStatus is EnumJobStatus.Done or EnumJobStatus.Closed or EnumJobStatus.Cancelled))
{
if (materialRequest.Details.All(p => p.ReceivedQty >= p.Qty))
{

7
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Orders/PurchaseOrderEventHandler.cs

@ -267,15 +267,18 @@ public class PurchaseOrderEventHandler
SupplierItemDTO supplierItemDto)
{
if (itemBasicDto == null)
{
throw new UserFriendlyException($"【{itemBasicDto.Code}】物品不存在");
}
if (supplierDto == null)
{
throw new UserFriendlyException($"{supplierAsn.SupplierCode}供应商为空");
throw new UserFriendlyException($"{supplierAsn.SupplierCode}供应商为空");
}
if (supplierItemDto == null)
{
throw new UserFriendlyException($"{supplierAsn.SupplierCode}供应商零件或{itemBasicDto.Code}零件信息为空");
throw new UserFriendlyException($"{supplierAsn.SupplierCode}供应商零件或{itemBasicDto.Code}零件信息为空");
}
var inputLabel = new InventoryLabelEditInput();

23
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ProductReceiptNoteEventHandler.cs

@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.EventBus;
using Volo.Abp.Uow;
using Win_in.Sfs.Basedata.Application.Contracts;
@ -76,15 +77,27 @@ public class ProductReceiptNoteEventHandler
var transaction = ObjectMapper.Map<ProductReceiptNoteDetail, TransactionEditInput>(detail);
var itemBasicDto= await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false);
;
var locationDtos = await _locationAppService.GetListByTypesAndErpCodeAsync(
new List<EnumLocationType> { EnumLocationType.WIP },
detail.LocationErpCode).ConfigureAwait(false);
if (locationDtos == null)
{
throw new UserFriendlyException(
$"Erp储位为【{detail.LocationErpCode}】,库位类型为{EnumLocationType.WIP.GetDisplayName()}的库位不存在。");
}
if (itemBasicDto == null)
{
throw new UserFriendlyException(
$"物品编号为【{detail.ItemCode}】不存在。");
}
detail.ItemDesc1 = itemBasicDto.Desc1;
detail.ItemDesc2 = itemBasicDto.Desc2;
detail.ItemName=itemBasicDto.Name;
detail.StdPackQty=itemBasicDto.StdPackQty;
var erpLocationDtos= await _locationAppService.GetListByTypesAndErpCodeAsync(new List<EnumLocationType> { EnumLocationType.WIP },
detail.LocationErpCode).ConfigureAwait(false);
var erpLocationDto = erpLocationDtos.First();
var erpLocationDto = locationDtos.First();
detail.LocationArea = erpLocationDto.Code;
detail.LocationGroup = erpLocationDto.LocationGroupCode;
detail.LocationErpCode= erpLocationDto.Code;

Loading…
Cancel
Save