Browse Source

修改 安徽库移 接口有数据 记录无数据问题

master
郑勃旭 5 months ago
parent
commit
299c6c2fe9
  1. BIN
      InterFaceContorl/Dy_Exchange/.vs/Dy_Exchange/FileContentIndex/6504a1ad-d5e9-4a09-8b41-a36867df4c91.vsidx
  2. BIN
      InterFaceContorl/Dy_Exchange/.vs/Dy_Exchange/FileContentIndex/7ae11430-69da-4cbb-a5d6-711683136f00.vsidx
  3. 2
      InterFaceContorl/Dy_Exchange/src/Dy_Exchange.HttpApi.Host/bin/Release/net7.0/publish/appsettings.Development.json
  4. 38
      InterFaceContorl/Dy_Exchange/src/Dy_Exchange.HttpApi.Host/bin/Release/net7.0/publish/appsettings.json
  5. 2
      InterFaceContorl/Dy_Exchange/src/Dy_Exchange.HttpApi.Host/bin/Release/net7.0/publish/appsettings.secrets.json
  6. 19
      InterFaceContorl/Dy_Exchange/src/Dy_Exchange.HttpApi.Host/bin/Release/net7.0/publish/web.config
  7. 11
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/TransferRequests/TransferRequestAppService.cs
  8. 23
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/TransferNoteEventHandler.cs
  9. 59
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/TransferNoteEventHandler.cs
  10. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Win_in.Sfs.Wms.Store.Event.csproj

BIN
InterFaceContorl/Dy_Exchange/.vs/Dy_Exchange/FileContentIndex/6504a1ad-d5e9-4a09-8b41-a36867df4c91.vsidx

Binary file not shown.

BIN
InterFaceContorl/Dy_Exchange/.vs/Dy_Exchange/FileContentIndex/7ae11430-69da-4cbb-a5d6-711683136f00.vsidx

Binary file not shown.

2
InterFaceContorl/Dy_Exchange/src/Dy_Exchange.HttpApi.Host/bin/Release/net7.0/publish/appsettings.Development.json

@ -0,0 +1,2 @@
{
}

38
InterFaceContorl/Dy_Exchange/src/Dy_Exchange.HttpApi.Host/bin/Release/net7.0/publish/appsettings.json

@ -0,0 +1,38 @@
{
"App": {
"CorsOrigins": "http://192.168.0.146:20033",
"Audit": {
"IsEnabled": false //
//
}
},
"ConnectionStrings": {
"Default": "Server=.;Database=Dy_FasterZ_Exchange;uid=sa;pwd=sasa;timeout=6000;Encrypt=False;",
"Dy_Exchange": "Server=dev.ccwin-in.com,13319;Database=WMS_DongYang_DataExchange_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=60000;Encrypt=False;"
},
"Redis": {
"Configuration": "127.0.0.1"
},
"AuthServer": {
"Authority": "http://192.168.1.75:60080",
"RequireHttpsMetadata": "false",
"SwaggerClientId": "Dy_Exchange_Swagger"
},
"StringEncryption": {
"DefaultPassPhrase": "ybgU8NieQZNjguXe"
},
"AlwaysAllowAuthorization": "true",
"urls": "http://192.168.1.75:60081",
"DataExchangeInterfaceOptions": {
"WmsCode": "WMS",
"CmdStartPath": "D:\\Proc_DyNevWms\\publish\\start.cmd",
"CmdClosePath1": "D:\\Proc_DyNevWms\\publish\\stop.cmd",
"CmdClosePath2": "D:\\Proc_DyNevWms\\publish\\TaskKill.exe",
"WmsUrl": "http://10.164.233.5:60085/swagger/AbpTenant/swagger.json"
}
}

2
InterFaceContorl/Dy_Exchange/src/Dy_Exchange.HttpApi.Host/bin/Release/net7.0/publish/appsettings.secrets.json

@ -0,0 +1,2 @@
{
}

19
InterFaceContorl/Dy_Exchange/src/Dy_Exchange.HttpApi.Host/bin/Release/net7.0/publish/web.config

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\Dy_Exchange.HttpApi.Host.dll" stdoutLogEnabled="false" stdoutLogFile=".\Logs\stdout" hostingModel="inprocess" />
</system.webServer>
</location>
<system.webServer>
<httpProtocol>
<customHeaders>
<remove name="x-powered-by" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
<!--ProjectGuid: E6D5BF0E-DE92-4D82-A352-EF04B37CB11C-->

11
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/TransferRequests/TransferRequestAppService.cs

@ -39,16 +39,18 @@ public class TransferRequestAppService : SfsStoreRequestAppServiceBase
private readonly ITransferRequestManager _transferRequestManager; private readonly ITransferRequestManager _transferRequestManager;
private readonly IBalanceAppService _balanceAppService; private readonly IBalanceAppService _balanceAppService;
private readonly ILocationAppService _locationAppService; private readonly ILocationAppService _locationAppService;
private readonly ITransactionTypeAppService _transactionTypeAppService;
public TransferRequestAppService( public TransferRequestAppService(
ITransferRequestRepository repository, ITransferRequestRepository repository,
ITransferRequestManager transferRequestManager, ITransferRequestManager transferRequestManager,
IBalanceAppService balanceAppService, IBalanceAppService balanceAppService,
ILocationAppService locationAppService) : base(repository, transferRequestManager) ILocationAppService locationAppService, ITransactionTypeAppService transactionTypeAppService) : base(repository, transferRequestManager)
{ {
_transferRequestManager = transferRequestManager; _transferRequestManager = transferRequestManager;
_balanceAppService = balanceAppService; _balanceAppService = balanceAppService;
_locationAppService = locationAppService; _locationAppService = locationAppService;
_transactionTypeAppService = transactionTypeAppService;
} }
#region 东阳使用 #region 东阳使用
@ -176,8 +178,11 @@ public class TransferRequestAppService : SfsStoreRequestAppServiceBase
private async Task SetEntityPropertiesAsync(TransferRequest entity, EnumTransSubType subType) private async Task SetEntityPropertiesAsync(TransferRequest entity, EnumTransSubType subType)
{ {
var tranType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Transfer, subType) //var tranType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Transfer, subType)
.ConfigureAwait(false); // .ConfigureAwait(false);
var tranType = await _transactionTypeAppService.GetByTransTypeAsync(EnumTransType.Transfer, subType).ConfigureAwait(false);
Check.NotNull(tranType, "事务类型", "事务类型不存在"); Check.NotNull(tranType, "事务类型", "事务类型不存在");
entity.Worker = CurrentUser.GetUserName(); entity.Worker = CurrentUser.GetUserName();

23
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/TransferNoteEventHandler.cs

@ -3,10 +3,12 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.EventBus; using Volo.Abp.EventBus;
using Volo.Abp.Uow; using Volo.Abp.Uow;
using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Event; using Win_in.Sfs.Shared.Event;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Inventory.Domain.Acl.Location; using Win_in.Sfs.Wms.Inventory.Domain.Acl.Location;
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;
@ -20,16 +22,30 @@ namespace Win_in.Sfs.Wms.Store.Event.DataExchanges
, ILocalEventHandler<SfsConfirmedEntityEventData<TransferNote>> , ILocalEventHandler<SfsConfirmedEntityEventData<TransferNote>>
{ {
private readonly Domain.Acl.Location.ILocationAclService _locationAclService; private readonly Domain.Acl.Location.ILocationAclService _locationAclService;
private readonly IBalanceAppService _balanceAppService;
public TransferNoteEventHandler(ILocationAclService locationAclService) public TransferNoteEventHandler(ILocationAclService locationAclService, IBalanceAppService balanceAppService)
{ {
_locationAclService = locationAclService; _locationAclService = locationAclService;
_balanceAppService = balanceAppService;
} }
[UnitOfWork] [UnitOfWork]
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<TransferNote> eventData) public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<TransferNote> eventData)
{ {
var entity = eventData.Entity; var entity = eventData.Entity;
foreach (var detail in entity.Details)
{
var balanceDto = await _balanceAppService.GetRealQtyByPackingCodeAndItemCodeAndLocationCodeAndStatusAsync(detail.FromPackingCode,
detail.ItemCode, detail.FromLocationCode, detail.FromStatus).ConfigureAwait(false);
if (balanceDto.Qty < detail.Qty&& balanceDto.Qty <= 0)
{
throw new UserFriendlyException($"{balanceDto.ItemCode}在库位{balanceDto.LocationCode}中库存不足");
}
}
switch (entity.Type) switch (entity.Type)
{ {
case "Transfer_Inside": case "Transfer_Inside":
@ -39,13 +55,8 @@ namespace Win_in.Sfs.Wms.Store.Event.DataExchanges
case "Transfer_Warehouse": case "Transfer_Warehouse":
case "Transfer_Customer": case "Transfer_Customer":
case "Transfer_WIP": case "Transfer_WIP":
// entity.Handle();
break; break;
} }
//await AddExchangeDataAsync(entity).ConfigureAwait(false);
} }
public async Task HandleEventAsync(SfsConfirmedEntityEventData<TransferNote> eventData) public async Task HandleEventAsync(SfsConfirmedEntityEventData<TransferNote> eventData)

59
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/TransferNoteEventHandler.cs

@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.EventBus; using Volo.Abp.EventBus;
using Volo.Abp.Uow; using Volo.Abp.Uow;
using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Basedata.Application.Contracts;
@ -22,11 +23,13 @@ public class TransferNoteEventHandler
private const EnumTransType TransType = EnumTransType.Transfer; private const EnumTransType TransType = EnumTransType.Transfer;
private readonly ILocationAppService _locationAppService; private readonly ILocationAppService _locationAppService;
private readonly ITransferLogAppService _transferLogAppService; private readonly ITransferLogAppService _transferLogAppService;
private readonly IBalanceAppService _balanceAppService;
public TransferNoteEventHandler(ITransferRequestAppService transferRequestApp, ILocationAppService locationAppService, ITransferLogAppService transferLogAppService) public TransferNoteEventHandler(ITransferRequestAppService transferRequestApp, ILocationAppService locationAppService, ITransferLogAppService transferLogAppService, IBalanceAppService balanceAppService)
{ {
_locationAppService = locationAppService; _locationAppService = locationAppService;
_transferLogAppService = transferLogAppService; _transferLogAppService = transferLogAppService;
_balanceAppService = balanceAppService;
} }
/// <summary> /// <summary>
@ -39,29 +42,24 @@ public class TransferNoteEventHandler
{ {
var entity = eventData.Entity; var entity = eventData.Entity;
foreach (var detail in entity.Details)
{
var balanceDto=await _balanceAppService.GetRealQtyByPackingCodeAndItemCodeAndLocationCodeAndStatusAsync(detail.FromPackingCode,
detail.ItemCode, detail.FromLocationCode, detail.FromStatus).ConfigureAwait(false);
if (balanceDto.Qty < detail.Qty)
{
throw new UserFriendlyException($"{balanceDto.ItemCode}在库位{balanceDto.LocationCode}中库存不足");
}
}
var route = entity.UseOnTheWayLocation var route = entity.UseOnTheWayLocation
? EnumTransferRoute.SourceToOnTheWay ? EnumTransferRoute.SourceToOnTheWay
: EnumTransferRoute.SourceToDestination; : EnumTransferRoute.SourceToDestination;
var inputList = await BuildTransferLogsAsync(entity, route).ConfigureAwait(false); var inputList = await BuildTransferLogsAsync(entity, route).ConfigureAwait(false);
//switch (entity.Type)
//{
// case "Transfer_Inside":
// case "Transfer_Area":
await AddTransferLogsAsync(inputList).ConfigureAwait(false); await AddTransferLogsAsync(inputList).ConfigureAwait(false);
// break;
// case "Transfer_Warehouse":
// case "Transfer_Customer":
// case "Transfer_WIP":
// // entity.Handle();
// break;
//}
} }
/// <summary> /// <summary>
@ -74,29 +72,26 @@ public class TransferNoteEventHandler
{ {
foreach (var entity in eventData.Entity) foreach (var entity in eventData.Entity)
{ {
foreach (var detail in entity.Details)
{
var balanceDto = await _balanceAppService.GetRealQtyByPackingCodeAndItemCodeAndLocationCodeAndStatusAsync(detail.FromPackingCode,
detail.ItemCode, detail.FromLocationCode, detail.FromStatus).ConfigureAwait(false);
if (balanceDto.Qty < detail.Qty&&balanceDto.Qty <= 0)
{
throw new UserFriendlyException($"{balanceDto.ItemCode}在库位{balanceDto.LocationCode}中库存不足");
}
}
var route = entity.UseOnTheWayLocation var route = entity.UseOnTheWayLocation
? EnumTransferRoute.SourceToOnTheWay ? EnumTransferRoute.SourceToOnTheWay
: EnumTransferRoute.SourceToDestination; : EnumTransferRoute.SourceToDestination;
var inputList = await BuildTransferLogsAsync(entity, route).ConfigureAwait(false); var inputList = await BuildTransferLogsAsync(entity, route).ConfigureAwait(false);
//switch (entity.Type)
//{
// case "Transfer_Inside":
// case "Transfer_Area":
await AddTransferLogsAsync(inputList).ConfigureAwait(false); await AddTransferLogsAsync(inputList).ConfigureAwait(false);
// break;
// case "Transfer_Warehouse":
// case "Transfer_Customer":
// case "Transfer_WIP":
// // entity.Handle();
// break;
//}
throw new UserFriendlyException("1");
} }
} }

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Win_in.Sfs.Wms.Store.Event.csproj

@ -16,6 +16,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="SQLitePCLRaw.core" Version="2.1.4" />
<PackageReference Include="Volo.Abp.Core" Version="5.3.5" /> <PackageReference Include="Volo.Abp.Core" Version="5.3.5" />
<PackageReference Include="Volo.Abp.EventBus" Version="5.3.5" /> <PackageReference Include="Volo.Abp.EventBus" Version="5.3.5" />
<PackageReference Include="Volo.Abp.Autofac" Version="5.3.5" /> <PackageReference Include="Volo.Abp.Autofac" Version="5.3.5" />

Loading…
Cancel
Save