|
|
@ -61,13 +61,15 @@ namespace Myshipping.Application
|
|
|
|
private readonly SqlSugarRepository<BookingPrintTemplate> _repPrintTemplate;
|
|
|
|
private readonly SqlSugarRepository<BookingPrintTemplate> _repPrintTemplate;
|
|
|
|
private readonly SqlSugarRepository<BookingLetteryard> _repLetterYard;
|
|
|
|
private readonly SqlSugarRepository<BookingLetteryard> _repLetterYard;
|
|
|
|
private readonly SqlSugarRepository<SysUser> _repUser;
|
|
|
|
private readonly SqlSugarRepository<SysUser> _repUser;
|
|
|
|
|
|
|
|
private readonly SqlSugarRepository<BookingOrderUrl> _repOrderUrl;
|
|
|
|
|
|
|
|
|
|
|
|
public BookingOrderService(SqlSugarRepository<BookingOrder> rep, SqlSugarRepository<BookingCtn> repCtn, SqlSugarRepository<BookingCtnDetail> ctndetailrep,
|
|
|
|
public BookingOrderService(SqlSugarRepository<BookingOrder> rep, SqlSugarRepository<BookingCtn> repCtn, SqlSugarRepository<BookingCtnDetail> ctndetailrep,
|
|
|
|
SqlSugarRepository<BookingLog> bookinglog, SqlSugarRepository<BookingLogDetail> bookinglogdetail, SqlSugarRepository<BookingRemark> bookingremark,
|
|
|
|
SqlSugarRepository<BookingLog> bookinglog, SqlSugarRepository<BookingLogDetail> bookinglogdetail, SqlSugarRepository<BookingRemark> bookingremark,
|
|
|
|
SqlSugarRepository<BookingFile> bookingfile, SqlSugarRepository<DjyWebsiteAccountConfig> webconfig, SqlSugarRepository<BookingPrintTemplate> repPrint,
|
|
|
|
SqlSugarRepository<BookingFile> bookingfile, SqlSugarRepository<DjyWebsiteAccountConfig> webconfig, SqlSugarRepository<BookingPrintTemplate> repPrint,
|
|
|
|
SqlSugarRepository<SysDictData> dicdata, SqlSugarRepository<BookingStatusLog> statuslog, SqlSugarRepository<BookingStatusLogDetail> statuslogdetail,
|
|
|
|
SqlSugarRepository<SysDictData> dicdata, SqlSugarRepository<BookingStatusLog> statuslog, SqlSugarRepository<BookingStatusLogDetail> statuslogdetail,
|
|
|
|
ILogger<BookingOrderService> logger, ISysCacheService cache,
|
|
|
|
ILogger<BookingOrderService> logger, ISysCacheService cache,
|
|
|
|
SqlSugarRepository<BookingPrintTemplate> repPrintTemplate, SqlSugarRepository<BookingLetteryard> repLetterYard, SqlSugarRepository<SysUser> repUser)
|
|
|
|
SqlSugarRepository<BookingPrintTemplate> repPrintTemplate, SqlSugarRepository<BookingLetteryard> repLetterYard, SqlSugarRepository<SysUser> repUser,
|
|
|
|
|
|
|
|
SqlSugarRepository<BookingOrderUrl> repOrderUrl)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this._logger = logger;
|
|
|
|
this._logger = logger;
|
|
|
|
this._rep = rep;
|
|
|
|
this._rep = rep;
|
|
|
@ -86,6 +88,7 @@ namespace Myshipping.Application
|
|
|
|
this._repPrintTemplate = repPrintTemplate;
|
|
|
|
this._repPrintTemplate = repPrintTemplate;
|
|
|
|
this._repLetterYard = repLetterYard;
|
|
|
|
this._repLetterYard = repLetterYard;
|
|
|
|
this._repUser = repUser;
|
|
|
|
this._repUser = repUser;
|
|
|
|
|
|
|
|
this._repOrderUrl = repOrderUrl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region 主表和箱信息
|
|
|
|
#region 主表和箱信息
|
|
|
@ -784,6 +787,49 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 小票链接
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 获取提箱小票链接
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="bookingId"></param>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
[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 其他
|
|
|
|
#region 其他
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 获取用户报表的json
|
|
|
|
/// 获取用户报表的json
|
|
|
|