Browse Source

修改 注入

交付给东阳的源代码
Zheng 4 weeks ago
parent
commit
b8a7e9f6d8
  1. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/DeliverRequests/IDeliverRequestAppService.cs
  2. 15
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs
  3. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/ExchangeData/ExchangeDataDbContextModelCreatingExtensions.cs

2
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; namespace Win_in.Sfs.Wms.Store.Application.Contracts;
using Volo.Abp;
public interface IDeliverRequestAppService public interface IDeliverRequestAppService
: ISfsStoreRequestMasterAppServiceBase : ISfsStoreRequestMasterAppServiceBase

15
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; using Win_in.Sfs.Wms.Store.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Application; namespace Win_in.Sfs.Wms.Store.Application;
using Microsoft.AspNetCore.Http.Metadata;
[Authorize] [Authorize]
[Route($"{StoreConsts.RootPath}deliver-request")] [Route($"{StoreConsts.RootPath}deliver-request")]
@ -40,7 +43,8 @@ public class DeliverRequestAppService :
private readonly ICustomerAddressAppService _customerAddressApp; private readonly ICustomerAddressAppService _customerAddressApp;
private readonly IItemBasicAppService _itemBasicAppService; private readonly IItemBasicAppService _itemBasicAppService;
private readonly ICustomerItemAppService _customerItemAppService; private readonly ICustomerItemAppService _customerItemAppService;
private readonly ISalePriceSheetRepository _salePriceSheetRepository;
private readonly ISalePriceSheetAppService _salePriceSheetAppService;
public DeliverRequestAppService( public DeliverRequestAppService(
IDeliverRequestRepository repository IDeliverRequestRepository repository
@ -50,13 +54,11 @@ public class DeliverRequestAppService :
, ICustomerAddressAppService customerAddressApp , ICustomerAddressAppService customerAddressApp
, IItemBasicAppService itemBasicAppService, , IItemBasicAppService itemBasicAppService,
ICustomerItemAppService customerItemAppService, ICustomerItemAppService customerItemAppService,
ISalePriceSheetAppService salePriceSheetAppService)
ISalePriceSheetRepository salePriceSheetRepository
)
: base(repository, deliverRequestManager) : base(repository, deliverRequestManager)
{ {
_customerItemAppService = customerItemAppService; _customerItemAppService = customerItemAppService;
_salePriceSheetAppService = salePriceSheetAppService;
_deliverRequestManager = deliverRequestManager; _deliverRequestManager = deliverRequestManager;
_areaApp = areaApp; _areaApp = areaApp;
@ -64,7 +66,6 @@ public class DeliverRequestAppService :
_customerAddressApp = customerAddressApp; _customerAddressApp = customerAddressApp;
_itemBasicAppService = itemBasicAppService; _itemBasicAppService = itemBasicAppService;
_customerItemAppService = customerItemAppService; _customerItemAppService = customerItemAppService;
_salePriceSheetRepository = salePriceSheetRepository;
} }
protected override async Task<Dictionary<DeliverRequest, EntityState>> ImportProcessingEntityAsync(Dictionary<DeliverRequest, EntityState> dictionary) protected override async Task<Dictionary<DeliverRequest, EntityState>> ImportProcessingEntityAsync(Dictionary<DeliverRequest, EntityState> dictionary)
@ -139,7 +140,7 @@ public class DeliverRequestAppService :
{ {
foreach (var itm in request.Details) 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) if (price == null)
{ {
errors.Add($"请求单号:{request.Number}零件编号:{itm.ItemCode}客户编号:{request.CustomerCode}"); errors.Add($"请求单号:{request.Number}零件编号:{itm.ItemCode}客户编号:{request.CustomerCode}");

2
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.ReadTime);
b.Property(p => p.ErrorCode).IsRequired().HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>(); b.Property(p => p.ErrorCode).IsRequired().HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
b.Property(p => p.ErrorMessage).HasMaxLength(SfsPropertyConst.RemarkLength); 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); //b.Property(p => p.TyrpNumber).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength);
//Relations //Relations

Loading…
Cancel
Save