|
@@ -35,7 +35,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
/// <param name="dto">定位参数</param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
- public async Task<AjaxResult<PosRes>> PosX1D1Async(X1D1PosDto dto)
|
|
|
+ public async Task<AjaxResult<PosResDto>> PosX1D1Async(X1D1PosDto dto)
|
|
|
{
|
|
|
using (RHDWContext db = new RHDWContext())
|
|
|
{
|
|
@@ -43,7 +43,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (runTask == null)
|
|
|
{
|
|
|
Serilog.Log.Warning($"接收到一星一地测向带参定位(含星历)参数,由于任务没有运行中忽略本次定位!");
|
|
|
- return Error<PosRes>($"多模式融合定位平台没有启动一星一地测向定位任务");
|
|
|
+ return Error<PosResDto>($"多模式融合定位平台没有启动一星一地测向定位任务");
|
|
|
}
|
|
|
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
@@ -91,20 +91,35 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
PosLat = res[1],
|
|
|
MirrLon = res[3],
|
|
|
MirrLat = res[4],
|
|
|
+ PosResType = EnumPosResType.X1D1CX,
|
|
|
};
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(posRes);
|
|
|
+ return Success(Map(posRes));
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ private PosResDto Map(PosRes res)
|
|
|
+ {
|
|
|
+ return new PosResDto()
|
|
|
+ {
|
|
|
+ ID = res.ID,
|
|
|
+ SigTime = res.SigTime,
|
|
|
+ TaskInfoID = res.TaskInfoID,
|
|
|
+ TarName = string.IsNullOrWhiteSpace(res.TarName) ? "未知目标" : res.TarName,
|
|
|
+ PosLon = res.PosLon,
|
|
|
+ PosLat = res.PosLat,
|
|
|
+ MirrLon = res.MirrLon,
|
|
|
+ MirrLat = res.MirrLat,
|
|
|
+ PosResType = (EnumPosResTypeDto)((int)res.PosResType)
|
|
|
+ };
|
|
|
+ }
|
|
|
/// <summary>
|
|
|
/// 一星一地测向带参定位(无星历)
|
|
|
/// </summary>
|
|
|
/// <returns>返回定位结果ID</returns>
|
|
|
[HttpPost]
|
|
|
- public async Task<AjaxResult<PosRes>> PosX1D1NoXlAsync(X1D1NoXlPosDto dto)
|
|
|
+ public async Task<AjaxResult<PosResDto>> PosX1D1NoXlAsync(X1D1NoXlPosDto dto)
|
|
|
{
|
|
|
using (RHDWContext db = new RHDWContext())
|
|
|
{
|
|
@@ -112,7 +127,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (runTask == null)
|
|
|
{
|
|
|
Serilog.Log.Warning($"接收到一星一地带参定位(无星历)参数,由于任务没有运行中忽略本次定位!");
|
|
|
- return Error<PosRes>($"多模式融合定位平台没有启动一星一地定位任务");
|
|
|
+ return Error<PosResDto>($"多模式融合定位平台没有启动一星一地定位任务");
|
|
|
}
|
|
|
var parameter1 = new SQLiteParameter("@sigTime", dto.SigTime);
|
|
|
var parameter2 = new SQLiteParameter("@satcode", dto.MainSatID);
|
|
@@ -120,7 +135,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (xlInfo1 == null)
|
|
|
{
|
|
|
Serilog.Log.Error($"未找到卫星[{dto.MainSatID}]的双行根数星历");
|
|
|
- return Error<PosRes>($"未找到卫星[{dto.MainSatID}]的双行根数星历");
|
|
|
+ return Error<PosResDto>($"未找到卫星[{dto.MainSatID}]的双行根数星历");
|
|
|
}
|
|
|
Serilog.Log.Information($"卫星{dto.MainSatID}使用{xlInfo1.TwoLine}进行星历推算");
|
|
|
var settings = await db.SysSetings.FirstOrDefaultAsync();
|
|
@@ -131,7 +146,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (!response.IsSuccessStatusCode) // 处理响应失败
|
|
|
{
|
|
|
Serilog.Log.Error($"[{dto.MainSatID}]星厉推算失败");
|
|
|
- return Error<PosRes>($"[{dto.MainSatID}]星厉推算失败");
|
|
|
+ return Error<PosResDto>($"[{dto.MainSatID}]星厉推算失败");
|
|
|
}
|
|
|
var content = await response.Content.ReadAsStringAsync();
|
|
|
var ephMain = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content).data;
|
|
@@ -180,11 +195,12 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
PosLat = res[1],
|
|
|
MirrLon = res[3],
|
|
|
MirrLat = res[4],
|
|
|
+ PosResType = EnumPosResType.X1D1CX,
|
|
|
};
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(posRes);
|
|
|
+ return Success(Map(posRes));
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
@@ -196,7 +212,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
/// <param name="dto">定位参数</param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
- public async Task<AjaxResult<PosRes>> PosX2D1Async(X2D1PosDto dto)
|
|
|
+ public async Task<AjaxResult<PosResDto>> PosX2D1Async(X2D1PosDto dto)
|
|
|
{
|
|
|
using (RHDWContext db = new RHDWContext())
|
|
|
{
|
|
@@ -204,7 +220,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (runTask == null)
|
|
|
{
|
|
|
Serilog.Log.Warning($"接收到两星一地带参定位(含星历)参数,由于任务没有运行中忽略本次定位!");
|
|
|
- return Error<PosRes>($"多模式融合定位平台没有启动两星一地定位任务");
|
|
|
+ return Error<PosResDto>($"多模式融合定位平台没有启动两星一地定位任务");
|
|
|
}
|
|
|
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
@@ -250,11 +266,12 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
PosLat = res[1],
|
|
|
MirrLon = res[3],
|
|
|
MirrLat = res[4],
|
|
|
+ PosResType = EnumPosResType.X2D1,
|
|
|
};
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(posRes);
|
|
|
+ return Success(Map(posRes));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -263,7 +280,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
/// </summary>
|
|
|
/// <returns>返回定位结果ID</returns>
|
|
|
[HttpPost]
|
|
|
- public async Task<AjaxResult<PosRes>> PosX2D1NoXlAsync(X2D1NoXlPosDto dto)
|
|
|
+ public async Task<AjaxResult<PosResDto>> PosX2D1NoXlAsync(X2D1NoXlPosDto dto)
|
|
|
{
|
|
|
using (RHDWContext db = new RHDWContext())
|
|
|
{
|
|
@@ -271,7 +288,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (runTask == null)
|
|
|
{
|
|
|
Serilog.Log.Warning($"接收到两星一地带参定位(无星历)参数,由于任务没有运行中忽略本次定位!");
|
|
|
- return Error<PosRes>($"多模式融合定位平台没有启动两星一地定位任务");
|
|
|
+ return Error<PosResDto>($"多模式融合定位平台没有启动两星一地定位任务");
|
|
|
}
|
|
|
var parameter1 = new SQLiteParameter("@sigTime", dto.SigTime);
|
|
|
var parameter2 = new SQLiteParameter("@satcode", dto.MainSatID);
|
|
@@ -280,14 +297,14 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (xlInfo1 == null)
|
|
|
{
|
|
|
Serilog.Log.Error($"未找到卫星[{dto.MainSatID}]的双行根数星历");
|
|
|
- return Error<PosRes>($"未找到卫星[{dto.MainSatID}]的双行根数星历");
|
|
|
+ return Error<PosResDto>($"未找到卫星[{dto.MainSatID}]的双行根数星历");
|
|
|
}
|
|
|
|
|
|
var xlInfo2 = await db.XlInfos.SqlQuery("select * from XlInfo where ABS(JULIANDAY(TimeBJ)-JULIANDAY(@sigTime))=(select min(ABS(JULIANDAY(TimeBJ)-JULIANDAY(@sigTime))) from XlInfo where satcode=@satcode)", parameter1, parameter3).FirstOrDefaultAsync();
|
|
|
if (xlInfo2 == null)
|
|
|
{
|
|
|
Serilog.Log.Error($"未找到卫星[{dto.AdjaSatID}]的双行根数星历");
|
|
|
- return Error<PosRes>($"未找到卫星[{dto.AdjaSatID}]的双行根数星历");
|
|
|
+ return Error<PosResDto>($"未找到卫星[{dto.AdjaSatID}]的双行根数星历");
|
|
|
}
|
|
|
Serilog.Log.Information($"卫星{dto.MainSatID}使用{xlInfo1.TwoLine}进行星历推算");
|
|
|
Serilog.Log.Information($"卫星{dto.AdjaSatID}使用{xlInfo2.TwoLine}进行星历推算");
|
|
@@ -299,7 +316,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (!response.IsSuccessStatusCode) // 处理响应失败
|
|
|
{
|
|
|
Serilog.Log.Error($"[{dto.MainSatID}]星厉推算失败");
|
|
|
- return Error<PosRes>($"[{dto.MainSatID}]星厉推算失败");
|
|
|
+ return Error<PosResDto>($"[{dto.MainSatID}]星厉推算失败");
|
|
|
}
|
|
|
var content = await response.Content.ReadAsStringAsync();
|
|
|
var ephMain = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content).data;
|
|
@@ -309,7 +326,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (!response2.IsSuccessStatusCode) // 处理响应失败
|
|
|
{
|
|
|
Serilog.Log.Error($"[{dto.AdjaSatID}]星厉推算失败");
|
|
|
- return Error<PosRes>($"[{dto.AdjaSatID}]星厉推算失败");
|
|
|
+ return Error<PosResDto>($"[{dto.AdjaSatID}]星厉推算失败");
|
|
|
}
|
|
|
var content2 = await response2.Content.ReadAsStringAsync();
|
|
|
var ephAdja = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content2).data;
|
|
@@ -357,11 +374,12 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
PosLat = res[1],
|
|
|
MirrLon = res[3],
|
|
|
MirrLat = res[4],
|
|
|
+ PosResType = EnumPosResType.X2D1,
|
|
|
};
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(posRes);
|
|
|
+ return Success(Map(posRes));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -371,7 +389,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
/// <param name="dto">定位参数</param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
- public async Task<AjaxResult<PosRes>> PosX2D1NoParAsync(X2D1NoParPosDto dto)
|
|
|
+ public async Task<AjaxResult<PosResDto>> PosX2D1NoParAsync(X2D1NoParPosDto dto)
|
|
|
{
|
|
|
using (RHDWContext db = new RHDWContext())
|
|
|
{
|
|
@@ -379,7 +397,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (runTask == null)
|
|
|
{
|
|
|
Serilog.Log.Warning($"接收到两星一地无参定位(含星历)参数,由于任务没有运行中忽略本次定位!");
|
|
|
- return Error<PosRes>($"多模式融合定位平台没有启动两星一地定位任务");
|
|
|
+ return Error<PosResDto>($"多模式融合定位平台没有启动两星一地定位任务");
|
|
|
}
|
|
|
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
@@ -421,12 +439,13 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
PosLat = res[1],
|
|
|
MirrLon = res[3],
|
|
|
MirrLat = res[4],
|
|
|
+ PosResType = EnumPosResType.X2D1NoRef,
|
|
|
};
|
|
|
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(posRes);
|
|
|
+ return Success(Map(posRes));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -435,7 +454,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
/// </summary>
|
|
|
/// <returns>返回定位结果ID</returns>
|
|
|
[HttpPost]
|
|
|
- public async Task<AjaxResult<PosRes>> PosX2D1NoXlNoParAsync(X2D1NoXlNoParlPosDto dto)
|
|
|
+ public async Task<AjaxResult<PosResDto>> PosX2D1NoXlNoParAsync(X2D1NoXlNoParlPosDto dto)
|
|
|
{
|
|
|
using (RHDWContext db = new RHDWContext())
|
|
|
{
|
|
@@ -443,7 +462,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (runTask == null)
|
|
|
{
|
|
|
Serilog.Log.Warning($"接收到两星一地无参定位(无星历)参数,由于任务没有运行中忽略本次定位!");
|
|
|
- return Error<PosRes>($"多模式融合定位平台没有启动两星一地定位任务");
|
|
|
+ return Error<PosResDto>($"多模式融合定位平台没有启动两星一地定位任务");
|
|
|
}
|
|
|
var parameter1 = new SQLiteParameter("@sigTime", dto.SigTime);
|
|
|
var parameter2 = new SQLiteParameter("@satcode", dto.MainSatID);
|
|
@@ -452,14 +471,14 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (xlInfo1 == null)
|
|
|
{
|
|
|
Serilog.Log.Error($"未找到卫星[{dto.MainSatID}]的双行根数星历");
|
|
|
- return Error<PosRes>($"未找到卫星[{dto.MainSatID}]的双行根数星历");
|
|
|
+ return Error<PosResDto>($"未找到卫星[{dto.MainSatID}]的双行根数星历");
|
|
|
}
|
|
|
|
|
|
var xlInfo2 = await db.XlInfos.SqlQuery("select * from XlInfo where ABS(JULIANDAY(TimeBJ)-JULIANDAY(@sigTime))=(select min(ABS(JULIANDAY(TimeBJ)-JULIANDAY(@sigTime))) from XlInfo where satcode=@satcode)", parameter1, parameter3).FirstOrDefaultAsync();
|
|
|
if (xlInfo2 == null)
|
|
|
{
|
|
|
Serilog.Log.Error($"未找到卫星[{dto.AdjaSatID}]的双行根数星历");
|
|
|
- return Error<PosRes>($"未找到卫星[{dto.AdjaSatID}]的双行根数星历");
|
|
|
+ return Error<PosResDto>($"未找到卫星[{dto.AdjaSatID}]的双行根数星历");
|
|
|
}
|
|
|
Serilog.Log.Information($"卫星{dto.MainSatID}使用{xlInfo1.TwoLine}进行星历推算");
|
|
|
Serilog.Log.Information($"卫星{dto.AdjaSatID}使用{xlInfo2.TwoLine}进行星历推算");
|
|
@@ -471,7 +490,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (!response.IsSuccessStatusCode) // 处理响应失败
|
|
|
{
|
|
|
Serilog.Log.Error($"[{dto.MainSatID}]星厉推算失败");
|
|
|
- return Error<PosRes>($"[{dto.MainSatID}]星厉推算失败");
|
|
|
+ return Error<PosResDto>($"[{dto.MainSatID}]星厉推算失败");
|
|
|
}
|
|
|
var content = await response.Content.ReadAsStringAsync();
|
|
|
var ephMain = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content).data;
|
|
@@ -481,7 +500,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (!response2.IsSuccessStatusCode) // 处理响应失败
|
|
|
{
|
|
|
Serilog.Log.Error($"[{dto.AdjaSatID}]星厉推算失败");
|
|
|
- return Error<PosRes>($"[{dto.AdjaSatID}]星厉推算失败");
|
|
|
+ return Error<PosResDto>($"[{dto.AdjaSatID}]星厉推算失败");
|
|
|
}
|
|
|
var content2 = await response2.Content.ReadAsStringAsync();
|
|
|
var ephAdja = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content2).data;
|
|
@@ -525,12 +544,13 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
PosLat = res[1],
|
|
|
MirrLon = res[3],
|
|
|
MirrLat = res[4],
|
|
|
+ PosResType = EnumPosResType.X2D1NoRef,
|
|
|
};
|
|
|
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(posRes);
|
|
|
+ return Success(Map(posRes));
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
@@ -542,7 +562,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
/// <param name="dto">定位参数</param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
- public async Task<AjaxResult<PosRes>> PosRhAsync(RHPosDto dto)
|
|
|
+ public async Task<AjaxResult<PosResDto>> PosRhAsync(RHPosDto dto)
|
|
|
{
|
|
|
using (RHDWContext db = new RHDWContext())
|
|
|
{
|
|
@@ -550,7 +570,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (runTask == null)
|
|
|
{
|
|
|
Serilog.Log.Warning($"接收到融合带参定位(含星历)参数,由于任务没有运行中忽略本次定位!");
|
|
|
- return Error<PosRes>($"多模式融合定位平台没有启动融合定位任务");
|
|
|
+ return Error<PosResDto>($"多模式融合定位平台没有启动融合定位任务");
|
|
|
}
|
|
|
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
@@ -605,11 +625,12 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
PosLat = res[1],
|
|
|
MirrLon = res[3],
|
|
|
MirrLat = res[4],
|
|
|
+ PosResType = EnumPosResType.RH,
|
|
|
};
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(posRes);
|
|
|
+ return Success(Map(posRes));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -618,7 +639,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
/// </summary>
|
|
|
/// <returns>返回定位结果ID</returns>
|
|
|
[HttpPost]
|
|
|
- public async Task<AjaxResult<PosRes>> PosRhNoXlAsync(RHNoXlPosDto dto)
|
|
|
+ public async Task<AjaxResult<PosResDto>> PosRhNoXlAsync(RHNoXlPosDto dto)
|
|
|
{
|
|
|
using (RHDWContext db = new RHDWContext())
|
|
|
{
|
|
@@ -626,7 +647,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (runTask == null)
|
|
|
{
|
|
|
Serilog.Log.Warning($"接收到融合带参定位(无星历)参数,由于任务没有运行中忽略本次定位!");
|
|
|
- return Error<PosRes>($"多模式融合定位平台没有启动融合定位任务");
|
|
|
+ return Error<PosResDto>($"多模式融合定位平台没有启动融合定位任务");
|
|
|
}
|
|
|
var parameter1 = new SQLiteParameter("@sigTime", dto.SigTime);
|
|
|
var parameter2 = new SQLiteParameter("@satcode", dto.MainSatID);
|
|
@@ -635,14 +656,14 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (xlInfo1 == null)
|
|
|
{
|
|
|
Serilog.Log.Error($"未找到卫星[{dto.MainSatID}]的双行根数星历");
|
|
|
- return Error<PosRes>($"未找到卫星[{dto.MainSatID}]的双行根数星历");
|
|
|
+ return Error<PosResDto>($"未找到卫星[{dto.MainSatID}]的双行根数星历");
|
|
|
}
|
|
|
|
|
|
var xlInfo2 = await db.XlInfos.SqlQuery("select * from XlInfo where ABS(JULIANDAY(TimeBJ)-JULIANDAY(@sigTime))=(select min(ABS(JULIANDAY(TimeBJ)-JULIANDAY(@sigTime))) from XlInfo where satcode=@satcode)", parameter1, parameter3).FirstOrDefaultAsync();
|
|
|
if (xlInfo2 == null)
|
|
|
{
|
|
|
Serilog.Log.Error($"未找到卫星[{dto.AdjaSatID}]的双行根数星历");
|
|
|
- return Error<PosRes>($"未找到卫星[{dto.AdjaSatID}]的双行根数星历");
|
|
|
+ return Error<PosResDto>($"未找到卫星[{dto.AdjaSatID}]的双行根数星历");
|
|
|
}
|
|
|
Serilog.Log.Information($"卫星{dto.MainSatID}使用{xlInfo1.TwoLine}进行星历推算");
|
|
|
Serilog.Log.Information($"卫星{dto.AdjaSatID}使用{xlInfo2.TwoLine}进行星历推算");
|
|
@@ -654,7 +675,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (!response.IsSuccessStatusCode) // 处理响应失败
|
|
|
{
|
|
|
Serilog.Log.Error($"[{dto.MainSatID}]星厉推算失败");
|
|
|
- return Error<PosRes>($"[{dto.MainSatID}]星厉推算失败");
|
|
|
+ return Error<PosResDto>($"[{dto.MainSatID}]星厉推算失败");
|
|
|
}
|
|
|
var content = await response.Content.ReadAsStringAsync();
|
|
|
var ephMain = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content).data;
|
|
@@ -664,7 +685,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (!response2.IsSuccessStatusCode) // 处理响应失败
|
|
|
{
|
|
|
Serilog.Log.Error($"[{dto.AdjaSatID}]星厉推算失败");
|
|
|
- return Error<PosRes>($"[{dto.AdjaSatID}]星厉推算失败");
|
|
|
+ return Error<PosResDto>($"[{dto.AdjaSatID}]星厉推算失败");
|
|
|
}
|
|
|
var content2 = await response2.Content.ReadAsStringAsync();
|
|
|
var ephAdja = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content2).data;
|
|
@@ -721,11 +742,12 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
PosLat = res[1],
|
|
|
MirrLon = res[3],
|
|
|
MirrLat = res[4],
|
|
|
+ PosResType = EnumPosResType.RH,
|
|
|
};
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(posRes);
|
|
|
+ return Success(Map(posRes));
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
@@ -737,7 +759,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
/// <param name="dto">定位参数</param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
- public async Task<AjaxResult<PosRes>> PosX3TwoDtoAsync(X3TwoDtoPosDto dto)
|
|
|
+ public async Task<AjaxResult<PosResDto>> PosX3TwoDtoAsync(X3TwoDtoPosDto dto)
|
|
|
{
|
|
|
using (RHDWContext db = new RHDWContext())
|
|
|
{
|
|
@@ -745,7 +767,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (runTask == null)
|
|
|
{
|
|
|
Serilog.Log.Warning($"接收到三星双时差带参定位(含星历)参数,由于任务没有运行中忽略本次定位!");
|
|
|
- return Error<PosRes>($"多模式融合定位平台没有启动三星双时差定位任务");
|
|
|
+ return Error<PosResDto>($"多模式融合定位平台没有启动三星双时差定位任务");
|
|
|
}
|
|
|
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
@@ -793,11 +815,12 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
PosLat = res[1],
|
|
|
MirrLon = res[3],
|
|
|
MirrLat = res[4],
|
|
|
+ PosResType = EnumPosResType.X3,
|
|
|
};
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(posRes);
|
|
|
+ return Success(Map(posRes));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -806,7 +829,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
/// </summary>
|
|
|
/// <returns>返回定位结果ID</returns>
|
|
|
[HttpPost]
|
|
|
- public async Task<AjaxResult<PosRes>> PosX3TwoDtoNoXlAsync(X3TwoDtoNoXlPosDto dto)
|
|
|
+ public async Task<AjaxResult<PosResDto>> PosX3TwoDtoNoXlAsync(X3TwoDtoNoXlPosDto dto)
|
|
|
{
|
|
|
using (RHDWContext db = new RHDWContext())
|
|
|
{
|
|
@@ -814,7 +837,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (runTask == null)
|
|
|
{
|
|
|
Serilog.Log.Warning($"接收到三星双时差带参定位(无星历)参数,由于任务没有运行中忽略本次定位!");
|
|
|
- return Error<PosRes>($"多模式融合定位平台没有启动三星双时差定位任务");
|
|
|
+ return Error<PosResDto>($"多模式融合定位平台没有启动三星双时差定位任务");
|
|
|
}
|
|
|
var parameter1 = new SQLiteParameter("@sigTime", dto.SigTime);
|
|
|
var parameter2 = new SQLiteParameter("@satcode", dto.MainSatID);
|
|
@@ -824,21 +847,21 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (xlInfo1 == null)
|
|
|
{
|
|
|
Serilog.Log.Error($"未找到卫星[{dto.MainSatID}]的双行根数星历");
|
|
|
- return Error<PosRes>($"未找到卫星[{dto.MainSatID}]的双行根数星历");
|
|
|
+ return Error<PosResDto>($"未找到卫星[{dto.MainSatID}]的双行根数星历");
|
|
|
}
|
|
|
|
|
|
var xlInfo2 = await db.XlInfos.SqlQuery("select * from XlInfo where ABS(JULIANDAY(TimeBJ)-JULIANDAY(@sigTime))=(select min(ABS(JULIANDAY(TimeBJ)-JULIANDAY(@sigTime))) from XlInfo where satcode=@satcode)", parameter1, parameter3).FirstOrDefaultAsync();
|
|
|
if (xlInfo2 == null)
|
|
|
{
|
|
|
Serilog.Log.Error($"未找到卫星[{dto.Adja1SatID}]的双行根数星历");
|
|
|
- return Error<PosRes>($"未找到卫星[{dto.Adja1SatID}]的双行根数星历");
|
|
|
+ return Error<PosResDto>($"未找到卫星[{dto.Adja1SatID}]的双行根数星历");
|
|
|
}
|
|
|
|
|
|
var xlInfo3 = await db.XlInfos.SqlQuery("select * from XlInfo where ABS(JULIANDAY(TimeBJ)-JULIANDAY(@sigTime))=(select min(ABS(JULIANDAY(TimeBJ)-JULIANDAY(@sigTime))) from XlInfo where satcode=@satcode)", parameter1, parameter4).FirstOrDefaultAsync();
|
|
|
if (xlInfo3 == null)
|
|
|
{
|
|
|
Serilog.Log.Error($"未找到卫星[{dto.Adja2SatID}]的双行根数星历");
|
|
|
- return Error<PosRes>($"未找到卫星[{dto.Adja2SatID}]的双行根数星历");
|
|
|
+ return Error<PosResDto>($"未找到卫星[{dto.Adja2SatID}]的双行根数星历");
|
|
|
}
|
|
|
Serilog.Log.Information($"卫星{dto.MainSatID}使用{xlInfo1.TwoLine}进行星历推算");
|
|
|
Serilog.Log.Information($"卫星{dto.Adja1SatID}使用{xlInfo2.TwoLine}进行星历推算");
|
|
@@ -852,7 +875,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (!response.IsSuccessStatusCode) // 处理响应失败
|
|
|
{
|
|
|
Serilog.Log.Error($"[{dto.MainSatID}]星厉推算失败");
|
|
|
- return Error<PosRes>($"[{dto.MainSatID}]星厉推算失败");
|
|
|
+ return Error<PosResDto>($"[{dto.MainSatID}]星厉推算失败");
|
|
|
}
|
|
|
var content = await response.Content.ReadAsStringAsync();
|
|
|
var ephMain = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content).data;
|
|
@@ -862,7 +885,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (!response2.IsSuccessStatusCode) // 处理响应失败
|
|
|
{
|
|
|
Serilog.Log.Error($"[{dto.Adja1SatID}]星厉推算失败");
|
|
|
- return Error<PosRes>($"[{dto.Adja1SatID}]星厉推算失败");
|
|
|
+ return Error<PosResDto>($"[{dto.Adja1SatID}]星厉推算失败");
|
|
|
}
|
|
|
var content2 = await response2.Content.ReadAsStringAsync();
|
|
|
var ephAdja1 = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content2).data;
|
|
@@ -872,7 +895,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (!response3.IsSuccessStatusCode) // 处理响应失败
|
|
|
{
|
|
|
Serilog.Log.Error($"[{dto.Adja2SatID}]星厉推算失败");
|
|
|
- return Error<PosRes>($"[{dto.Adja2SatID}]星厉推算失败");
|
|
|
+ return Error<PosResDto>($"[{dto.Adja2SatID}]星厉推算失败");
|
|
|
}
|
|
|
var content3 = await response2.Content.ReadAsStringAsync();
|
|
|
var ephAdja2 = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content3).data;
|
|
@@ -922,11 +945,12 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
PosLat = res[1],
|
|
|
MirrLon = res[3],
|
|
|
MirrLat = res[4],
|
|
|
+ PosResType = EnumPosResType.X3,
|
|
|
};
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(posRes);
|
|
|
+ return Success(Map(posRes));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -936,7 +960,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
/// <param name="dto">定位参数</param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
- public async Task<AjaxResult<PosRes>> PosX3TwoDtoNoParAsync(X3TwoDtoNoParPosDto dto)
|
|
|
+ public async Task<AjaxResult<PosResDto>> PosX3TwoDtoNoParAsync(X3TwoDtoNoParPosDto dto)
|
|
|
{
|
|
|
using (RHDWContext db = new RHDWContext())
|
|
|
{
|
|
@@ -944,7 +968,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (runTask == null)
|
|
|
{
|
|
|
Serilog.Log.Warning($"接收到三星双时差无参定位(含星历)参数,由于任务没有运行中忽略本次定位!");
|
|
|
- return Error<PosRes>($"多模式融合定位平台没有启动三星双时差定位任务");
|
|
|
+ return Error<PosResDto>($"多模式融合定位平台没有启动三星双时差定位任务");
|
|
|
}
|
|
|
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
@@ -987,11 +1011,12 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
PosLat = res[1],
|
|
|
MirrLon = res[3],
|
|
|
MirrLat = res[4],
|
|
|
+ PosResType = EnumPosResType.X3NoRef,
|
|
|
};
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(posRes);
|
|
|
+ return Success(Map(posRes));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1000,7 +1025,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
/// </summary>
|
|
|
/// <returns>返回定位结果ID</returns>
|
|
|
[HttpPost]
|
|
|
- public async Task<AjaxResult<PosRes>> PosX3TwoDtoNoXlNoParAsync(X3TwoDtoNoXlNoParPosDto dto)
|
|
|
+ public async Task<AjaxResult<PosResDto>> PosX3TwoDtoNoXlNoParAsync(X3TwoDtoNoXlNoParPosDto dto)
|
|
|
{
|
|
|
using (RHDWContext db = new RHDWContext())
|
|
|
{
|
|
@@ -1008,7 +1033,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (runTask == null)
|
|
|
{
|
|
|
Serilog.Log.Warning($"接收到三星双时差无参定位(无星历)参数,由于任务没有运行中忽略本次定位!");
|
|
|
- return Error<PosRes>($"多模式融合定位平台没有启动三星双时差定位任务");
|
|
|
+ return Error<PosResDto>($"多模式融合定位平台没有启动三星双时差定位任务");
|
|
|
}
|
|
|
var parameter1 = new SQLiteParameter("@sigTime", dto.SigTime);
|
|
|
var parameter2 = new SQLiteParameter("@satcode", dto.MainSatID);
|
|
@@ -1018,21 +1043,21 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (xlInfo1 == null)
|
|
|
{
|
|
|
Serilog.Log.Error($"未找到卫星[{dto.MainSatID}]的双行根数星历");
|
|
|
- return Error<PosRes>($"未找到卫星[{dto.MainSatID}]的双行根数星历");
|
|
|
+ return Error<PosResDto>($"未找到卫星[{dto.MainSatID}]的双行根数星历");
|
|
|
}
|
|
|
|
|
|
var xlInfo2 = await db.XlInfos.SqlQuery("select * from XlInfo where ABS(JULIANDAY(TimeBJ)-JULIANDAY(@sigTime))=(select min(ABS(JULIANDAY(TimeBJ)-JULIANDAY(@sigTime))) from XlInfo where satcode=@satcode)", parameter1, parameter3).FirstOrDefaultAsync();
|
|
|
if (xlInfo2 == null)
|
|
|
{
|
|
|
Serilog.Log.Error($"未找到卫星[{dto.Adja1SatID}]的双行根数星历");
|
|
|
- return Error<PosRes>($"未找到卫星[{dto.Adja1SatID}]的双行根数星历");
|
|
|
+ return Error<PosResDto>($"未找到卫星[{dto.Adja1SatID}]的双行根数星历");
|
|
|
}
|
|
|
|
|
|
var xlInfo3 = await db.XlInfos.SqlQuery("select * from XlInfo where ABS(JULIANDAY(TimeBJ)-JULIANDAY(@sigTime))=(select min(ABS(JULIANDAY(TimeBJ)-JULIANDAY(@sigTime))) from XlInfo where satcode=@satcode)", parameter1, parameter4).FirstOrDefaultAsync();
|
|
|
if (xlInfo3 == null)
|
|
|
{
|
|
|
Serilog.Log.Error($"未找到卫星[{dto.Adja2SatID}]的双行根数星历");
|
|
|
- return Error<PosRes>($"未找到卫星[{dto.Adja2SatID}]的双行根数星历");
|
|
|
+ return Error<PosResDto>($"未找到卫星[{dto.Adja2SatID}]的双行根数星历");
|
|
|
}
|
|
|
Serilog.Log.Information($"卫星{dto.MainSatID}使用{xlInfo1.TwoLine}进行星历推算");
|
|
|
Serilog.Log.Information($"卫星{dto.Adja1SatID}使用{xlInfo2.TwoLine}进行星历推算");
|
|
@@ -1046,7 +1071,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (!response.IsSuccessStatusCode) // 处理响应失败
|
|
|
{
|
|
|
Serilog.Log.Error($"[{dto.MainSatID}]星厉推算失败");
|
|
|
- return Error<PosRes>($"[{dto.MainSatID}]星厉推算失败");
|
|
|
+ return Error<PosResDto>($"[{dto.MainSatID}]星厉推算失败");
|
|
|
}
|
|
|
var content = await response.Content.ReadAsStringAsync();
|
|
|
var ephMain = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content).data;
|
|
@@ -1056,7 +1081,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (!response2.IsSuccessStatusCode) // 处理响应失败
|
|
|
{
|
|
|
Serilog.Log.Error($"[{dto.Adja1SatID}]星厉推算失败");
|
|
|
- return Error<PosRes>($"[{dto.Adja1SatID}]星厉推算失败");
|
|
|
+ return Error<PosResDto>($"[{dto.Adja1SatID}]星厉推算失败");
|
|
|
}
|
|
|
var content2 = await response2.Content.ReadAsStringAsync();
|
|
|
var ephAdja1 = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content2).data;
|
|
@@ -1066,7 +1091,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (!response3.IsSuccessStatusCode) // 处理响应失败
|
|
|
{
|
|
|
Serilog.Log.Error($"[{dto.Adja2SatID}]星厉推算失败");
|
|
|
- return Error<PosRes>($"[{dto.Adja2SatID}]星厉推算失败");
|
|
|
+ return Error<PosResDto>($"[{dto.Adja2SatID}]星厉推算失败");
|
|
|
}
|
|
|
var content3 = await response2.Content.ReadAsStringAsync();
|
|
|
var ephAdja2 = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content3).data;
|
|
@@ -1111,11 +1136,12 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
PosLat = res[1],
|
|
|
MirrLon = res[3],
|
|
|
MirrLat = res[4],
|
|
|
+ PosResType = EnumPosResType.X3NoRef,
|
|
|
};
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(posRes);
|
|
|
+ return Success(Map(posRes));
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
@@ -1127,7 +1153,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
/// <param name="dto">定位参数</param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
- public async Task<AjaxResult<PosRes>> PosX3TwoDfoAsync(X3TwoDfoPosDto dto)
|
|
|
+ public async Task<AjaxResult<PosResDto>> PosX3TwoDfoAsync(X3TwoDfoPosDto dto)
|
|
|
{
|
|
|
using (RHDWContext db = new RHDWContext())
|
|
|
{
|
|
@@ -1135,7 +1161,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (runTask == null)
|
|
|
{
|
|
|
Serilog.Log.Warning($"接收到三星双频差带参定位(含星历)参数,由于任务没有运行中忽略本次定位!");
|
|
|
- return Error<PosRes>($"多模式融合定位平台没有启动三星双频差定位任务");
|
|
|
+ return Error<PosResDto>($"多模式融合定位平台没有启动三星双频差定位任务");
|
|
|
}
|
|
|
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
@@ -1196,11 +1222,12 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
PosLat = res[1],
|
|
|
MirrLon = res[3],
|
|
|
MirrLat = res[4],
|
|
|
+ PosResType = EnumPosResType.X3TwoDfo,
|
|
|
};
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(posRes);
|
|
|
+ return Success(Map(posRes));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1209,7 +1236,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
/// </summary>
|
|
|
/// <returns>返回定位结果ID</returns>
|
|
|
[HttpPost]
|
|
|
- public async Task<AjaxResult<PosRes>> PosX3TwoDfoNoXlAsync(X3TwoDfoNoXlPosDto dto)
|
|
|
+ public async Task<AjaxResult<PosResDto>> PosX3TwoDfoNoXlAsync(X3TwoDfoNoXlPosDto dto)
|
|
|
{
|
|
|
using (RHDWContext db = new RHDWContext())
|
|
|
{
|
|
@@ -1217,7 +1244,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (runTask == null)
|
|
|
{
|
|
|
Serilog.Log.Warning($"接收到三星双频差带参定位(无星历)参数,由于任务没有运行中忽略本次定位!");
|
|
|
- return Error<PosRes>($"多模式融合定位平台没有启动三星双频差定位任务");
|
|
|
+ return Error<PosResDto>($"多模式融合定位平台没有启动三星双频差定位任务");
|
|
|
}
|
|
|
var parameter1 = new SQLiteParameter("@sigTime", dto.SigTime);
|
|
|
var parameter2 = new SQLiteParameter("@satcode", dto.MainSatID);
|
|
@@ -1227,21 +1254,21 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (xlInfo1 == null)
|
|
|
{
|
|
|
Serilog.Log.Error($"未找到卫星[{dto.MainSatID}]的双行根数星历");
|
|
|
- return Error<PosRes>($"未找到卫星[{dto.MainSatID}]的双行根数星历");
|
|
|
+ return Error<PosResDto>($"未找到卫星[{dto.MainSatID}]的双行根数星历");
|
|
|
}
|
|
|
|
|
|
var xlInfo2 = await db.XlInfos.SqlQuery("select * from XlInfo where ABS(JULIANDAY(TimeBJ)-JULIANDAY(@sigTime))=(select min(ABS(JULIANDAY(TimeBJ)-JULIANDAY(@sigTime))) from XlInfo where satcode=@satcode)", parameter1, parameter3).FirstOrDefaultAsync();
|
|
|
if (xlInfo2 == null)
|
|
|
{
|
|
|
Serilog.Log.Error($"未找到卫星[{dto.Adja1SatID}]的双行根数星历");
|
|
|
- return Error<PosRes>($"未找到卫星[{dto.Adja1SatID}]的双行根数星历");
|
|
|
+ return Error<PosResDto>($"未找到卫星[{dto.Adja1SatID}]的双行根数星历");
|
|
|
}
|
|
|
|
|
|
var xlInfo3 = await db.XlInfos.SqlQuery("select * from XlInfo where ABS(JULIANDAY(TimeBJ)-JULIANDAY(@sigTime))=(select min(ABS(JULIANDAY(TimeBJ)-JULIANDAY(@sigTime))) from XlInfo where satcode=@satcode)", parameter1, parameter4).FirstOrDefaultAsync();
|
|
|
if (xlInfo3 == null)
|
|
|
{
|
|
|
Serilog.Log.Error($"未找到卫星[{dto.Adja2SatID}]的双行根数星历");
|
|
|
- return Error<PosRes>($"未找到卫星[{dto.Adja2SatID}]的双行根数星历");
|
|
|
+ return Error<PosResDto>($"未找到卫星[{dto.Adja2SatID}]的双行根数星历");
|
|
|
}
|
|
|
Serilog.Log.Information($"卫星{dto.MainSatID}使用{xlInfo1.TwoLine}进行星历推算");
|
|
|
Serilog.Log.Information($"卫星{dto.Adja1SatID}使用{xlInfo2.TwoLine}进行星历推算");
|
|
@@ -1255,7 +1282,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (!response.IsSuccessStatusCode) // 处理响应失败
|
|
|
{
|
|
|
Serilog.Log.Error($"[{dto.MainSatID}]星厉推算失败");
|
|
|
- return Error<PosRes>($"[{dto.MainSatID}]星厉推算失败");
|
|
|
+ return Error<PosResDto>($"[{dto.MainSatID}]星厉推算失败");
|
|
|
}
|
|
|
var content = await response.Content.ReadAsStringAsync();
|
|
|
var ephMain = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content).data;
|
|
@@ -1265,7 +1292,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (!response2.IsSuccessStatusCode) // 处理响应失败
|
|
|
{
|
|
|
Serilog.Log.Error($"[{dto.Adja1SatID}]星厉推算失败");
|
|
|
- return Error<PosRes>($"[{dto.Adja1SatID}]星厉推算失败");
|
|
|
+ return Error<PosResDto>($"[{dto.Adja1SatID}]星厉推算失败");
|
|
|
}
|
|
|
var content2 = await response2.Content.ReadAsStringAsync();
|
|
|
var ephAdja1 = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content2).data;
|
|
@@ -1275,7 +1302,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (!response3.IsSuccessStatusCode) // 处理响应失败
|
|
|
{
|
|
|
Serilog.Log.Error($"[{dto.Adja2SatID}]星厉推算失败");
|
|
|
- return Error<PosRes>($"[{dto.Adja2SatID}]星厉推算失败");
|
|
|
+ return Error<PosResDto>($"[{dto.Adja2SatID}]星厉推算失败");
|
|
|
}
|
|
|
var content3 = await response2.Content.ReadAsStringAsync();
|
|
|
var ephAdja2 = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content3).data;
|
|
@@ -1338,11 +1365,12 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
PosLat = res[1],
|
|
|
MirrLon = res[3],
|
|
|
MirrLat = res[4],
|
|
|
+ PosResType = EnumPosResType.X3TwoDfo,
|
|
|
};
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(posRes);
|
|
|
+ return Success(Map(posRes));
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
@@ -1354,7 +1382,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
/// <param name="dto">定位参数</param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
- public async Task<AjaxResult<PosRes>> PosX2DtoDfoAsync(X2DtoDfoPosDto dto)
|
|
|
+ public async Task<AjaxResult<PosResDto>> PosX2DtoDfoAsync(X2DtoDfoPosDto dto)
|
|
|
{
|
|
|
using (RHDWContext db = new RHDWContext())
|
|
|
{
|
|
@@ -1362,7 +1390,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (runTask == null)
|
|
|
{
|
|
|
Serilog.Log.Warning($"接收到双星时频差带参定位(含星历)参数,由于任务没有运行中忽略本次定位!");
|
|
|
- return Error<PosRes>($"多模式融合定位平台没有启动双星时频差定位任务");
|
|
|
+ return Error<PosResDto>($"多模式融合定位平台没有启动双星时频差定位任务");
|
|
|
}
|
|
|
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
@@ -1415,11 +1443,12 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
PosLat = res[1],
|
|
|
MirrLon = res[3],
|
|
|
MirrLat = res[4],
|
|
|
+ PosResType = EnumPosResType.X2Dfo,
|
|
|
};
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(posRes);
|
|
|
+ return Success(Map(posRes));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1428,7 +1457,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
/// </summary>
|
|
|
/// <returns>返回定位结果ID</returns>
|
|
|
[HttpPost]
|
|
|
- public async Task<AjaxResult<PosRes>> PosX2DtoDfoNoXlAsync(X2DtoDfoNoXlPosDto dto)
|
|
|
+ public async Task<AjaxResult<PosResDto>> PosX2DtoDfoNoXlAsync(X2DtoDfoNoXlPosDto dto)
|
|
|
{
|
|
|
using (RHDWContext db = new RHDWContext())
|
|
|
{
|
|
@@ -1436,7 +1465,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (runTask == null)
|
|
|
{
|
|
|
Serilog.Log.Warning($"接收到双星时频差带参定位(无星历)参数,由于任务没有运行中忽略本次定位!");
|
|
|
- return Error<PosRes>($"多模式融合定位平台没有启动双星时频差定位任务");
|
|
|
+ return Error<PosResDto>($"多模式融合定位平台没有启动双星时频差定位任务");
|
|
|
}
|
|
|
var parameter1 = new SQLiteParameter("@sigTime", dto.SigTime);
|
|
|
var parameter2 = new SQLiteParameter("@satcode", dto.MainSatID);
|
|
@@ -1445,14 +1474,14 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (xlInfo1 == null)
|
|
|
{
|
|
|
Serilog.Log.Error($"未找到卫星[{dto.MainSatID}]的双行根数星历");
|
|
|
- return Error<PosRes>($"未找到卫星[{dto.MainSatID}]的双行根数星历");
|
|
|
+ return Error<PosResDto>($"未找到卫星[{dto.MainSatID}]的双行根数星历");
|
|
|
}
|
|
|
|
|
|
var xlInfo2 = await db.XlInfos.SqlQuery("select * from XlInfo where ABS(JULIANDAY(TimeBJ)-JULIANDAY(@sigTime))=(select min(ABS(JULIANDAY(TimeBJ)-JULIANDAY(@sigTime))) from XlInfo where satcode=@satcode)", parameter1, parameter3).FirstOrDefaultAsync();
|
|
|
if (xlInfo2 == null)
|
|
|
{
|
|
|
Serilog.Log.Error($"未找到卫星[{dto.AdjaSatID}]的双行根数星历");
|
|
|
- return Error<PosRes>($"未找到卫星[{dto.AdjaSatID}]的双行根数星历");
|
|
|
+ return Error<PosResDto>($"未找到卫星[{dto.AdjaSatID}]的双行根数星历");
|
|
|
}
|
|
|
Serilog.Log.Information($"卫星{dto.MainSatID}使用{xlInfo1.TwoLine}进行星历推算");
|
|
|
Serilog.Log.Information($"卫星{dto.AdjaSatID}使用{xlInfo2.TwoLine}进行星历推算");
|
|
@@ -1465,7 +1494,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (!response.IsSuccessStatusCode) // 处理响应失败
|
|
|
{
|
|
|
Serilog.Log.Error($"[{dto.MainSatID}]星厉推算失败");
|
|
|
- return Error<PosRes>($"[{dto.MainSatID}]星厉推算失败");
|
|
|
+ return Error<PosResDto>($"[{dto.MainSatID}]星厉推算失败");
|
|
|
}
|
|
|
var content = await response.Content.ReadAsStringAsync();
|
|
|
var ephMain = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content).data;
|
|
@@ -1475,7 +1504,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
if (!response2.IsSuccessStatusCode) // 处理响应失败
|
|
|
{
|
|
|
Serilog.Log.Error($"[{dto.AdjaSatID}]星厉推算失败");
|
|
|
- return Error<PosRes>($"[{dto.AdjaSatID}]星厉推算失败");
|
|
|
+ return Error<PosResDto>($"[{dto.AdjaSatID}]星厉推算失败");
|
|
|
}
|
|
|
var content2 = await response2.Content.ReadAsStringAsync();
|
|
|
var ephAdja1 = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content2).data;
|
|
@@ -1530,11 +1559,12 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
PosLat = res[1],
|
|
|
MirrLon = res[3],
|
|
|
MirrLat = res[4],
|
|
|
+ PosResType = EnumPosResType.X2Dfo,
|
|
|
};
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(posRes);
|
|
|
+ return Success(Map(posRes));
|
|
|
}
|
|
|
}
|
|
|
#endregion
|