|
|
|
@ -74,6 +74,7 @@ namespace Myshipping.Application
|
|
|
|
|
private readonly SqlSugarRepository<SysUser> _repUser;
|
|
|
|
|
private readonly SqlSugarRepository<BookingOrderUrl> _repOrderUrl;
|
|
|
|
|
private readonly SqlSugarRepository<BookingOrderContact> _repOrderContact;
|
|
|
|
|
private readonly SqlSugarRepository<BookingSampleBill> _repSampleBill;
|
|
|
|
|
|
|
|
|
|
const string CONST_MAPPING_MODULE = "BOOK_OR_CLOSING";
|
|
|
|
|
|
|
|
|
@ -84,7 +85,7 @@ namespace Myshipping.Application
|
|
|
|
|
SqlSugarRepository<SysDictData> dicdata, SqlSugarRepository<BookingStatusLog> statuslog, SqlSugarRepository<BookingStatusLogDetail> statuslogdetail,
|
|
|
|
|
ILogger<BookingOrderService> logger, ISysCacheService cache,
|
|
|
|
|
SqlSugarRepository<BookingPrintTemplate> repPrintTemplate, SqlSugarRepository<BookingLetteryard> repLetterYard, SqlSugarRepository<SysUser> repUser,
|
|
|
|
|
SqlSugarRepository<BookingOrderUrl> repOrderUrl, SqlSugarRepository<BookingOrderContact> repOrderContact)
|
|
|
|
|
SqlSugarRepository<BookingOrderUrl> repOrderUrl, SqlSugarRepository<BookingOrderContact> repOrderContact, SqlSugarRepository<BookingSampleBill> repSampleBill)
|
|
|
|
|
{
|
|
|
|
|
this._logger = logger;
|
|
|
|
|
this._rep = rep;
|
|
|
|
@ -105,6 +106,7 @@ namespace Myshipping.Application
|
|
|
|
|
this._repUser = repUser;
|
|
|
|
|
this._repOrderUrl = repOrderUrl;
|
|
|
|
|
this._repOrderContact = repOrderContact;
|
|
|
|
|
this._repSampleBill = repSampleBill;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 主表和箱信息
|
|
|
|
@ -664,7 +666,7 @@ namespace Myshipping.Application
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="bookingId"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet("/BookingOrder/letteryard")]
|
|
|
|
|
[HttpGet("/BookingOrder/LetterYard")]
|
|
|
|
|
public async Task<UpdateBookingLetteryardOutput> LetterYard(long bookingId)
|
|
|
|
|
{
|
|
|
|
|
var order = _rep.FirstOrDefault(x => x.Id == bookingId);
|
|
|
|
@ -700,7 +702,7 @@ namespace Myshipping.Application
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="input"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost("/BookingLetteryard/save")]
|
|
|
|
|
[HttpPost("/BookingLetteryard/Save")]
|
|
|
|
|
public async Task Save(UpdateBookingLetteryardInput input)
|
|
|
|
|
{
|
|
|
|
|
if (input.Id == 0)
|
|
|
|
@ -737,7 +739,7 @@ namespace Myshipping.Application
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="bookingId"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost("/BookingLetteryard/sendletteryard")]
|
|
|
|
|
[HttpPost("/BookingLetteryard/SendLetterYard")]
|
|
|
|
|
public async Task SendLetterYard(long bookingId)
|
|
|
|
|
{
|
|
|
|
|
var order = _rep.FirstOrDefault(x => x.Id == bookingId);
|
|
|
|
@ -755,7 +757,7 @@ namespace Myshipping.Application
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="bookingId"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet("/BookingOrder/letteryardpdf")]
|
|
|
|
|
[HttpGet("/BookingOrder/LetterYardPdf")]
|
|
|
|
|
public async Task<IActionResult> LetterYardPdf(long bookingId)
|
|
|
|
|
{
|
|
|
|
|
return await LetterYardFile(bookingId, 1);
|
|
|
|
@ -766,7 +768,7 @@ namespace Myshipping.Application
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="bookingId"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet("/BookingOrder/letteryardxlsx")]
|
|
|
|
|
[HttpGet("/BookingOrder/LetterYardXlsx")]
|
|
|
|
|
public async Task<IActionResult> LetterYardXlsx(long bookingId)
|
|
|
|
|
{
|
|
|
|
|
return await LetterYardFile(bookingId, 2);
|
|
|
|
@ -873,6 +875,34 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
#region 样单
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 样单
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="bookingId"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet("/BookingOrder/SampleBill")]
|
|
|
|
|
public async Task<UpdateBookingLetteryardOutput> SampleBill(long bookingId)
|
|
|
|
|
{
|
|
|
|
|
var order = _rep.FirstOrDefault(x => x.Id == bookingId);
|
|
|
|
|
var samp = await _repSampleBill.FirstOrDefaultAsync(x => x.BookingId == bookingId);
|
|
|
|
|
if (samp == null)
|
|
|
|
|
{
|
|
|
|
|
var user = _repUser.FirstOrDefault(x => x.Id == UserManager.UserId);
|
|
|
|
|
samp = new BookingSampleBill()
|
|
|
|
|
{
|
|
|
|
|
BookingId = bookingId,
|
|
|
|
|
Description = order.DESCRIPTION,
|
|
|
|
|
FromName = user.Name,
|
|
|
|
|
FromTel = user.Tel,
|
|
|
|
|
FromMail = user.Email,
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var output = samp.Adapt<UpdateBookingLetteryardOutput>();
|
|
|
|
|
|
|
|
|
|
return output;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 小票链接
|
|
|
|
|