From b8a7e9f6d8d3a9c7dd121dfbcaba3362dbbd009a Mon Sep 17 00:00:00 2001 From: Zheng Date: Sat, 5 Apr 2025 11:10:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E6=B3=A8=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DeliverRequests/IDeliverRequestAppService.cs | 2 ++ .../DeliverRequests/DeliverRequestAppService.cs | 15 ++++++++------- ...xchangeDataDbContextModelCreatingExtensions.cs | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/DeliverRequests/IDeliverRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/DeliverRequests/IDeliverRequestAppService.cs index f8e19f5f7..ce3e834ee 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/DeliverRequests/IDeliverRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/DeliverRequests/IDeliverRequestAppService.cs @@ -4,6 +4,8 @@ using System.Threading.Tasks; namespace Win_in.Sfs.Wms.Store.Application.Contracts; +using Volo.Abp; + public interface IDeliverRequestAppService : ISfsStoreRequestMasterAppServiceBase diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs index a0ca26d34..861e1218f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs @@ -26,6 +26,9 @@ using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain.Shared; namespace Win_in.Sfs.Wms.Store.Application; + +using Microsoft.AspNetCore.Http.Metadata; + [Authorize] [Route($"{StoreConsts.RootPath}deliver-request")] @@ -40,7 +43,8 @@ public class DeliverRequestAppService : private readonly ICustomerAddressAppService _customerAddressApp; private readonly IItemBasicAppService _itemBasicAppService; private readonly ICustomerItemAppService _customerItemAppService; - private readonly ISalePriceSheetRepository _salePriceSheetRepository; + + private readonly ISalePriceSheetAppService _salePriceSheetAppService; public DeliverRequestAppService( IDeliverRequestRepository repository @@ -50,13 +54,11 @@ public class DeliverRequestAppService : , ICustomerAddressAppService customerAddressApp , IItemBasicAppService itemBasicAppService, ICustomerItemAppService customerItemAppService, - - ISalePriceSheetRepository salePriceSheetRepository - - ) + ISalePriceSheetAppService salePriceSheetAppService) : base(repository, deliverRequestManager) { _customerItemAppService = customerItemAppService; + _salePriceSheetAppService = salePriceSheetAppService; _deliverRequestManager = deliverRequestManager; _areaApp = areaApp; @@ -64,7 +66,6 @@ public class DeliverRequestAppService : _customerAddressApp = customerAddressApp; _itemBasicAppService = itemBasicAppService; _customerItemAppService = customerItemAppService; - _salePriceSheetRepository = salePriceSheetRepository; } protected override async Task> ImportProcessingEntityAsync(Dictionary dictionary) @@ -139,7 +140,7 @@ public class DeliverRequestAppService : { foreach (var itm in request.Details) { - var price = await _salePriceSheetRepository.FindAsync(p => p.ItemCode == itm.ItemCode && p.CustomerCode == request.CustomerCode).ConfigureAwait(false); + var price = await _salePriceSheetAppService.GetByItemCodeAndCustomerCode(itm.ItemCode,request.CustomerCode).ConfigureAwait(false); if (price == null) { errors.Add($"请求单号:{request.Number}零件编号:{itm.ItemCode}客户编号:{request.CustomerCode}"); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/ExchangeData/ExchangeDataDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/ExchangeData/ExchangeDataDbContextModelCreatingExtensions.cs index 0a6a424dc..03f75156a 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/ExchangeData/ExchangeDataDbContextModelCreatingExtensions.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/ExchangeData/ExchangeDataDbContextModelCreatingExtensions.cs @@ -30,7 +30,7 @@ public static class ExchangeDataDbContextModelCreatingExtensions b.Property(p => p.ReadTime); b.Property(p => p.ErrorCode).IsRequired().HasMaxLength(SfsPropertyConst.NameLength).HasConversion(); b.Property(p => p.ErrorMessage).HasMaxLength(SfsPropertyConst.RemarkLength); - //b.Property(p => p.TyrpNumber).IsRequired().HasDefaultValueSql(); + b.Property(p => p.TyrpNumber).IsRequired().HasDefaultValueSql(); //b.Property(p => p.TyrpNumber).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength); //Relations