|
@@ -24,7 +24,6 @@ using System.ComponentModel.DataAnnotations;
|
|
|
using System.Web.Caching;
|
|
|
using XdCxRhDW.Repostory;
|
|
|
using System.IO;
|
|
|
-using XdCxRhDW.Core.Api.理论时频差;
|
|
|
|
|
|
namespace XdCxRhDW.App.WebAPI
|
|
|
{
|
|
@@ -104,11 +103,10 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
MirrLat = res[4],
|
|
|
PosResType = EnumPosResType.X1D1CX,
|
|
|
};
|
|
|
- //posRes.TargetState = TheoryDtoDfoApi.TheoryDfo(cgRes, StationRes, posRes);
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(Map(posRes));
|
|
|
+ return Success(MapDto(posRes));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -206,11 +204,10 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
MirrLat = res[4],
|
|
|
PosResType = EnumPosResType.X1D1CX,
|
|
|
};
|
|
|
- //posRes.TargetState = TheoryDtoDfoApi.TheoryDfo(cgRes, StationRes, posRes);
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(Map(posRes));
|
|
|
+ return Success(MapDto(posRes));
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
@@ -267,6 +264,8 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
Adja1X = dto.AdjaX,
|
|
|
Adja1Y = dto.AdjaY,
|
|
|
Adja1Z = dto.AdjaZ,
|
|
|
+ TarFreqUp = dto.FreqUp,
|
|
|
+ TarFreqDown = dto.FreqDown,
|
|
|
});
|
|
|
|
|
|
var res = PosApi.X2D1_Pos(cgRes, StationRes);
|
|
@@ -284,11 +283,11 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
MirrLat = res[4],
|
|
|
PosResType = EnumPosResType.X2D1,
|
|
|
};
|
|
|
- //posRes.TargetState = TheoryDtoDfoApi.TheoryDfo(cgRes, StationRes, posRes);
|
|
|
+ posRes.TargetState = TheoryDtoDfoApi.TheoryDfo(cgRes, StationRes, posRes, 10);
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(Map(posRes));
|
|
|
+ return Success(MapDto(posRes));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -394,6 +393,8 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
Adja1X = ephAdja.data.X,
|
|
|
Adja1Y = ephAdja.data.Y,
|
|
|
Adja1Z = ephAdja.data.Z,
|
|
|
+ TarFreqUp = dto.FreqUp,
|
|
|
+ TarFreqDown = dto.FreqDown,
|
|
|
});
|
|
|
|
|
|
var res = PosApi.X2D1_Pos(cgRes, StationRes);
|
|
@@ -415,7 +416,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(Map(posRes));
|
|
|
+ return Success(MapDto(posRes));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -465,6 +466,8 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
Adja1X = dto.AdjaX,
|
|
|
Adja1Y = dto.AdjaY,
|
|
|
Adja1Z = dto.AdjaZ,
|
|
|
+ TarFreqUp = dto.FreqUp,
|
|
|
+ TarFreqDown = dto.FreqDown,
|
|
|
});
|
|
|
var res = PosApi.X2D1_PosNoRef(cgRes, StationRes);
|
|
|
PosRes posRes = new PosRes()
|
|
@@ -484,7 +487,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(Map(posRes));
|
|
|
+ return Success(MapDto(posRes));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -587,6 +590,8 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
Adja1X = ephAdja.data.X,
|
|
|
Adja1Y = ephAdja.data.Y,
|
|
|
Adja1Z = ephAdja.data.Z,
|
|
|
+ TarFreqUp = dto.FreqUp,
|
|
|
+ TarFreqDown = dto.FreqDown,
|
|
|
});
|
|
|
|
|
|
var res = PosApi.X2D1_PosNoRef(cgRes, StationRes);
|
|
@@ -608,7 +613,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(Map(posRes));
|
|
|
+ return Success(MapDto(posRes));
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
@@ -667,6 +672,8 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
Adja1X = dto.AdjaX,
|
|
|
Adja1Y = dto.AdjaY,
|
|
|
Adja1Z = dto.AdjaZ,
|
|
|
+ TarFreqUp = dto.FreqUp,
|
|
|
+ TarFreqDown = dto.FreqDown,
|
|
|
});
|
|
|
|
|
|
var cxRes = db.CxRes.Add(new CxRes()
|
|
@@ -695,7 +702,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(Map(posRes));
|
|
|
+ return Success(MapDto(posRes));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -798,6 +805,8 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
Adja1X = ephAdja.data.X,
|
|
|
Adja1Y = ephAdja.data.Y,
|
|
|
Adja1Z = ephAdja.data.Z,
|
|
|
+ TarFreqUp = dto.FreqUp,
|
|
|
+ TarFreqDown = dto.FreqDown,
|
|
|
});
|
|
|
var cxRes = db.CxRes.Add(new CxRes()
|
|
|
{
|
|
@@ -823,7 +832,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(Map(posRes));
|
|
|
+ return Success(MapDto(posRes));
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
@@ -883,6 +892,8 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
Adja2X = dto.Adja2X,
|
|
|
Adja2Y = dto.Adja2Y,
|
|
|
Adja2Z = dto.Adja2Z,
|
|
|
+ TarFreqUp = dto.FreqUp,
|
|
|
+ TarFreqDown = dto.FreqDown,
|
|
|
});
|
|
|
|
|
|
var res = PosApi.X3_Pos(cgRes, StationRes);
|
|
@@ -904,7 +915,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(Map(posRes));
|
|
|
+ return Success(MapDto(posRes));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1036,6 +1047,8 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
Adja2X = ephAdja2.data.X,
|
|
|
Adja2Y = ephAdja2.data.Y,
|
|
|
Adja2Z = ephAdja2.data.Z,
|
|
|
+ TarFreqUp = dto.FreqUp,
|
|
|
+ TarFreqDown = dto.FreqDown,
|
|
|
});
|
|
|
|
|
|
var res = PosApi.X3_Pos(cgRes, StationRes);
|
|
@@ -1057,7 +1070,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(Map(posRes));
|
|
|
+ return Success(MapDto(posRes));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1110,6 +1123,8 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
Adja2X = dto.Adja2X,
|
|
|
Adja2Y = dto.Adja2Y,
|
|
|
Adja2Z = dto.Adja2Z,
|
|
|
+ TarFreqUp = dto.FreqUp,
|
|
|
+ TarFreqDown = dto.FreqDown,
|
|
|
});
|
|
|
|
|
|
var res = PosApi.X3_PosNoRef(cgRes, StationRes);
|
|
@@ -1131,7 +1146,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(Map(posRes));
|
|
|
+ return Success(MapDto(posRes));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1258,6 +1273,8 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
Adja2X = ephAdja2.data.X,
|
|
|
Adja2Y = ephAdja2.data.Y,
|
|
|
Adja2Z = ephAdja2.data.Z,
|
|
|
+ TarFreqUp = dto.FreqUp,
|
|
|
+ TarFreqDown = dto.FreqDown,
|
|
|
});
|
|
|
|
|
|
var res = PosApi.X3_PosNoRef(cgRes, StationRes);
|
|
@@ -1279,7 +1296,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(Map(posRes));
|
|
|
+ return Success(MapDto(posRes));
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
@@ -1373,7 +1390,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(Map(posRes));
|
|
|
+ return Success(MapDto(posRes));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1539,7 +1556,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(Map(posRes));
|
|
|
+ return Success(MapDto(posRes));
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
@@ -1624,7 +1641,7 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(Map(posRes));
|
|
|
+ return Success(MapDto(posRes));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1758,96 +1775,233 @@ namespace XdCxRhDW.App.WebAPI
|
|
|
posRes = db.PosRes.Add(posRes);
|
|
|
await db.SaveChangesAsync();
|
|
|
PosObServer.Instance.Pub(posRes);
|
|
|
- return Success(Map(posRes));
|
|
|
+ return Success(MapDto(posRes));
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
- private PosResDto Map(PosRes res)
|
|
|
+ #region 定位结果查询接口
|
|
|
+ /// <summary>
|
|
|
+ /// 根据时间范围查询定位结果
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"><see cref="PosRequestByTimeRangeDto"/>查询参数</param>
|
|
|
+ /// <returns></returns>
|
|
|
+ /// <exception cref="Exception"></exception>
|
|
|
+ [HttpPost]
|
|
|
+ public async Task<AjaxResult<List<PosResDto>>> GetPosResByTimeRange(PosRequestByTimeRangeDto dto)
|
|
|
{
|
|
|
- return new PosResDto()
|
|
|
+ var response = (await GetPosResByTimeRangeObsolete(dto));
|
|
|
+ if (response.code == 200)
|
|
|
{
|
|
|
- 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)
|
|
|
- };
|
|
|
+ var listDto = response.data?.Select(p => MapDto(p)).ToList();
|
|
|
+ return Success(listDto);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return Error<List<PosResDto>>(response.msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 查询最后X小时的的定位结果
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"><see cref="PosRequestByLastRangeDto"/>查询参数</param>
|
|
|
+ /// <returns></returns>
|
|
|
+ /// <exception cref="Exception"></exception>
|
|
|
+ [HttpPost]
|
|
|
+ public async Task<AjaxResult<List<PosResDto>>> GetPosResByLastHours(PosRequestByLastRangeDto dto)
|
|
|
+ {
|
|
|
+ var response = (await GetPosResByLastHoursObsolete(dto));
|
|
|
+ if (response.code == 200)
|
|
|
+ {
|
|
|
+ var listDto = response.data?.Select(p => MapDto(p)).ToList();
|
|
|
+ return Success(listDto);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return Error<List<PosResDto>>(response.msg);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 查询定位结果
|
|
|
+ /// 根据时间范围查询定位结果(此方法内部调用)
|
|
|
/// </summary>
|
|
|
- /// <param name="dto"><see cref="PosResQueryDto"/>查询参数</param>
|
|
|
+ /// <param name="dto"><see cref="PosRequestByTimeRangeDto"/>查询参数</param>
|
|
|
/// <returns></returns>
|
|
|
/// <exception cref="Exception"></exception>
|
|
|
[HttpPost]
|
|
|
- public async Task<AjaxResult<List<PosResDto>>> GetPosRes(PosResQueryDto dto)
|
|
|
+ [Obsolete]
|
|
|
+ public async Task<AjaxResult<List<ModelPosRes>>> GetPosResByTimeRangeObsolete(PosRequestByTimeRangeDto dto)
|
|
|
{
|
|
|
- List<PosResDto> posList = new List<PosResDto>();
|
|
|
+ List<ModelPosRes> posList = new List<ModelPosRes>();
|
|
|
try
|
|
|
{
|
|
|
DateTime start = dto.BeginTime;
|
|
|
DateTime end = dto.EndTime;
|
|
|
+ var dir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "DbPart");
|
|
|
+ if (!Directory.Exists(dir)) return Success(posList);
|
|
|
+ List<string> list = new List<string>();
|
|
|
+ while (end >= start)
|
|
|
+ {
|
|
|
+ list.Add(end.ToString("yyyy") + "\\" + end.ToString("MMdd") + ".db");
|
|
|
+ end = end.AddDays(-1);
|
|
|
+ }
|
|
|
+ end = dto.EndTime;
|
|
|
+ foreach (var item in list)
|
|
|
+ {
|
|
|
+ var dayFile = Path.Combine(dir, item);
|
|
|
+ using (RHDWPartContext db = RHDWPartContext.GetContext(dayFile))
|
|
|
+ {
|
|
|
+ if (dto.IncludeInvalidate)
|
|
|
+ {
|
|
|
+ var posRes = await db.PosRes
|
|
|
+ .Where(w => w.SigTime >= start && w.SigTime <= end && w.TaskInfoID == dto.TaskInfoID)
|
|
|
+ .OrderByDescending(o => o.SigTime).ToListAsync();
|
|
|
+ posList.AddRange(posRes.Select(p => MapModel(p)));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var posRes = await db.PosRes
|
|
|
+ .Where(w => w.SigTime >= start && w.SigTime <= end && w.TaskInfoID == dto.TaskInfoID && w.PosLon != 999)
|
|
|
+ .OrderByDescending(o => o.SigTime).ToListAsync();
|
|
|
+ posList.AddRange(posRes.Select(p => MapModel(p)));
|
|
|
+ }
|
|
|
+ if (posList.Count > 5000)
|
|
|
+ {
|
|
|
+ return Success(posList.Take(5000).ToList(), "数据过多,只返回前5000条数据!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return Success(posList);
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ string msg = $"定位结果时间范围查询异常.任务ID={dto.TaskInfoID},{dto.BeginTime:yyyyMMddHHmmss}-{dto.EndTime:yyyyMMddHHmmss}";
|
|
|
+ Serilog.Log.Error(ex, msg);
|
|
|
+ return Error<List<ModelPosRes>>("定位结果时间范围查询异常");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 查询最后X小时的的定位结果(此方法内部调用)
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"><see cref="PosRequestByLastRangeDto"/>查询参数</param>
|
|
|
+ /// <returns></returns>
|
|
|
+ /// <exception cref="Exception"></exception>
|
|
|
+ [HttpPost]
|
|
|
+ [Obsolete]
|
|
|
+ public async Task<AjaxResult<List<ModelPosRes>>> GetPosResByLastHoursObsolete(PosRequestByLastRangeDto dto)
|
|
|
+ {
|
|
|
+ List<ModelPosRes> posList = new List<ModelPosRes>();
|
|
|
+ try
|
|
|
+ {
|
|
|
var dir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "DbPart");
|
|
|
if (!Directory.Exists(dir)) return Success(posList);
|
|
|
var yearDirs = Directory.EnumerateDirectories(dir).OrderByDescending(p => Convert.ToInt32(new DirectoryInfo(p).Name));//年目录,倒叙排列
|
|
|
+ DateTime max = DateTime.MinValue;
|
|
|
foreach (var yearDir in yearDirs)
|
|
|
{
|
|
|
+ if (max != DateTime.MinValue) break;
|
|
|
//每一天的db文件,倒序排列
|
|
|
var dayFiles = Directory.EnumerateFiles(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, yearDir), "*.db").OrderByDescending(p => Convert.ToInt32(new DirectoryInfo(p).Name.Substring(0, 4)));
|
|
|
foreach (var dayFile in dayFiles)
|
|
|
{
|
|
|
using (RHDWPartContext db = RHDWPartContext.GetContext(dayFile))
|
|
|
{
|
|
|
- if (db.PosRes.Any(p => p.TaskInfoID == dto.TaskInfoID))
|
|
|
- end = await db.PosRes.Where(p => p.TaskInfoID == dto.TaskInfoID).MaxAsync(p => p.SigTime);
|
|
|
+ if (dto.IncludeInvalidate)
|
|
|
+ {
|
|
|
+ if (db.PosRes.Any(p => p.TaskInfoID == dto.TaskInfoID))
|
|
|
+ max = await db.PosRes.Where(p => p.TaskInfoID == dto.TaskInfoID).MaxAsync(p => p.SigTime);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (db.PosRes.Any(p => p.TaskInfoID == dto.TaskInfoID && p.PosLon != 999))
|
|
|
+ max = await db.PosRes.Where(p => p.TaskInfoID == dto.TaskInfoID && p.PosLon != 999).MaxAsync(p => p.SigTime);
|
|
|
+ }
|
|
|
}
|
|
|
- if (end != DateTime.MinValue)
|
|
|
+ if (max != DateTime.MinValue)
|
|
|
{
|
|
|
- goto skip;
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- skip:
|
|
|
- if (end == DateTime.MinValue)
|
|
|
- {
|
|
|
- return Success(posList);//没有数据不查询
|
|
|
- }
|
|
|
- if (end >= dto.EndTime)
|
|
|
+ if (max == DateTime.MinValue) return Success(posList);
|
|
|
+ DateTime min = max.AddHours(-dto.Hours);
|
|
|
+ var res = await GetPosResByTimeRangeObsolete(new PosRequestByTimeRangeDto()
|
|
|
{
|
|
|
- end = dto.EndTime;
|
|
|
- }
|
|
|
- start = dto.BeginTime;
|
|
|
- DateTime endDay = new DateTime(end.Year, end.Month, end.Day);
|
|
|
- DateTime startDay = new DateTime(start.Year, start.Month, start.Day);
|
|
|
- while (endDay >= startDay)
|
|
|
- {
|
|
|
- using (RHDWPartContext db = RHDWPartContext.GetContext(endDay))
|
|
|
- {
|
|
|
- var posRes = await db.PosRes
|
|
|
- .Where(w => w.SigTime >= start && w.SigTime <= end && w.TaskInfoID == dto.TaskInfoID)
|
|
|
- .OrderByDescending(o => o.SigTime).ToListAsync();
|
|
|
- posList.AddRange(posRes.Select(m => Map(m)));
|
|
|
- }
|
|
|
- endDay = endDay.AddDays(-1);
|
|
|
- }
|
|
|
- return Success(posList);
|
|
|
-
|
|
|
+ TaskInfoID = dto.TaskInfoID,
|
|
|
+ BeginTime = min,
|
|
|
+ EndTime = max,
|
|
|
+ IncludeInvalidate = dto.IncludeInvalidate
|
|
|
+ });
|
|
|
+ return res;
|
|
|
}
|
|
|
-
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- string err = $"定位查询任务编号:{dto.TaskInfoID},{dto.BeginTime:yyyy-MM-dd HH:mm:ss}-{dto.EndTime:yyyy-MM-dd HH:mm:ss}异常:{ex.Message}";
|
|
|
- Serilog.Log.Error(err);
|
|
|
- return Error<List<PosResDto>>(err);
|
|
|
+ string msg = $"定位结果查询最新数据异常-任务编号:{dto.TaskInfoID},Hours:{dto.Hours}";
|
|
|
+ Serilog.Log.Error(ex, msg);
|
|
|
+ return Error<List<ModelPosRes>>("定位结果查询最新数据异常");
|
|
|
}
|
|
|
}
|
|
|
+ #endregion
|
|
|
|
|
|
+ private PosResDto MapDto(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)
|
|
|
+ };
|
|
|
+ }
|
|
|
+ private PosResDto MapDto(ModelPosRes 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)
|
|
|
+ };
|
|
|
+ }
|
|
|
+ private ModelPosRes MapModel(PosRes res)
|
|
|
+ {
|
|
|
+ return new ModelPosRes()
|
|
|
+ {
|
|
|
+ ID = res.ID,
|
|
|
+ CgResID = res.CgResID,
|
|
|
+ ClusterCount = res.ClusterCount,
|
|
|
+ ClusterKey = res.ClusterKey,
|
|
|
+ ColorKey = res.ColorKey,
|
|
|
+ CreateTime = res.CreateTime,
|
|
|
+ CxResID = res.CxResID,
|
|
|
+ Selected = res.Selected,
|
|
|
+ StationResID = res.StationResID,
|
|
|
+ TargetID = res.TargetID,
|
|
|
+ TargetState = res.TargetState,
|
|
|
+ TsName = res.TsName,
|
|
|
+ UpdateTime = res.UpdateTime,
|
|
|
+ Visible = res.Visible,
|
|
|
+ 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 = (EnumPosResType)((int)res.PosResType)
|
|
|
+ };
|
|
|
+ }
|
|
|
}
|
|
|
}
|