|
@@ -100,7 +100,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
return Success(Map(posRes));
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 一星一地测向带参定位(无星历)
|
|
|
/// </summary>
|
|
@@ -126,21 +126,10 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
}
|
|
|
Serilog.Log.Information($"卫星{dto.MainCode}使用{xlInfo1.TwoLine}进行星历推算");
|
|
|
var settings = await db.SysSetings.FirstOrDefaultAsync();
|
|
|
- var client = new HttpClient();
|
|
|
- string url = string.Format("http://{0}:{1}/Api/", IpHelper.GetLocalIp(), settings.HttpPort);
|
|
|
- url += string.Format("Xl/Calc?tleStr={0}&dt={1}", xlInfo1.TwoLine, dto.SigTime);
|
|
|
- var response = await client.GetAsync(url);
|
|
|
- if (!response.IsSuccessStatusCode) // 处理响应失败
|
|
|
- {
|
|
|
- Serilog.Log.Error($"[{dto.MainCode}]星厉推算失败");
|
|
|
- return Error<PosResDto>($"[{dto.MainCode}]星厉推算失败");
|
|
|
- }
|
|
|
- var content = await response.Content.ReadAsStringAsync();
|
|
|
- var ephMain = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content).data;
|
|
|
-
|
|
|
- //string url = string.Format("http://{0}:{1}/Api/Xl/Calc", IpHelper.GetLocalIp(), settings.HttpPort);
|
|
|
- //var content = new StringContent(JsonConvert.SerializeObject(dto), System.Text.Encoding.UTF8, "application/json");
|
|
|
- //var dmcResult = HttpHelper.PostRequest<IEnumerable<DetectResDto>>(uploadUri, content);
|
|
|
+ var XlCalcDto = new XlCalcDto() { tleStr = xlInfo1.TwoLine, dt = dto.SigTime };
|
|
|
+ string url = string.Format("http://{0}:{1}/Api/Xl/Calc", IpHelper.GetLocalIp(), settings.HttpPort);
|
|
|
+ var content = new StringContent(JsonConvert.SerializeObject(XlCalcDto), System.Text.Encoding.UTF8, "application/json");
|
|
|
+ var ephMain = HttpHelper.PostRequest<SatEphDto>(url, content);
|
|
|
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
|
{
|
|
@@ -303,27 +292,16 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
Serilog.Log.Information($"卫星{dto.MainCode}使用{xlInfo1.TwoLine}进行星历推算");
|
|
|
Serilog.Log.Information($"卫星{dto.AdjaCode}使用{xlInfo2.TwoLine}进行星历推算");
|
|
|
var settings = await db.SysSetings.FirstOrDefaultAsync();
|
|
|
- var client = new HttpClient();
|
|
|
- string url = string.Format("http://{0}:{1}/Api/", IpHelper.GetLocalIp(), settings.HttpPort);
|
|
|
- var url1 = string.Format(url + "Xl/Calc?tleStr={0}&dt={1}", xlInfo1.TwoLine, dto.SigTime);
|
|
|
- var response = await client.GetAsync(url1);
|
|
|
- if (!response.IsSuccessStatusCode) // 处理响应失败
|
|
|
- {
|
|
|
- Serilog.Log.Error($"[{dto.MainCode}]星厉推算失败");
|
|
|
- return Error<PosResDto>($"[{dto.MainCode}]星厉推算失败");
|
|
|
- }
|
|
|
- var content = await response.Content.ReadAsStringAsync();
|
|
|
- var ephMain = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content).data;
|
|
|
|
|
|
- var url2 = string.Format(url + "Xl/Calc?tleStr={0}&dt={1}", xlInfo2.TwoLine, dto.SigTime);
|
|
|
- var response2 = await client.GetAsync(url2);
|
|
|
- if (!response2.IsSuccessStatusCode) // 处理响应失败
|
|
|
- {
|
|
|
- Serilog.Log.Error($"[{dto.AdjaCode}]星厉推算失败");
|
|
|
- return Error<PosResDto>($"[{dto.AdjaCode}]星厉推算失败");
|
|
|
- }
|
|
|
- var content2 = await response2.Content.ReadAsStringAsync();
|
|
|
- var ephAdja = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content2).data;
|
|
|
+ string url = string.Format("http://{0}:{1}/Api/Xl/Calc", IpHelper.GetLocalIp(), settings.HttpPort);
|
|
|
+
|
|
|
+ var XlCalcDto = new XlCalcDto() { tleStr = xlInfo1.TwoLine, dt = dto.SigTime };
|
|
|
+ var content = new StringContent(JsonConvert.SerializeObject(XlCalcDto), System.Text.Encoding.UTF8, "application/json");
|
|
|
+ var ephMain = HttpHelper.PostRequest<SatEphDto>(url, content);
|
|
|
+
|
|
|
+ var XlCalcDto2 = new XlCalcDto() { tleStr = xlInfo2.TwoLine, dt = dto.SigTime };
|
|
|
+ var content2 = new StringContent(JsonConvert.SerializeObject(XlCalcDto2), System.Text.Encoding.UTF8, "application/json");
|
|
|
+ var ephAdja = HttpHelper.PostRequest<SatEphDto>(url, content2);
|
|
|
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
|
{
|
|
@@ -414,8 +392,8 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
DfoCdb = dto.XdDfo,
|
|
|
SnrCdb = dto.XdSnr,
|
|
|
StationResID = StationRes.ID,
|
|
|
- MainCode= dto.MainCode,
|
|
|
- Adja1Code= dto.AdjaCode,
|
|
|
+ MainCode = dto.MainCode,
|
|
|
+ Adja1Code = dto.AdjaCode,
|
|
|
MainX = dto.MainX,
|
|
|
MainY = dto.MainY,
|
|
|
MainZ = dto.MainZ,
|
|
@@ -481,27 +459,16 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
Serilog.Log.Information($"卫星{dto.MainCode}使用{xlInfo1.TwoLine}进行星历推算");
|
|
|
Serilog.Log.Information($"卫星{dto.AdjaCode}使用{xlInfo2.TwoLine}进行星历推算");
|
|
|
var settings = await db.SysSetings.FirstOrDefaultAsync();
|
|
|
- var client = new HttpClient();
|
|
|
- string url = string.Format("http://{0}:{1}/Api/", IpHelper.GetLocalIp(), settings.HttpPort);
|
|
|
- var url1 = string.Format(url + "Xl/Calc?tleStr={0}&dt={1}", xlInfo1.TwoLine, dto.SigTime);
|
|
|
- var response = await client.GetAsync(url1);
|
|
|
- if (!response.IsSuccessStatusCode) // 处理响应失败
|
|
|
- {
|
|
|
- Serilog.Log.Error($"[{dto.MainCode}]星厉推算失败");
|
|
|
- return Error<PosResDto>($"[{dto.MainCode}]星厉推算失败");
|
|
|
- }
|
|
|
- var content = await response.Content.ReadAsStringAsync();
|
|
|
- var ephMain = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content).data;
|
|
|
|
|
|
- var url2 = string.Format(url + "Xl/Calc?tleStr={0}&dt={1}", xlInfo2.TwoLine, dto.SigTime);
|
|
|
- var response2 = await client.GetAsync(url2);
|
|
|
- if (!response2.IsSuccessStatusCode) // 处理响应失败
|
|
|
- {
|
|
|
- Serilog.Log.Error($"[{dto.AdjaCode}]星厉推算失败");
|
|
|
- return Error<PosResDto>($"[{dto.AdjaCode}]星厉推算失败");
|
|
|
- }
|
|
|
- var content2 = await response2.Content.ReadAsStringAsync();
|
|
|
- var ephAdja = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content2).data;
|
|
|
+ string url = string.Format("http://{0}:{1}/Api/Xl/Calc", IpHelper.GetLocalIp(), settings.HttpPort);
|
|
|
+
|
|
|
+ var XlCalcDto = new XlCalcDto() { tleStr = xlInfo1.TwoLine, dt = dto.SigTime };
|
|
|
+ var content = new StringContent(JsonConvert.SerializeObject(XlCalcDto), System.Text.Encoding.UTF8, "application/json");
|
|
|
+ var ephMain = HttpHelper.PostRequest<SatEphDto>(url, content);
|
|
|
+
|
|
|
+ var XlCalcDto2 = new XlCalcDto() { tleStr = xlInfo2.TwoLine, dt = dto.SigTime };
|
|
|
+ var content2 = new StringContent(JsonConvert.SerializeObject(XlCalcDto2), System.Text.Encoding.UTF8, "application/json");
|
|
|
+ var ephAdja = HttpHelper.PostRequest<SatEphDto>(url, content2);
|
|
|
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
|
{
|
|
@@ -521,8 +488,8 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
DfoCdb = dto.XdDfo,
|
|
|
SnrCdb = dto.XdSnr,
|
|
|
StationResID = StationRes.ID,
|
|
|
- MainCode=dto.MainCode,
|
|
|
- Adja1Code=dto.AdjaCode,
|
|
|
+ MainCode = dto.MainCode,
|
|
|
+ Adja1Code = dto.AdjaCode,
|
|
|
MainX = ephMain.X,
|
|
|
MainY = ephMain.Y,
|
|
|
MainZ = ephMain.Z,
|
|
@@ -670,27 +637,16 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
Serilog.Log.Information($"卫星{dto.MainCode}使用{xlInfo1.TwoLine}进行星历推算");
|
|
|
Serilog.Log.Information($"卫星{dto.AdjaCode}使用{xlInfo2.TwoLine}进行星历推算");
|
|
|
var settings = await db.SysSetings.FirstOrDefaultAsync();
|
|
|
- var client = new HttpClient();
|
|
|
- string url = string.Format("http://{0}:{1}/Api/", IpHelper.GetLocalIp(), settings.HttpPort);
|
|
|
- var url1 = string.Format(url + "Xl/Calc?tleStr={0}&dt={1}", xlInfo1.TwoLine, dto.SigTime);
|
|
|
- var response = await client.GetAsync(url1);
|
|
|
- if (!response.IsSuccessStatusCode) // 处理响应失败
|
|
|
- {
|
|
|
- Serilog.Log.Error($"[{dto.MainCode}]星厉推算失败");
|
|
|
- return Error<PosResDto>($"[{dto.MainCode}]星厉推算失败");
|
|
|
- }
|
|
|
- var content = await response.Content.ReadAsStringAsync();
|
|
|
- var ephMain = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content).data;
|
|
|
|
|
|
- var url2 = string.Format(url + "Xl/Calc?tleStr={0}&dt={1}", xlInfo2.TwoLine, dto.SigTime);
|
|
|
- var response2 = await client.GetAsync(url2);
|
|
|
- if (!response2.IsSuccessStatusCode) // 处理响应失败
|
|
|
- {
|
|
|
- Serilog.Log.Error($"[{dto.AdjaCode}]星厉推算失败");
|
|
|
- return Error<PosResDto>($"[{dto.AdjaCode}]星厉推算失败");
|
|
|
- }
|
|
|
- var content2 = await response2.Content.ReadAsStringAsync();
|
|
|
- var ephAdja = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content2).data;
|
|
|
+ string url = string.Format("http://{0}:{1}/Api/Xl/Calc", IpHelper.GetLocalIp(), settings.HttpPort);
|
|
|
+
|
|
|
+ var XlCalcDto = new XlCalcDto() { tleStr = xlInfo1.TwoLine, dt = dto.SigTime };
|
|
|
+ var content = new StringContent(JsonConvert.SerializeObject(XlCalcDto), System.Text.Encoding.UTF8, "application/json");
|
|
|
+ var ephMain = HttpHelper.PostRequest<SatEphDto>(url, content);
|
|
|
+
|
|
|
+ var XlCalcDto2 = new XlCalcDto() { tleStr = xlInfo2.TwoLine, dt = dto.SigTime };
|
|
|
+ var content2 = new StringContent(JsonConvert.SerializeObject(XlCalcDto2), System.Text.Encoding.UTF8, "application/json");
|
|
|
+ var ephAdja = HttpHelper.PostRequest<SatEphDto>(url, content2);
|
|
|
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
|
{
|
|
@@ -795,9 +751,9 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
YbAdja1Dto = dto.YbAdja1Dto,
|
|
|
YbAdja2Dto = dto.YbAdja2Dto,
|
|
|
StationResID = StationRes.ID,
|
|
|
- MainCode=dto.MainCode,
|
|
|
- Adja1Code=dto.Adja1Code,
|
|
|
- Adja2Code=dto.Adja2Code,
|
|
|
+ MainCode = dto.MainCode,
|
|
|
+ Adja1Code = dto.Adja1Code,
|
|
|
+ Adja2Code = dto.Adja2Code,
|
|
|
MainX = dto.MainX,
|
|
|
MainY = dto.MainY,
|
|
|
MainZ = dto.MainZ,
|
|
@@ -874,38 +830,20 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
Serilog.Log.Information($"卫星{dto.Adja1Code}使用{xlInfo2.TwoLine}进行星历推算");
|
|
|
Serilog.Log.Information($"卫星{dto.Adja2Code}使用{xlInfo3.TwoLine}进行星历推算");
|
|
|
var settings = await db.SysSetings.FirstOrDefaultAsync();
|
|
|
- var client = new HttpClient();
|
|
|
|
|
|
- string url = string.Format("http://{0}:{1}/Api/", IpHelper.GetLocalIp(), settings.HttpPort);
|
|
|
- var url1 = string.Format(url + "Xl/Calc?tleStr={0}&dt={1}", xlInfo1.TwoLine, dto.SigTime);
|
|
|
- var response = await client.GetAsync(url1);
|
|
|
- if (!response.IsSuccessStatusCode) // 处理响应失败
|
|
|
- {
|
|
|
- Serilog.Log.Error($"[{dto.MainCode}]星厉推算失败");
|
|
|
- return Error<PosResDto>($"[{dto.MainCode}]星厉推算失败");
|
|
|
- }
|
|
|
- var content = await response.Content.ReadAsStringAsync();
|
|
|
- var ephMain = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content).data;
|
|
|
+ string url = string.Format("http://{0}:{1}/Api/Xl/Calc", IpHelper.GetLocalIp(), settings.HttpPort);
|
|
|
|
|
|
- var url2 = string.Format(url + "Xl/Calc?tleStr={0}&dt={1}", xlInfo2.TwoLine, dto.SigTime);
|
|
|
- var response2 = await client.GetAsync(url2);
|
|
|
- if (!response2.IsSuccessStatusCode) // 处理响应失败
|
|
|
- {
|
|
|
- Serilog.Log.Error($"[{dto.Adja1Code}]星厉推算失败");
|
|
|
- return Error<PosResDto>($"[{dto.Adja1Code}]星厉推算失败");
|
|
|
- }
|
|
|
- var content2 = await response2.Content.ReadAsStringAsync();
|
|
|
- var ephAdja1 = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content2).data;
|
|
|
+ var XlCalcDto = new XlCalcDto() { tleStr = xlInfo1.TwoLine, dt = dto.SigTime };
|
|
|
+ var content = new StringContent(JsonConvert.SerializeObject(XlCalcDto), System.Text.Encoding.UTF8, "application/json");
|
|
|
+ var ephMain = HttpHelper.PostRequest<SatEphDto>(url, content);
|
|
|
|
|
|
- var url3 = string.Format(url + "Xl/Calc?tleStr={0}&dt={1}", xlInfo3.TwoLine, dto.SigTime);
|
|
|
- var response3 = await client.GetAsync(url3);
|
|
|
- if (!response3.IsSuccessStatusCode) // 处理响应失败
|
|
|
- {
|
|
|
- Serilog.Log.Error($"[{dto.Adja2Code}]星厉推算失败");
|
|
|
- return Error<PosResDto>($"[{dto.Adja2Code}]星厉推算失败");
|
|
|
- }
|
|
|
- var content3 = await response2.Content.ReadAsStringAsync();
|
|
|
- var ephAdja2 = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content3).data;
|
|
|
+ var XlCalcDto2 = new XlCalcDto() { tleStr = xlInfo2.TwoLine, dt = dto.SigTime };
|
|
|
+ var content2 = new StringContent(JsonConvert.SerializeObject(XlCalcDto2), System.Text.Encoding.UTF8, "application/json");
|
|
|
+ var ephAdja1 = HttpHelper.PostRequest<SatEphDto>(url, content2);
|
|
|
+
|
|
|
+ var XlCalcDto3 = new XlCalcDto() { tleStr = xlInfo3.TwoLine, dt = dto.SigTime };
|
|
|
+ var content3 = new StringContent(JsonConvert.SerializeObject(XlCalcDto3), System.Text.Encoding.UTF8, "application/json");
|
|
|
+ var ephAdja2 = HttpHelper.PostRequest<SatEphDto>(url, content3);
|
|
|
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
|
{
|
|
@@ -1076,38 +1014,20 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
Serilog.Log.Information($"卫星{dto.Adja1Code}使用{xlInfo2.TwoLine}进行星历推算");
|
|
|
Serilog.Log.Information($"卫星{dto.Adja2Code}使用{xlInfo3.TwoLine}进行星历推算");
|
|
|
var settings = await db.SysSetings.FirstOrDefaultAsync();
|
|
|
- var client = new HttpClient();
|
|
|
|
|
|
- string url = string.Format("http://{0}:{1}/Api/", IpHelper.GetLocalIp(), settings.HttpPort);
|
|
|
- var url1 = string.Format(url + "Xl/Calc?tleStr={0}&dt={1}", xlInfo1.TwoLine, dto.SigTime);
|
|
|
- var response = await client.GetAsync(url1);
|
|
|
- if (!response.IsSuccessStatusCode) // 处理响应失败
|
|
|
- {
|
|
|
- Serilog.Log.Error($"[{dto.MainCode}]星厉推算失败");
|
|
|
- return Error<PosResDto>($"[{dto.MainCode}]星厉推算失败");
|
|
|
- }
|
|
|
- var content = await response.Content.ReadAsStringAsync();
|
|
|
- var ephMain = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content).data;
|
|
|
+ string url = string.Format("http://{0}:{1}/Api/Xl/Calc", IpHelper.GetLocalIp(), settings.HttpPort);
|
|
|
|
|
|
- var url2 = string.Format(url + "Xl/Calc?tleStr={0}&dt={1}", xlInfo2.TwoLine, dto.SigTime);
|
|
|
- var response2 = await client.GetAsync(url2);
|
|
|
- if (!response2.IsSuccessStatusCode) // 处理响应失败
|
|
|
- {
|
|
|
- Serilog.Log.Error($"[{dto.Adja1Code}]星厉推算失败");
|
|
|
- return Error<PosResDto>($"[{dto.Adja1Code}]星厉推算失败");
|
|
|
- }
|
|
|
- var content2 = await response2.Content.ReadAsStringAsync();
|
|
|
- var ephAdja1 = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content2).data;
|
|
|
+ var XlCalcDto = new XlCalcDto() { tleStr = xlInfo1.TwoLine, dt = dto.SigTime };
|
|
|
+ var content = new StringContent(JsonConvert.SerializeObject(XlCalcDto), System.Text.Encoding.UTF8, "application/json");
|
|
|
+ var ephMain = HttpHelper.PostRequest<SatEphDto>(url, content);
|
|
|
|
|
|
- var url3 = string.Format(url + "Xl/Calc?tleStr={0}&dt={1}", xlInfo3.TwoLine, dto.SigTime);
|
|
|
- var response3 = await client.GetAsync(url3);
|
|
|
- if (!response3.IsSuccessStatusCode) // 处理响应失败
|
|
|
- {
|
|
|
- Serilog.Log.Error($"[{dto.Adja2Code}]星厉推算失败");
|
|
|
- return Error<PosResDto>($"[{dto.Adja2Code}]星厉推算失败");
|
|
|
- }
|
|
|
- var content3 = await response2.Content.ReadAsStringAsync();
|
|
|
- var ephAdja2 = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content3).data;
|
|
|
+ var XlCalcDto2 = new XlCalcDto() { tleStr = xlInfo2.TwoLine, dt = dto.SigTime };
|
|
|
+ var content2 = new StringContent(JsonConvert.SerializeObject(XlCalcDto2), System.Text.Encoding.UTF8, "application/json");
|
|
|
+ var ephAdja1 = HttpHelper.PostRequest<SatEphDto>(url, content2);
|
|
|
+
|
|
|
+ var XlCalcDto3 = new XlCalcDto() { tleStr = xlInfo3.TwoLine, dt = dto.SigTime };
|
|
|
+ var content3 = new StringContent(JsonConvert.SerializeObject(XlCalcDto3), System.Text.Encoding.UTF8, "application/json");
|
|
|
+ var ephAdja2 = HttpHelper.PostRequest<SatEphDto>(url, content3);
|
|
|
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
|
{
|
|
@@ -1293,38 +1213,21 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
Serilog.Log.Information($"卫星{dto.Adja1Code}使用{xlInfo2.TwoLine}进行星历推算");
|
|
|
Serilog.Log.Information($"卫星{dto.Adja2Code}使用{xlInfo3.TwoLine}进行星历推算");
|
|
|
var settings = await db.SysSetings.FirstOrDefaultAsync();
|
|
|
- var client = new HttpClient();
|
|
|
|
|
|
- string url = string.Format("http://{0}:{1}/Api/", IpHelper.GetLocalIp(), settings.HttpPort);
|
|
|
- var url1 = string.Format(url + "Xl/Calc?tleStr={0}&dt={1}", xlInfo1.TwoLine, dto.SigTime);
|
|
|
- var response = await client.GetAsync(url1);
|
|
|
- if (!response.IsSuccessStatusCode) // 处理响应失败
|
|
|
- {
|
|
|
- Serilog.Log.Error($"[{dto.MainCode}]星厉推算失败");
|
|
|
- return Error<PosResDto>($"[{dto.MainCode}]星厉推算失败");
|
|
|
- }
|
|
|
- var content = await response.Content.ReadAsStringAsync();
|
|
|
- var ephMain = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content).data;
|
|
|
+ string url = string.Format("http://{0}:{1}/Api/Xl/Calc", IpHelper.GetLocalIp(), settings.HttpPort);
|
|
|
|
|
|
- var url2 = string.Format(url + "Xl/Calc?tleStr={0}&dt={1}", xlInfo2.TwoLine, dto.SigTime);
|
|
|
- var response2 = await client.GetAsync(url2);
|
|
|
- if (!response2.IsSuccessStatusCode) // 处理响应失败
|
|
|
- {
|
|
|
- Serilog.Log.Error($"[{dto.Adja1Code}]星厉推算失败");
|
|
|
- return Error<PosResDto>($"[{dto.Adja1Code}]星厉推算失败");
|
|
|
- }
|
|
|
- var content2 = await response2.Content.ReadAsStringAsync();
|
|
|
- var ephAdja1 = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content2).data;
|
|
|
+ var XlCalcDto = new XlCalcDto() { tleStr = xlInfo1.TwoLine, dt = dto.SigTime };
|
|
|
+ var content = new StringContent(JsonConvert.SerializeObject(XlCalcDto), System.Text.Encoding.UTF8, "application/json");
|
|
|
+ var ephMain = HttpHelper.PostRequest<SatEphDto>(url, content);
|
|
|
+
|
|
|
+ var XlCalcDto2 = new XlCalcDto() { tleStr = xlInfo2.TwoLine, dt = dto.SigTime };
|
|
|
+ var content2 = new StringContent(JsonConvert.SerializeObject(XlCalcDto2), System.Text.Encoding.UTF8, "application/json");
|
|
|
+ var ephAdja1 = HttpHelper.PostRequest<SatEphDto>(url, content2);
|
|
|
+
|
|
|
+ var XlCalcDto3 = new XlCalcDto() { tleStr = xlInfo3.TwoLine, dt = dto.SigTime };
|
|
|
+ var content3 = new StringContent(JsonConvert.SerializeObject(XlCalcDto3), System.Text.Encoding.UTF8, "application/json");
|
|
|
+ var ephAdja2 = HttpHelper.PostRequest<SatEphDto>(url, content3);
|
|
|
|
|
|
- var url3 = string.Format(url + "Xl/Calc?tleStr={0}&dt={1}", xlInfo3.TwoLine, dto.SigTime);
|
|
|
- var response3 = await client.GetAsync(url3);
|
|
|
- if (!response3.IsSuccessStatusCode) // 处理响应失败
|
|
|
- {
|
|
|
- Serilog.Log.Error($"[{dto.Adja2Code}]星厉推算失败");
|
|
|
- return Error<PosResDto>($"[{dto.Adja2Code}]星厉推算失败");
|
|
|
- }
|
|
|
- var content3 = await response2.Content.ReadAsStringAsync();
|
|
|
- var ephAdja2 = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content3).data;
|
|
|
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
|
{
|
|
@@ -1510,28 +1413,16 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
Serilog.Log.Information($"卫星{dto.MainCode}使用{xlInfo1.TwoLine}进行星历推算");
|
|
|
Serilog.Log.Information($"卫星{dto.AdjaCode}使用{xlInfo2.TwoLine}进行星历推算");
|
|
|
var settings = await db.SysSetings.FirstOrDefaultAsync();
|
|
|
- var client = new HttpClient();
|
|
|
|
|
|
- string url = string.Format("http://{0}:{1}/Api/", IpHelper.GetLocalIp(), settings.HttpPort);
|
|
|
- var url1 = string.Format(url + "Xl/Calc?tleStr={0}&dt={1}", xlInfo1.TwoLine, dto.SigTime);
|
|
|
- var response = await client.GetAsync(url1);
|
|
|
- if (!response.IsSuccessStatusCode) // 处理响应失败
|
|
|
- {
|
|
|
- Serilog.Log.Error($"[{dto.MainCode}]星厉推算失败");
|
|
|
- return Error<PosResDto>($"[{dto.MainCode}]星厉推算失败");
|
|
|
- }
|
|
|
- var content = await response.Content.ReadAsStringAsync();
|
|
|
- var ephMain = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content).data;
|
|
|
+ string url = string.Format("http://{0}:{1}/Api/Xl/Calc", IpHelper.GetLocalIp(), settings.HttpPort);
|
|
|
|
|
|
- var url2 = string.Format(url + "Xl/Calc?tleStr={0}&dt={1}", xlInfo2.TwoLine, dto.SigTime);
|
|
|
- var response2 = await client.GetAsync(url2);
|
|
|
- if (!response2.IsSuccessStatusCode) // 处理响应失败
|
|
|
- {
|
|
|
- Serilog.Log.Error($"[{dto.AdjaCode}]星厉推算失败");
|
|
|
- return Error<PosResDto>($"[{dto.AdjaCode}]星厉推算失败");
|
|
|
- }
|
|
|
- var content2 = await response2.Content.ReadAsStringAsync();
|
|
|
- var ephAdja1 = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content2).data;
|
|
|
+ var XlCalcDto = new XlCalcDto() { tleStr = xlInfo1.TwoLine, dt = dto.SigTime };
|
|
|
+ var content = new StringContent(JsonConvert.SerializeObject(XlCalcDto), System.Text.Encoding.UTF8, "application/json");
|
|
|
+ var ephMain = HttpHelper.PostRequest<SatEphDto>(url, content);
|
|
|
+
|
|
|
+ var XlCalcDto2 = new XlCalcDto() { tleStr = xlInfo2.TwoLine, dt = dto.SigTime };
|
|
|
+ var content2 = new StringContent(JsonConvert.SerializeObject(XlCalcDto2), System.Text.Encoding.UTF8, "application/json");
|
|
|
+ var ephAdja = HttpHelper.PostRequest<SatEphDto>(url, content2);
|
|
|
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
|
{
|
|
@@ -1564,12 +1455,12 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
MainVx = ephMain.VX,
|
|
|
MainVy = ephMain.VY,
|
|
|
MainVz = ephMain.VZ,
|
|
|
- Adja1X = ephAdja1.X,
|
|
|
- Adja1Y = ephAdja1.Y,
|
|
|
- Adja1Z = ephAdja1.Z,
|
|
|
- Adja1Vx = ephAdja1.VX,
|
|
|
- Adja1Vy = ephAdja1.VY,
|
|
|
- Adja1Vz = ephAdja1.VZ,
|
|
|
+ Adja1X = ephAdja.X,
|
|
|
+ Adja1Y = ephAdja.Y,
|
|
|
+ Adja1Z = ephAdja.Z,
|
|
|
+ Adja1Vx = ephAdja.VX,
|
|
|
+ Adja1Vy = ephAdja.VY,
|
|
|
+ Adja1Vz = ephAdja.VZ,
|
|
|
});
|
|
|
|
|
|
var res = PosApi.X2_PosDtoDfo(cgRes, StationRes);
|