调拨入库 备品备件

This commit is contained in:
2024-08-06 17:39:39 +08:00
parent 46c0b3c574
commit 18f052cefd
6 changed files with 279 additions and 19 deletions

View File

@@ -846,26 +846,66 @@ namespace Tnb.ProductionMgr
{
string result = "";
BasFactoryConfig config = await _repository.AsSugarClient().Queryable<BasFactoryConfig>().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.DOMAIN);
try
{
string response1 = HttpUtils.RequestGet($"{config.value}/api/production/time-work/sync-unit");
AuthResponse authResponse1 = JsonConvert.DeserializeObject<AuthResponse>(response1);
result += authResponse1.data.ToString();
}
catch (Exception e)
{
Log.Error(e.Message,e);
result += e.Message;
}
string response1 = HttpUtils.RequestGet($"{config.value}/api/production/time-work/sync-unit");
AuthResponse authResponse1 = JsonConvert.DeserializeObject<AuthResponse>(response1);
result += authResponse1.data.ToString();
try
{
string response2 = HttpUtils.RequestGet($"{config.value}/api/production/time-work/sync-material");
AuthResponse authResponse2 = JsonConvert.DeserializeObject<AuthResponse>(response2);
result += ","+authResponse2.data.ToString();
}
catch (Exception e)
{
Log.Error(e.Message,e);
result += e.Message;
}
string response2 = HttpUtils.RequestGet($"{config.value}/api/production/time-work/sync-material");
AuthResponse authResponse2 = JsonConvert.DeserializeObject<AuthResponse>(response2);
result += ","+authResponse2.data.ToString();
try
{
string response3 = HttpUtils.RequestGet($"{config.value}/api/production/time-work/sync-customer");
AuthResponse authResponse3 = JsonConvert.DeserializeObject<AuthResponse>(response3);
result += ","+authResponse3.data.ToString();
}
catch (Exception e)
{
Log.Error(e.Message,e);
result += e.Message;
}
string response3 = HttpUtils.RequestGet($"{config.value}/api/production/time-work/sync-customer");
AuthResponse authResponse3 = JsonConvert.DeserializeObject<AuthResponse>(response3);
result += ","+authResponse3.data.ToString();
try
{
string response4 = HttpUtils.RequestGet($"{config.value}/api/production/time-work/sync-supplier");
AuthResponse authResponse4 = JsonConvert.DeserializeObject<AuthResponse>(response4);
result += ","+authResponse4.data.ToString();
}
catch (Exception e)
{
Log.Error(e.Message,e);
result += e.Message;
}
string response4 = HttpUtils.RequestGet($"{config.value}/api/production/time-work/sync-supplier");
AuthResponse authResponse4 = JsonConvert.DeserializeObject<AuthResponse>(response4);
result += ","+authResponse4.data.ToString();
string response5 = HttpUtils.RequestGet($"{config.value}/api/production/time-work/sync-user");
AuthResponse authResponse5 = JsonConvert.DeserializeObject<AuthResponse>(response5);
result += ","+authResponse5.data.ToString();
try
{
string response5 = HttpUtils.RequestGet($"{config.value}/api/production/time-work/sync-user");
AuthResponse authResponse5 = JsonConvert.DeserializeObject<AuthResponse>(response5);
result += ","+authResponse5.data.ToString();
}
catch (Exception e)
{
Log.Error(e.Message,e);
result += e.Message;
}
Log.Information($"基础数据同步结果:{result}");
return result;