|
|
@ -80,6 +80,7 @@ namespace Myshipping.Application
|
|
|
|
this._statuslogdetail = statuslogdetail;
|
|
|
|
this._statuslogdetail = statuslogdetail;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 主表和箱信息
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 分页查询订舱主表
|
|
|
|
/// 分页查询订舱主表
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -402,7 +403,9 @@ namespace Myshipping.Application
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return list;
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 日志、备注、附件、货运动态等
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 获取日志明细
|
|
|
|
/// 获取日志明细
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -520,6 +523,27 @@ namespace Myshipping.Application
|
|
|
|
return list;
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 获取货运动态
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public async Task<List<BookingStatusLogDto>> GetBookingStatusLog(long Id)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var statuslog = await _statuslog.AsQueryable().Where(x => x.BookingId == Id).ToListAsync();
|
|
|
|
|
|
|
|
var dto = statuslog.Adapt<List<BookingStatusLogDto>>();
|
|
|
|
|
|
|
|
foreach (var item in dto)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var detail = await _statuslogdetail.AsQueryable().Where(x => x.PId == item.Id).ToListAsync();
|
|
|
|
|
|
|
|
item.detail = detail.Adapt<List<BookingStatusLogDetailDto>>();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return dto;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 运踪
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 调用运踪接口
|
|
|
|
/// 调用运踪接口
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -550,6 +574,60 @@ namespace Myshipping.Application
|
|
|
|
_logger.LogInformation("提单号:" + MBLNO + " 调用运踪接口返回" + html.ToJsonString());
|
|
|
|
_logger.LogInformation("提单号:" + MBLNO + " 调用运踪接口返回" + html.ToJsonString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 插入货运动态
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
|
|
|
[SqlSugarUnitOfWork]
|
|
|
|
|
|
|
|
public async Task AddBookingStatusLog(List<BookingStatusLogDto> all)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var item in all)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//清空原有数据
|
|
|
|
|
|
|
|
var old = await _statuslog.AsQueryable().Where(x => x.BookingId == item.BookingId && x.Gategory == "ship").ToListAsync();
|
|
|
|
|
|
|
|
await _statuslog.DeleteAsync(x => x.BookingId == item.BookingId && x.Gategory == "ship");
|
|
|
|
|
|
|
|
foreach (var ot in old)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
await _statuslogdetail.DeleteAsync(x => x.PId == ot.Id);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//新增数据
|
|
|
|
|
|
|
|
var bookingStatusLog = new BookingStatusLog();
|
|
|
|
|
|
|
|
bookingStatusLog.BookingId = item.BookingId;
|
|
|
|
|
|
|
|
bookingStatusLog.Gategory = "ship";
|
|
|
|
|
|
|
|
bookingStatusLog.CreatedTime = DateTime.Now;
|
|
|
|
|
|
|
|
bookingStatusLog.Status = item.Status;
|
|
|
|
|
|
|
|
bookingStatusLog.OpTiem = item.OpTiem;
|
|
|
|
|
|
|
|
bookingStatusLog.MBLNO = item.MBLNO;
|
|
|
|
|
|
|
|
var id = await _statuslog.InsertReturnSnowflakeIdAsync(bookingStatusLog);
|
|
|
|
|
|
|
|
if (item.detail != null && item.detail.Count > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (var dt in item.detail)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var BookingStatusLogDetail = new BookingStatusLogDetail();
|
|
|
|
|
|
|
|
BookingStatusLogDetail.PId = id;
|
|
|
|
|
|
|
|
BookingStatusLogDetail.Status = dt.Status;
|
|
|
|
|
|
|
|
BookingStatusLogDetail.CNTRNO = dt.CNTRNO;
|
|
|
|
|
|
|
|
BookingStatusLogDetail.OPTime = dt.OPTime;
|
|
|
|
|
|
|
|
await _statuslogdetail.InsertAsync(BookingStatusLogDetail);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 下货纸
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 样单
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 其他
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 获取用户报表的json
|
|
|
|
/// 获取用户报表的json
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -645,71 +723,6 @@ namespace Myshipping.Application
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
//[HttpGet("/BookingPrintTemplate/test")]
|
|
|
|
|
|
|
|
//public async Task<string> Test(long id)
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// var rtn = XiahuozhiHelpler.Send(id, "9", out string msg);
|
|
|
|
|
|
|
|
// return $"{rtn} {msg}";
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 获取货运动态
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public async Task<List<BookingStatusLogDto>> GetBookingStatusLog(long Id)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var statuslog = await _statuslog.AsQueryable().Where(x => x.BookingId == Id).ToListAsync();
|
|
|
|
|
|
|
|
var dto = statuslog.Adapt<List<BookingStatusLogDto>>();
|
|
|
|
|
|
|
|
foreach (var item in dto)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var detail = await _statuslogdetail.AsQueryable().Where(x => x.PId == item.Id).ToListAsync();
|
|
|
|
|
|
|
|
item.detail = detail.Adapt<List<BookingStatusLogDetailDto>>();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return dto;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 插入货运动态
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
|
|
|
[SqlSugarUnitOfWork]
|
|
|
|
|
|
|
|
public async Task AddBookingStatusLog(List<BookingStatusLogDto> all)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var item in all)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//清空原有数据
|
|
|
|
|
|
|
|
var old = await _statuslog.AsQueryable().Where(x => x.BookingId == item.BookingId && x.Gategory == "ship").ToListAsync();
|
|
|
|
|
|
|
|
await _statuslog.DeleteAsync(x => x.BookingId == item.BookingId && x.Gategory == "ship");
|
|
|
|
|
|
|
|
foreach (var ot in old)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
await _statuslogdetail.DeleteAsync(x => x.PId == ot.Id);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//新增数据
|
|
|
|
|
|
|
|
var bookingStatusLog = new BookingStatusLog();
|
|
|
|
|
|
|
|
bookingStatusLog.BookingId = item.BookingId;
|
|
|
|
|
|
|
|
bookingStatusLog.Gategory = "ship";
|
|
|
|
|
|
|
|
bookingStatusLog.CreatedTime = DateTime.Now;
|
|
|
|
|
|
|
|
bookingStatusLog.Status = item.Status;
|
|
|
|
|
|
|
|
bookingStatusLog.OpTiem = item.OpTiem;
|
|
|
|
|
|
|
|
bookingStatusLog.MBLNO = item.MBLNO;
|
|
|
|
|
|
|
|
var id = await _statuslog.InsertReturnSnowflakeIdAsync(bookingStatusLog);
|
|
|
|
|
|
|
|
if (item.detail != null && item.detail.Count > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (var dt in item.detail)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var BookingStatusLogDetail = new BookingStatusLogDetail();
|
|
|
|
|
|
|
|
BookingStatusLogDetail.PId = id;
|
|
|
|
|
|
|
|
BookingStatusLogDetail.Status = dt.Status;
|
|
|
|
|
|
|
|
BookingStatusLogDetail.CNTRNO = dt.CNTRNO;
|
|
|
|
|
|
|
|
BookingStatusLogDetail.OPTime = dt.OPTime;
|
|
|
|
|
|
|
|
await _statuslogdetail.InsertAsync(BookingStatusLogDetail);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|