|
|
@ -2088,10 +2088,114 @@ namespace Myshipping.Application
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 爬虫上传船期
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
[HttpGet("/DataSync/SaveSyncVesselDate"), ApiUser(ApiCode = "SaveSyncVesselDate")]
|
|
|
|
|
|
|
|
[SqlSugarUnitOfWork]
|
|
|
|
|
|
|
|
public async Task SaveSyncVesselDate(List<DjyVesselDto> dto)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (var item in dto)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var model = _vesselinfo.Where(x => x.Vessel == item.Vessel && x.Voyno == item.Voyno && x.CARRIERID == item.CARRIERID && x.TenantId == UserManager.TENANT_ID).First();
|
|
|
|
|
|
|
|
model.ETA = item.ETA;
|
|
|
|
|
|
|
|
model.ETD = item.ETD;
|
|
|
|
|
|
|
|
await _vesselinfo.AsUpdateable(model).IgnoreColumns().ExecuteCommandAsync();
|
|
|
|
|
|
|
|
var order = await _rep.AsQueryable().Where(x => x.VESSEL == item.Vessel && x.VOYNO == item.Voyno && x.CARRIERID == item.CARRIERID && x.TenantId == UserManager.TENANT_ID).ToListAsync();
|
|
|
|
|
|
|
|
if (order != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (var it in order)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (it.ETA != item.ETA)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
////添加booking日志
|
|
|
|
|
|
|
|
var bid = await _bookinglog.InsertReturnSnowflakeIdAsync(new BookingLog
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Type = "Edit",
|
|
|
|
|
|
|
|
BookingId = it.Id,
|
|
|
|
|
|
|
|
TenantId = Convert.ToInt64(UserManager.TENANT_ID),
|
|
|
|
|
|
|
|
CreatedTime = DateTime.Now,
|
|
|
|
|
|
|
|
CreatedUserId = UserManager.UserId,
|
|
|
|
|
|
|
|
CreatedUserName = UserManager.Name
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
await _bookinglogdetail.InsertReturnSnowflakeIdAsync(new BookingLogDetail
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
PId = bid,
|
|
|
|
|
|
|
|
Field = "ETA",
|
|
|
|
|
|
|
|
OldValue = it.ETA == null ? "" : it.ETA.ToString(),
|
|
|
|
|
|
|
|
NewValue = item.ETA == null ? "" : item.ETA.ToString(),
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
it.ETA = item.ETA;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (it.ETD != item.ETD)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
////添加booking日志
|
|
|
|
|
|
|
|
var bid = await _bookinglog.InsertReturnSnowflakeIdAsync(new BookingLog
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Type = "Edit",
|
|
|
|
|
|
|
|
BookingId = it.Id,
|
|
|
|
|
|
|
|
TenantId = Convert.ToInt64(UserManager.TENANT_ID),
|
|
|
|
|
|
|
|
CreatedTime = DateTime.Now,
|
|
|
|
|
|
|
|
CreatedUserId = UserManager.UserId,
|
|
|
|
|
|
|
|
CreatedUserName = UserManager.Name
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
await _bookinglogdetail.InsertReturnSnowflakeIdAsync(new BookingLogDetail
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
PId = bid,
|
|
|
|
|
|
|
|
Field = "ETD",
|
|
|
|
|
|
|
|
OldValue = it.ETD == null ? "" : it.ETD.ToString(),
|
|
|
|
|
|
|
|
NewValue = item.ETD == null ? "" : item.ETD.ToString(),
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
it.ETD = item.ETD;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
await _rep.AsUpdateable(it).IgnoreColumns().ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 下载数据
|
|
|
|
#region 下载数据
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 爬虫获取船名航次
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
[HttpGet("/DataSync/GetSyncVesselDate"), ApiUser(ApiCode = "GetSyncVesselDate")]
|
|
|
|
|
|
|
|
public async Task<dynamic> GetSyncVesselDate()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var list = await _vesselinfo.AsQueryable().Where(x => x.ETD != null && x.ATD != null && x.TenantId == UserManager.TENANT_ID).Select(x => new DjyVesselDto
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Vessel = x.Vessel,
|
|
|
|
|
|
|
|
Voyno = x.Voyno,
|
|
|
|
|
|
|
|
VoynoInside = x.VoynoInside,
|
|
|
|
|
|
|
|
CARRIER = x.CARRIER,
|
|
|
|
|
|
|
|
CARRIERID = x.CARRIERID,
|
|
|
|
|
|
|
|
ETD = null,
|
|
|
|
|
|
|
|
ETA = null
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}).ToListAsync();
|
|
|
|
|
|
|
|
return list;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|