This commit is contained in:
alex
2023-06-15 11:40:07 +08:00
parent d062102f39
commit 6675fd73b7
3 changed files with 8 additions and 13 deletions

View File

@@ -31,23 +31,16 @@ namespace Tnb.WarehouseMgr
var bizTypeId = serviceType.GetCustomAttribute<ServiceModuleAttribute>()?.BizTypeId;
if (!bizTypeId.IsNullOrEmpty())
{
_serviceMap[bizTypeId!] = (BaseWareHouseService)Activator.CreateInstance(serviceType)!;
_serviceMap[bizTypeId!] = (BaseWareHouseService)App.GetService(serviceType)!;
}
}
}
protected Task this[WareHouseUpInput input]
protected async Task DoUpdate(WareHouseUpInput input)
{
set
if (_serviceMap.ContainsKey(input.bizTypeId))
{
if (_serviceMap.ContainsKey(input.bizTypeId))
{
_serviceMap[input.bizTypeId].ModifyAsync(input);
}
}
get
{
return Task.CompletedTask;
await _serviceMap[input.bizTypeId].ModifyAsync(input);
}
}

View File

@@ -428,11 +428,11 @@ namespace Tnb.WarehouseMgr
var upInput = new WareHouseUpInput { bizTypeId = dt.biz_type, requireId = dt.require_id };
if (dt.is_chain == 0)
{
await base[upInput];
await DoUpdate(upInput);
}
else if (dt.is_chain == 1 && dt.chain_type == "3")
{
await base[upInput];
await DoUpdate(upInput);
}
}
}

View File

@@ -40,6 +40,8 @@ namespace Tnb.WarehouseMgr
private readonly IWareHouseService _wareHouseService;
private readonly IBillRullService _billRullService;
private readonly IUserManager _userManager;
public WmsCarryMoveInStockService(
ISqlSugarRepository<WmsCarryH> repository,
IRunService runService,