diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index d55ce212..5100268b 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -74,6 +74,7 @@ namespace Myshipping.Application private readonly SqlSugarRepository _repUser; private readonly SqlSugarRepository _repOrderUrl; private readonly SqlSugarRepository _repOrderContact; + private readonly SqlSugarRepository _repSampleBill; const string CONST_MAPPING_MODULE = "BOOK_OR_CLOSING"; @@ -84,7 +85,7 @@ namespace Myshipping.Application SqlSugarRepository dicdata, SqlSugarRepository statuslog, SqlSugarRepository statuslogdetail, ILogger logger, ISysCacheService cache, SqlSugarRepository repPrintTemplate, SqlSugarRepository repLetterYard, SqlSugarRepository repUser, - SqlSugarRepository repOrderUrl, SqlSugarRepository repOrderContact) + SqlSugarRepository repOrderUrl, SqlSugarRepository repOrderContact, SqlSugarRepository 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 /// /// /// - [HttpGet("/BookingOrder/letteryard")] + [HttpGet("/BookingOrder/LetterYard")] public async Task LetterYard(long bookingId) { var order = _rep.FirstOrDefault(x => x.Id == bookingId); @@ -700,7 +702,7 @@ namespace Myshipping.Application /// /// /// - [HttpPost("/BookingLetteryard/save")] + [HttpPost("/BookingLetteryard/Save")] public async Task Save(UpdateBookingLetteryardInput input) { if (input.Id == 0) @@ -737,7 +739,7 @@ namespace Myshipping.Application /// /// /// - [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 /// /// /// - [HttpGet("/BookingOrder/letteryardpdf")] + [HttpGet("/BookingOrder/LetterYardPdf")] public async Task LetterYardPdf(long bookingId) { return await LetterYardFile(bookingId, 1); @@ -766,7 +768,7 @@ namespace Myshipping.Application /// /// /// - [HttpGet("/BookingOrder/letteryardxlsx")] + [HttpGet("/BookingOrder/LetterYardXlsx")] public async Task LetterYardXlsx(long bookingId) { return await LetterYardFile(bookingId, 2); @@ -873,6 +875,34 @@ namespace Myshipping.Application #region 样单 + /// + /// 样单 + /// + /// + /// + [HttpGet("/BookingOrder/SampleBill")] + public async Task 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(); + + return output; + } #endregion #region 小票链接