|
|
@@ -54,14 +54,15 @@ public class ProcurementPipelineService : IDynamicApiController, ITransient
|
|
|
[DisplayName("采购执行闭环")]
|
|
|
[HttpPost("procurement/execute-pipeline")]
|
|
|
public async Task<ProcurementPipelineResult> ExecutePipeline(
|
|
|
- [FromQuery] string? domain,
|
|
|
+ [FromQuery] long tenantId = 0,
|
|
|
[FromQuery] bool createFromShortage = true,
|
|
|
[FromQuery] bool mergeHistorical = true,
|
|
|
[FromQuery] bool enableExternalPush = true)
|
|
|
{
|
|
|
- var tenantId = ResolveTenantId(domain);
|
|
|
+ if (tenantId <= 0)
|
|
|
+ tenantId = AidopTenantHelper.Resolve(App.HttpContext);
|
|
|
var account = _userManager.Account ?? "system";
|
|
|
- var logId = await _runLog.StartAsync("S4_PROCUREMENT_PIPELINE", tenantId, "tenant", tenantId, domain ?? tenantId.ToString());
|
|
|
+ var logId = await _runLog.StartAsync("S4_PROCUREMENT_PIPELINE", tenantId, "tenant", tenantId, tenantId.ToString());
|
|
|
|
|
|
try
|
|
|
{
|
|
|
@@ -73,7 +74,7 @@ public class ProcurementPipelineService : IDynamicApiController, ITransient
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- await _runLog.FailedAsync(logId, ex.Message, new { tenantId, domain });
|
|
|
+ await _runLog.FailedAsync(logId, ex.Message, new { tenantId });
|
|
|
throw Oops.Oh(ex.Message);
|
|
|
}
|
|
|
}
|
|
|
@@ -81,9 +82,10 @@ public class ProcurementPipelineService : IDynamicApiController, ITransient
|
|
|
/// <summary>S4 读路径一致性检查(运行表 vs DWD)。</summary>
|
|
|
[DisplayName("S4读路径一致性检查")]
|
|
|
[HttpGet("procurement/read-path-consistency")]
|
|
|
- public async Task<S4ReadPathConsistencyResult> ReadPathConsistency([FromQuery] string? domain)
|
|
|
+ public async Task<S4ReadPathConsistencyResult> ReadPathConsistency([FromQuery] long tenantId = 0)
|
|
|
{
|
|
|
- var tenantId = ResolveTenantId(domain);
|
|
|
+ if (tenantId <= 0)
|
|
|
+ tenantId = AidopTenantHelper.Resolve(App.HttpContext);
|
|
|
return await _readPathCheck.CheckTenantAsync(tenantId);
|
|
|
}
|
|
|
|
|
|
@@ -365,13 +367,6 @@ public class ProcurementPipelineService : IDynamicApiController, ITransient
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private long ResolveTenantId(string? domain)
|
|
|
- {
|
|
|
- if (!string.IsNullOrWhiteSpace(domain) && long.TryParse(domain.Trim(), out var tid) && tid > 0)
|
|
|
- return tid;
|
|
|
- return AidopTenantHelper.Resolve(App.HttpContext);
|
|
|
- }
|
|
|
-
|
|
|
private async Task<List<string>> TryTriggerS4MdpRefreshAsync(ProcurementPipelineResult result)
|
|
|
{
|
|
|
var warnings = new List<string>();
|