下货纸、链接、样单

booking_auth_dev
wanghaomei 2 years ago
parent 2cc36f4e0f
commit 81fb3d49af

@ -0,0 +1,67 @@
using System;
using SqlSugar;
using System.ComponentModel;
using Myshipping.Core.Entity;
namespace Myshipping.Application.Entity
{
/// <summary>
/// 下货纸
/// </summary>
[SugarTable("booking_letter_yard")]
[Description("下货纸")]
public class BookingLetteryard : DBEntityTenant
{
/// <summary>
/// 订舱ID
/// </summary>
public long? BookingId { get; set; }
/// <summary>
/// TO
/// </summary>
public string ToName { get; set; }
/// <summary>
/// ATTN
/// </summary>
public string Attn { get; set; }
/// <summary>
/// ATTN电话
/// </summary>
public string AttnTel { get; set; }
/// <summary>
/// ATTN邮箱
/// </summary>
public string AttnMail { get; set; }
/// <summary>
/// FROM
/// </summary>
public string FromName { get; set; }
/// <summary>
/// FROM电话
/// </summary>
public string FromTel { get; set; }
/// <summary>
/// FROM邮箱
/// </summary>
public string FromMail { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 截单时间
/// </summary>
public DateTime? CloseDocTime { get; set; }
/// <summary>
/// 截港时间
/// </summary>
public DateTime? ClosingTime { get; set; }
/// <summary>
/// 截VGM时间
/// </summary>
public DateTime? VgmTime { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -0,0 +1,31 @@
using System;
using SqlSugar;
using System.ComponentModel;
using Myshipping.Core.Entity;
namespace Myshipping.Application.Entity
{
/// <summary>
/// 订舱链接
/// </summary>
[SugarTable("booking_order_url")]
[Description("订舱链接")]
public class BookingOrderUrl : DBEntityTenant
{
/// <summary>
/// 订舱ID
/// </summary>
public long? BookingId { get; set; }
/// <summary>
/// 提箱小票链接
/// </summary>
public string UrlTxxp { get; set; }
/// <summary>
/// VGM链接
/// </summary>
public string UrlVgm { get; set; }
/// <summary>
/// VGM&SI链接
/// </summary>
public string UrlVgmSi { get; set; }
}
}

@ -0,0 +1,55 @@
using System;
using SqlSugar;
using System.ComponentModel;
using Myshipping.Core.Entity;
namespace Myshipping.Application.Entity
{
/// <summary>
/// 订舱样单
/// </summary>
[SugarTable("booking_sample_bill")]
[Description("订舱样单")]
public class BookingSampleBill : DBEntityTenant
{
/// <summary>
/// 订舱ID
/// </summary>
public long? BookingId { get; set; }
/// <summary>
/// TO
/// </summary>
public string ToName { get; set; }
/// <summary>
/// ATTN
/// </summary>
public string Attn { get; set; }
/// <summary>
/// ATTN电话
/// </summary>
public string AttnTel { get; set; }
/// <summary>
/// ATTN邮箱
/// </summary>
public string AttnMail { get; set; }
/// <summary>
/// FROM
/// </summary>
public string FromName { get; set; }
/// <summary>
/// FROM电话
/// </summary>
public string FromTel { get; set; }
/// <summary>
/// FROM邮箱
/// </summary>
public string FromMail { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -1435,6 +1435,76 @@
租户 租户
</summary> </summary>
</member> </member>
<member name="T:Myshipping.Application.Entity.BookingLetteryard">
<summary>
下货纸
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.BookingId">
<summary>
订舱ID
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.ToName">
<summary>
TO
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.Attn">
<summary>
ATTN
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.AttnTel">
<summary>
ATTN电话
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.AttnMail">
<summary>
ATTN邮箱
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.FromName">
<summary>
FROM
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.FromTel">
<summary>
FROM电话
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.FromMail">
<summary>
FROM邮箱
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.Description">
<summary>
描述
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.CloseDocTime">
<summary>
截单时间
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.ClosingTime">
<summary>
截港时间
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.VgmTime">
<summary>
截VGM时间
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.Remark">
<summary>
备注
</summary>
</member>
<member name="T:Myshipping.Application.Entity.BookingLog"> <member name="T:Myshipping.Application.Entity.BookingLog">
<summary> <summary>
舱单日志 舱单日志
@ -2220,6 +2290,27 @@
主单ID 主单ID
</summary> </summary>
</member> </member>
<member name="T:Myshipping.Application.Entity.BookingOrderUrl">
<summary>
订舱链接
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingOrderUrl.BookingId">
<summary>
订舱ID
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingOrderUrl.UrlTxxp">
<summary>
提箱小票链接
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingOrderUrl.UrlVgm">
<summary>
VGM链接
</summary>
</member>
<!-- Badly formed XML comment ignored for member "P:Myshipping.Application.Entity.BookingOrderUrl.UrlVgmSi" -->
<member name="T:Myshipping.Application.Entity.BookingPrintTemplate"> <member name="T:Myshipping.Application.Entity.BookingPrintTemplate">
<summary> <summary>
订舱打印模板 订舱打印模板
@ -2265,6 +2356,61 @@
订舱备注 订舱备注
</summary> </summary>
</member> </member>
<member name="T:Myshipping.Application.Entity.BookingSampleBill">
<summary>
订舱样单
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingSampleBill.BookingId">
<summary>
订舱ID
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingSampleBill.ToName">
<summary>
TO
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingSampleBill.Attn">
<summary>
ATTN
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingSampleBill.AttnTel">
<summary>
ATTN电话
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingSampleBill.AttnMail">
<summary>
ATTN邮箱
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingSampleBill.FromName">
<summary>
FROM
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingSampleBill.FromTel">
<summary>
FROM电话
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingSampleBill.FromMail">
<summary>
FROM邮箱
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingSampleBill.Description">
<summary>
描述
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingSampleBill.Remark">
<summary>
备注
</summary>
</member>
<member name="T:Myshipping.Application.Entity.BookingStatusLog"> <member name="T:Myshipping.Application.Entity.BookingStatusLog">
<summary> <summary>
货运跟踪 货运跟踪
@ -3166,11 +3312,21 @@
<param name="Id"></param> <param name="Id"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Myshipping.Application.BookingOrderService.GetBookingStatusLog(System.Int64)">
<summary>
获取货运动态
</summary>
</member>
<member name="M:Myshipping.Application.BookingOrderService.SendTrace(System.String,System.String,System.String,System.String)"> <member name="M:Myshipping.Application.BookingOrderService.SendTrace(System.String,System.String,System.String,System.String)">
<summary> <summary>
调用运踪接口 调用运踪接口
</summary> </summary>
</member> </member>
<member name="M:Myshipping.Application.BookingOrderService.AddBookingStatusLog(System.Collections.Generic.List{Myshipping.Application.Service.BookingOrder.Dto.BookingStatusLogDto})">
<summary>
插入货运动态
</summary>
</member>
<member name="M:Myshipping.Application.BookingOrderService.GenReportJson(System.Int64)"> <member name="M:Myshipping.Application.BookingOrderService.GenReportJson(System.Int64)">
<summary> <summary>
获取用户报表的json 获取用户报表的json
@ -3185,16 +3341,6 @@
<param name="type">类型,对应字典中的【订舱打印模板类型】</param> <param name="type">类型,对应字典中的【订舱打印模板类型】</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Myshipping.Application.BookingOrderService.GetBookingStatusLog(System.Int64)">
<summary>
获取货运动态
</summary>
</member>
<member name="M:Myshipping.Application.BookingOrderService.AddBookingStatusLog(System.Collections.Generic.List{Myshipping.Application.Service.BookingOrder.Dto.BookingStatusLogDto})">
<summary>
插入货运动态
</summary>
</member>
<member name="P:Myshipping.Application.Service.BookingOrder.Dto.BookingLogDto.Type"> <member name="P:Myshipping.Application.Service.BookingOrder.Dto.BookingLogDto.Type">
<summary> <summary>
操作类型(新增,编辑) 操作类型(新增,编辑)

@ -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);
}
}
}
}
} }
} }

Loading…
Cancel
Save