diff --git a/Myshipping.Application/Myshipping.Application.xml b/Myshipping.Application/Myshipping.Application.xml index b0f7835a..ae725a9b 100644 --- a/Myshipping.Application/Myshipping.Application.xml +++ b/Myshipping.Application/Myshipping.Application.xml @@ -3363,6 +3363,13 @@ 类型,1:pdf、2:xlsx + + + 获取提箱小票链接 + + + + 获取用户报表的json diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index f2d55ce7..8fe7d8ee 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -61,13 +61,15 @@ namespace Myshipping.Application private readonly SqlSugarRepository _repPrintTemplate; private readonly SqlSugarRepository _repLetterYard; private readonly SqlSugarRepository _repUser; + private readonly SqlSugarRepository _repOrderUrl; public BookingOrderService(SqlSugarRepository rep, SqlSugarRepository repCtn, SqlSugarRepository ctndetailrep, SqlSugarRepository bookinglog, SqlSugarRepository bookinglogdetail, SqlSugarRepository bookingremark, SqlSugarRepository bookingfile, SqlSugarRepository webconfig, SqlSugarRepository repPrint, SqlSugarRepository dicdata, SqlSugarRepository statuslog, SqlSugarRepository statuslogdetail, ILogger logger, ISysCacheService cache, - SqlSugarRepository repPrintTemplate, SqlSugarRepository repLetterYard, SqlSugarRepository repUser) + SqlSugarRepository repPrintTemplate, SqlSugarRepository repLetterYard, SqlSugarRepository repUser, + SqlSugarRepository repOrderUrl) { this._logger = logger; this._rep = rep; @@ -86,6 +88,7 @@ namespace Myshipping.Application this._repPrintTemplate = repPrintTemplate; this._repLetterYard = repLetterYard; this._repUser = repUser; + this._repOrderUrl = repOrderUrl; } #region 主表和箱信息 @@ -784,6 +787,49 @@ namespace Myshipping.Application #endregion + #region 小票链接 + + /// + /// 获取提箱小票链接 + /// + /// + /// + [HttpGet("/BookingOrder/txxplink")] + public async Task TxxpLink(long bookingId) + { + var order = _rep.FirstOrDefault(x => x.Id == bookingId); + var ordUrl = _repOrderUrl.FirstOrDefault(x => x.BookingId == bookingId); + if (order == null) + { + ordUrl = new BookingOrderUrl(); + ordUrl.BookingId = bookingId; + await _repOrderUrl.InsertAsync(ordUrl); + } + + + //校验船公司 + if (string.IsNullOrEmpty(order.CARRIERID)) + { + throw Oops.Oh(ErrorCode.BOOK118); + } + + //判断船公司是否支持 + var allowCarrier = _cache.GetAllDictData().Result.Where(x => x.TypeCode == "txxp_carrier_list").Select(x => x.Code).ToList(); + if (allowCarrier.Contains(order.CARRIERID)) + { + throw Oops.Oh(ErrorCode.BOOK117); + } + + //亿通账号 + var ytAcc = _webconfig.FirstOrDefault(x => x.CreatedUserId == UserManager.UserId && x.TypeCode == "YitongWeb"); + if(ytAcc == null) + { + throw Oops.Oh(ErrorCode.BOOK119); + } + + } + #endregion + #region 其他 /// /// 获取用户报表的json diff --git a/Myshipping.Core/Enum/ErrorCode.cs b/Myshipping.Core/Enum/ErrorCode.cs index 515242e3..38b38f5b 100644 --- a/Myshipping.Core/Enum/ErrorCode.cs +++ b/Myshipping.Core/Enum/ErrorCode.cs @@ -454,6 +454,24 @@ public enum ErrorCode /// [ErrorCodeItemMetadata("放舱信息不存在")] BOOK116, + + /// + /// 不支持的船公司 + /// + [ErrorCodeItemMetadata("不支持的船公司")] + BOOK117, + + /// + /// 船公司未正确填写 + /// + [ErrorCodeItemMetadata("船公司未正确填写")] + BOOK118, + + /// + /// 亿通账号未正确配置 + /// + [ErrorCodeItemMetadata("亿通账号未正确配置")] + BOOK119, #endregion #region 邮箱账号 diff --git a/Myshipping.Core/Myshipping.Core.xml b/Myshipping.Core/Myshipping.Core.xml index 612bc28b..bbf56f6d 100644 --- a/Myshipping.Core/Myshipping.Core.xml +++ b/Myshipping.Core/Myshipping.Core.xml @@ -3920,6 +3920,21 @@ 放舱信息不存在 + + + 不支持的船公司 + + + + + 船公司未正确填写 + + + + + 亿通账号未正确配置 + + 邮箱账号已存在 @@ -6645,7 +6660,7 @@ - 新增编辑船公司映射信息 + 新增编辑箱型映射信息 @@ -6653,6 +6668,21 @@ 付费方式 + + + 新增付费方式 + + + + + 获取付费映射列表信息 + + + + + 新增编辑付费映射信息 + + 模块 @@ -6734,6 +6764,23 @@ + + + 获取箱型映射 + + + + + + 付费方式 + + + + + + 付费方式映射 + + 获取库表信息