|
@@ -36,7 +36,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
public async Task<AjaxResult<PosResDto>> PosX1D1Async(X1D1PosDto dto)
|
|
|
{
|
|
|
TaskInfo runTask;
|
|
|
- using (RHDWContext db = RHDWContext.GetContext(true))
|
|
|
+ using (MySqlContext db = new MySqlContext())
|
|
|
{
|
|
|
if (dto.TaskID == null)
|
|
|
{
|
|
@@ -59,7 +59,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- using (RHDWPartContext db = RHDWPartContext.GetContext(dto.SigTime, true))
|
|
|
+ using (MySqlContext db=new MySqlContext())
|
|
|
{
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
|
{
|
|
@@ -140,7 +140,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
public async Task<AjaxResult<PosResDto>> PosX1D1NoXlAsync(X1D1NoXlPosDto dto)
|
|
|
{
|
|
|
TaskInfo runTask;
|
|
|
- using (RHDWContext db = RHDWContext.GetContext(true))
|
|
|
+ using (MySqlContext db = new MySqlContext())
|
|
|
{
|
|
|
if (dto.TaskID == null)
|
|
|
{
|
|
@@ -176,8 +176,9 @@ namespace XdCxRhDW.App.Controllers
|
|
|
XdCxRhDW.Framework.LogHelper.Error($"推算卫星{dto.MainCode}的ECEF星历出错.{ephMain.msg}");
|
|
|
return Error<PosResDto>($"推算卫星{dto.MainCode}的ECEF星历出错");
|
|
|
}
|
|
|
- using (RHDWPartContext db = RHDWPartContext.GetContext(dto.SigTime, true))
|
|
|
+ using (MySqlContext db=new MySqlContext())
|
|
|
{
|
|
|
+
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
|
{
|
|
|
SatTxLon = dto.SatTxLon,
|
|
@@ -268,7 +269,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
{
|
|
|
TaskInfo runTask;
|
|
|
TargetInfo target = null;
|
|
|
- using (RHDWContext db = RHDWContext.GetContext(true))
|
|
|
+ using (MySqlContext db = new MySqlContext())
|
|
|
{
|
|
|
if (dto.TaskID == null)
|
|
|
{
|
|
@@ -293,7 +294,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
}
|
|
|
if (!string.IsNullOrWhiteSpace(dto.Target))
|
|
|
{
|
|
|
- using (RHDWContext db = RHDWContext.GetContext())
|
|
|
+ using (MySqlContext db = new MySqlContext())
|
|
|
{
|
|
|
target = await db.TargetInfos.FirstOrDefaultAsync(p => p.TargetName == dto.Target.Trim());
|
|
|
if (target == null)
|
|
@@ -307,7 +308,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- using (RHDWPartContext db = RHDWPartContext.GetContext(dto.SigTime, true))
|
|
|
+ using (MySqlContext db=new MySqlContext())
|
|
|
{
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
|
{
|
|
@@ -398,9 +399,9 @@ namespace XdCxRhDW.App.Controllers
|
|
|
}
|
|
|
catch (Exception)
|
|
|
{
|
|
|
- using (RHDWPartContext db = RHDWPartContext.GetContext(dto.SigTime, true))
|
|
|
+ using (MySqlContext db=new MySqlContext())
|
|
|
{
|
|
|
- db.SyncDb();
|
|
|
+ //db.SyncDb();
|
|
|
}
|
|
|
throw;
|
|
|
}
|
|
@@ -417,7 +418,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
{
|
|
|
TaskInfo runTask;
|
|
|
TargetInfo target = null;
|
|
|
- using (RHDWContext db = RHDWContext.GetContext(true))
|
|
|
+ using (MySqlContext db = new MySqlContext())
|
|
|
{
|
|
|
if (dto.TaskID == null)
|
|
|
{
|
|
@@ -441,7 +442,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
}
|
|
|
if (!string.IsNullOrWhiteSpace(dto.Target))
|
|
|
{
|
|
|
- using (RHDWContext db = RHDWContext.GetContext())
|
|
|
+ using (MySqlContext db = new MySqlContext())
|
|
|
{
|
|
|
target = await db.TargetInfos.FirstOrDefaultAsync(p => p.TargetName == dto.Target.Trim());
|
|
|
if (target == null)
|
|
@@ -506,7 +507,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
//dto.AdjaYbDto = Math.Round(refdt2 * 1e6, 3);
|
|
|
|
|
|
|
|
|
- using (RHDWPartContext db = RHDWPartContext.GetContext(dto.SigTime, true))
|
|
|
+ using (MySqlContext db=new MySqlContext())
|
|
|
{
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
|
{
|
|
@@ -615,9 +616,9 @@ namespace XdCxRhDW.App.Controllers
|
|
|
}
|
|
|
catch (Exception)
|
|
|
{
|
|
|
- using (RHDWPartContext db = RHDWPartContext.GetContext(dto.SigTime, true))
|
|
|
+ using (MySqlContext db=new MySqlContext())
|
|
|
{
|
|
|
- db.SyncDb();
|
|
|
+ //db.SyncDb();
|
|
|
}
|
|
|
throw;
|
|
|
}
|
|
@@ -635,7 +636,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
{
|
|
|
TaskInfo runTask;
|
|
|
TargetInfo target = null;
|
|
|
- using (RHDWContext db = RHDWContext.GetContext(true))
|
|
|
+ using (MySqlContext db = new MySqlContext())
|
|
|
{
|
|
|
if (dto.TaskID == null)
|
|
|
{
|
|
@@ -659,7 +660,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
}
|
|
|
if (!string.IsNullOrWhiteSpace(dto.Target))
|
|
|
{
|
|
|
- using (RHDWContext db = RHDWContext.GetContext())
|
|
|
+ using (MySqlContext db = new MySqlContext())
|
|
|
{
|
|
|
target = await db.TargetInfos.FirstOrDefaultAsync(p => p.TargetName == dto.Target.Trim());
|
|
|
if (target == null)
|
|
@@ -673,7 +674,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- using (RHDWPartContext db = RHDWPartContext.GetContext(dto.SigTime, true))
|
|
|
+ using (MySqlContext db=new MySqlContext())
|
|
|
{
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
|
{
|
|
@@ -755,9 +756,9 @@ namespace XdCxRhDW.App.Controllers
|
|
|
}
|
|
|
catch (Exception)
|
|
|
{
|
|
|
- using (RHDWPartContext db = RHDWPartContext.GetContext(dto.SigTime, true))
|
|
|
+ using (MySqlContext db=new MySqlContext())
|
|
|
{
|
|
|
- db.SyncDb();
|
|
|
+ //db.SyncDb();
|
|
|
}
|
|
|
throw;
|
|
|
}
|
|
@@ -775,7 +776,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
{
|
|
|
TaskInfo runTask;
|
|
|
TargetInfo target = null;
|
|
|
- using (RHDWContext db = RHDWContext.GetContext(true))
|
|
|
+ using (MySqlContext db = new MySqlContext())
|
|
|
{
|
|
|
if (dto.TaskID == null)
|
|
|
{
|
|
@@ -799,7 +800,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
}
|
|
|
if (!string.IsNullOrWhiteSpace(dto.Target))
|
|
|
{
|
|
|
- using (RHDWContext db = RHDWContext.GetContext())
|
|
|
+ using (MySqlContext db = new MySqlContext())
|
|
|
{
|
|
|
target = await db.TargetInfos.FirstOrDefaultAsync(p => p.TargetName == dto.Target.Trim());
|
|
|
if (target == null)
|
|
@@ -856,7 +857,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
//dto.SxDto = dto1 * 1e6 + r.Next(-10, 10) + Math.Round(r.NextDouble(), 3);
|
|
|
//dto.XdDto = dto2 * 1e6 + r.Next(-10, 10) + Math.Round(r.NextDouble(), 3);
|
|
|
|
|
|
- using (RHDWPartContext db = RHDWPartContext.GetContext(dto.SigTime, true))
|
|
|
+ using (MySqlContext db=new MySqlContext())
|
|
|
{
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
|
{
|
|
@@ -940,9 +941,9 @@ namespace XdCxRhDW.App.Controllers
|
|
|
}
|
|
|
catch (Exception)
|
|
|
{
|
|
|
- using (RHDWPartContext db = RHDWPartContext.GetContext(dto.SigTime, true))
|
|
|
+ using (MySqlContext db=new MySqlContext())
|
|
|
{
|
|
|
- db.SyncDb();
|
|
|
+ //db.SyncDb();
|
|
|
}
|
|
|
throw;
|
|
|
}
|
|
@@ -959,7 +960,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
public async Task<AjaxResult<PosResDto>> PosRhAsync(RHPosDto dto)
|
|
|
{
|
|
|
TaskInfo runTask;
|
|
|
- using (RHDWContext db = RHDWContext.GetContext(true))
|
|
|
+ using (MySqlContext db = new MySqlContext())
|
|
|
{
|
|
|
if (dto.TaskID == null)
|
|
|
{
|
|
@@ -981,7 +982,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- using (RHDWPartContext db = RHDWPartContext.GetContext(dto.SigTime, true))
|
|
|
+ using (MySqlContext db=new MySqlContext())
|
|
|
{
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
|
{
|
|
@@ -1074,7 +1075,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
public async Task<AjaxResult<PosResDto>> PosRhNoXlAsync(RHNoXlPosDto dto)
|
|
|
{
|
|
|
TaskInfo runTask;
|
|
|
- using (RHDWContext db = RHDWContext.GetContext(true))
|
|
|
+ using (MySqlContext db = new MySqlContext())
|
|
|
{
|
|
|
if (dto.TaskID == null)
|
|
|
{
|
|
@@ -1124,7 +1125,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
XdCxRhDW.Framework.LogHelper.Error($"推算卫星{dto.AdjaCode}的ECEF星历出错.{ephAdja.msg}");
|
|
|
return Error<PosResDto>($"推算卫星{dto.AdjaCode}的ECEF星历出错");
|
|
|
}
|
|
|
- using (RHDWPartContext db = RHDWPartContext.GetContext(dto.SigTime, true))
|
|
|
+ using (MySqlContext db=new MySqlContext())
|
|
|
{
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
|
{
|
|
@@ -1229,7 +1230,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
{
|
|
|
TaskInfo runTask;
|
|
|
TargetInfo target = null;
|
|
|
- using (RHDWContext db = RHDWContext.GetContext(true))
|
|
|
+ using (MySqlContext db = new MySqlContext())
|
|
|
{
|
|
|
if (dto.TaskID == null)
|
|
|
{
|
|
@@ -1253,7 +1254,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
}
|
|
|
if (!string.IsNullOrWhiteSpace(dto.Target))
|
|
|
{
|
|
|
- using (RHDWContext db = RHDWContext.GetContext())
|
|
|
+ using (MySqlContext db = new MySqlContext())
|
|
|
{
|
|
|
target = await db.TargetInfos.FirstOrDefaultAsync(p => p.TargetName == dto.Target.Trim());
|
|
|
if (target == null)
|
|
@@ -1267,7 +1268,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- using (RHDWPartContext db = RHDWPartContext.GetContext(dto.SigTime, true))
|
|
|
+ using (MySqlContext db=new MySqlContext())
|
|
|
{
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
|
{
|
|
@@ -1360,9 +1361,9 @@ namespace XdCxRhDW.App.Controllers
|
|
|
}
|
|
|
catch (Exception)
|
|
|
{
|
|
|
- using (RHDWPartContext db = RHDWPartContext.GetContext(dto.SigTime, true))
|
|
|
+ using (MySqlContext db=new MySqlContext())
|
|
|
{
|
|
|
- db.SyncDb();
|
|
|
+ //db.SyncDb();
|
|
|
}
|
|
|
throw;
|
|
|
}
|
|
@@ -1379,7 +1380,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
{
|
|
|
TaskInfo runTask;
|
|
|
TargetInfo target = null;
|
|
|
- using (RHDWContext db = RHDWContext.GetContext(true))
|
|
|
+ using (MySqlContext db = new MySqlContext())
|
|
|
{
|
|
|
if (dto.TaskID == null)
|
|
|
{
|
|
@@ -1403,7 +1404,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
}
|
|
|
if (!string.IsNullOrWhiteSpace(dto.Target))
|
|
|
{
|
|
|
- using (RHDWContext db = RHDWContext.GetContext())
|
|
|
+ using (MySqlContext db = new MySqlContext())
|
|
|
{
|
|
|
target = await db.TargetInfos.FirstOrDefaultAsync(p => p.TargetName == dto.Target.Trim());
|
|
|
if (target == null)
|
|
@@ -1459,7 +1460,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
XdCxRhDW.Framework.LogHelper.Error($"推算卫星{dto.Adja2Code}的ECEF星历出错.{ephAdja2.msg}");
|
|
|
return Error<PosResDto>($"推算卫星{dto.Adja2Code}的ECEF星历出错");
|
|
|
}
|
|
|
- using (RHDWPartContext db = RHDWPartContext.GetContext(dto.SigTime, true))
|
|
|
+ using (MySqlContext db=new MySqlContext())
|
|
|
{
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
|
{
|
|
@@ -1555,9 +1556,9 @@ namespace XdCxRhDW.App.Controllers
|
|
|
}
|
|
|
catch (Exception)
|
|
|
{
|
|
|
- using (RHDWPartContext db = RHDWPartContext.GetContext(dto.SigTime, true))
|
|
|
+ using (MySqlContext db=new MySqlContext())
|
|
|
{
|
|
|
- db.SyncDb();
|
|
|
+ //db.SyncDb();
|
|
|
}
|
|
|
throw;
|
|
|
}
|
|
@@ -1575,7 +1576,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
{
|
|
|
TaskInfo runTask;
|
|
|
TargetInfo target = null;
|
|
|
- using (RHDWContext db = RHDWContext.GetContext(true))
|
|
|
+ using (MySqlContext db = new MySqlContext())
|
|
|
{
|
|
|
if (dto.TaskID == null)
|
|
|
{
|
|
@@ -1599,7 +1600,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
}
|
|
|
if (!string.IsNullOrWhiteSpace(dto.Target))
|
|
|
{
|
|
|
- using (RHDWContext db = RHDWContext.GetContext())
|
|
|
+ using (MySqlContext db = new MySqlContext())
|
|
|
{
|
|
|
target = await db.TargetInfos.FirstOrDefaultAsync(p => p.TargetName == dto.Target.Trim());
|
|
|
if (target == null)
|
|
@@ -1613,7 +1614,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- using (RHDWPartContext db = RHDWPartContext.GetContext(dto.SigTime, true))
|
|
|
+ using (MySqlContext db=new MySqlContext())
|
|
|
{
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
|
{
|
|
@@ -1700,9 +1701,9 @@ namespace XdCxRhDW.App.Controllers
|
|
|
}
|
|
|
catch (Exception)
|
|
|
{
|
|
|
- using (RHDWPartContext db = RHDWPartContext.GetContext(dto.SigTime, true))
|
|
|
+ using (MySqlContext db=new MySqlContext())
|
|
|
{
|
|
|
- db.SyncDb();
|
|
|
+ //db.SyncDb();
|
|
|
}
|
|
|
throw;
|
|
|
}
|
|
@@ -1719,7 +1720,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
{
|
|
|
TaskInfo runTask;
|
|
|
TargetInfo target = null;
|
|
|
- using (RHDWContext db = RHDWContext.GetContext(true))
|
|
|
+ using (MySqlContext db = new MySqlContext())
|
|
|
{
|
|
|
if (dto.TaskID == null)
|
|
|
{
|
|
@@ -1743,7 +1744,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
}
|
|
|
if (!string.IsNullOrWhiteSpace(dto.Target))
|
|
|
{
|
|
|
- using (RHDWContext db = RHDWContext.GetContext())
|
|
|
+ using (MySqlContext db = new MySqlContext())
|
|
|
{
|
|
|
target = await db.TargetInfos.FirstOrDefaultAsync(p => p.TargetName == dto.Target.Trim());
|
|
|
if (target == null)
|
|
@@ -1799,7 +1800,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
XdCxRhDW.Framework.LogHelper.Error($"推算卫星{dto.Adja2Code}的ECEF星历出错.{ephAdja2.msg}");
|
|
|
return Error<PosResDto>($"推算卫星{dto.Adja2Code}的ECEF星历出错");
|
|
|
}
|
|
|
- using (RHDWPartContext db = RHDWPartContext.GetContext(dto.SigTime, true))
|
|
|
+ using (MySqlContext db=new MySqlContext())
|
|
|
{
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
|
{
|
|
@@ -1890,9 +1891,9 @@ namespace XdCxRhDW.App.Controllers
|
|
|
}
|
|
|
catch (Exception)
|
|
|
{
|
|
|
- using (RHDWPartContext db = RHDWPartContext.GetContext(dto.SigTime, true))
|
|
|
+ using (MySqlContext db=new MySqlContext())
|
|
|
{
|
|
|
- db.SyncDb();
|
|
|
+ //db.SyncDb();
|
|
|
}
|
|
|
throw;
|
|
|
}
|
|
@@ -1909,7 +1910,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
public async Task<AjaxResult<PosResDto>> PosX3TwoDfoAsync(X3TwoDfoPosDto dto)
|
|
|
{
|
|
|
TaskInfo runTask;
|
|
|
- using (RHDWContext db = RHDWContext.GetContext(true))
|
|
|
+ using (MySqlContext db = new MySqlContext())
|
|
|
{
|
|
|
if (dto.TaskID == null)
|
|
|
{
|
|
@@ -1931,7 +1932,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- using (RHDWPartContext db = RHDWPartContext.GetContext(dto.SigTime, true))
|
|
|
+ using (MySqlContext db=new MySqlContext())
|
|
|
{
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
|
{
|
|
@@ -2029,7 +2030,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
public async Task<AjaxResult<PosResDto>> PosX3TwoDfoNoXlAsync(X3TwoDfoNoXlPosDto dto)
|
|
|
{
|
|
|
TaskInfo runTask;
|
|
|
- using (RHDWContext db = RHDWContext.GetContext(true))
|
|
|
+ using (MySqlContext db = new MySqlContext())
|
|
|
{
|
|
|
if (dto.TaskID == null)
|
|
|
{
|
|
@@ -2093,7 +2094,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
XdCxRhDW.Framework.LogHelper.Error($"推算卫星{dto.Adja2Code}的ECEF星历出错.{ephAdja2.msg}");
|
|
|
return Error<PosResDto>($"推算卫星{dto.Adja2Code}的ECEF星历出错");
|
|
|
}
|
|
|
- using (RHDWPartContext db = RHDWPartContext.GetContext(dto.SigTime, true))
|
|
|
+ using (MySqlContext db=new MySqlContext())
|
|
|
{
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
|
{
|
|
@@ -2197,7 +2198,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
public async Task<AjaxResult<PosResDto>> PosX2DtoDfoAsync(X2DtoDfoPosDto dto)
|
|
|
{
|
|
|
TaskInfo runTask;
|
|
|
- using (RHDWContext db = RHDWContext.GetContext(true))
|
|
|
+ using (MySqlContext db = new MySqlContext())
|
|
|
{
|
|
|
if (dto.TaskID == null)
|
|
|
{
|
|
@@ -2219,7 +2220,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- using (RHDWPartContext db = RHDWPartContext.GetContext(dto.SigTime, true))
|
|
|
+ using (MySqlContext db=new MySqlContext())
|
|
|
{
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
|
{
|
|
@@ -2310,7 +2311,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
public async Task<AjaxResult<PosResDto>> PosX2DtoDfoNoXlAsync(X2DtoDfoNoXlPosDto dto)
|
|
|
{
|
|
|
TaskInfo runTask;
|
|
|
- using (RHDWContext db = RHDWContext.GetContext(true))
|
|
|
+ using (MySqlContext db = new MySqlContext())
|
|
|
{
|
|
|
if (dto.TaskID == null)
|
|
|
{
|
|
@@ -2360,7 +2361,7 @@ namespace XdCxRhDW.App.Controllers
|
|
|
XdCxRhDW.Framework.LogHelper.Error($"推算卫星{dto.AdjaCode}的ECEF星历出错.{ephAdja.msg}");
|
|
|
return Error<PosResDto>($"推算卫星{dto.AdjaCode}的ECEF星历出错");
|
|
|
}
|
|
|
- using (RHDWPartContext db = RHDWPartContext.GetContext(dto.SigTime, true))
|
|
|
+ using (MySqlContext db=new MySqlContext())
|
|
|
{
|
|
|
var StationRes = db.StationRes.Add(new StationRes()
|
|
|
{
|