订舱状态

booking_auth_dev
wanghaomei 2 years ago
parent 81ae057b32
commit a1e273e1e0

@ -0,0 +1,31 @@
using System;
using SqlSugar;
using System.ComponentModel;
using Myshipping.Core.Entity;
namespace Myshipping.Application.Entity
{
/// <summary>
/// 订舱状态
/// </summary>
[SugarTable("booking_status")]
[Description("订舱状态")]
public class BookingStatus : PrimaryKeyEntity
{
/// <summary>
/// 订舱id
/// </summary>
public long? BookingId { get; set; }
/// <summary>
/// 状态代码
/// </summary>
public string StaCode { get; set; }
/// <summary>
/// 状态名称
/// </summary>
public string StaName { get; set; }
/// <summary>
/// 状态时间
/// </summary>
public DateTime? StaTime { get; set; }
}
}

@ -3301,6 +3301,31 @@
备注 备注
</summary> </summary>
</member> </member>
<member name="T:Myshipping.Application.Entity.BookingStatus">
<summary>
订舱状态
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingStatus.BookingId">
<summary>
订舱id
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingStatus.StaCode">
<summary>
状态代码
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingStatus.StaName">
<summary>
状态名称
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingStatus.StaTime">
<summary>
状态时间
</summary>
</member>
<member name="T:Myshipping.Application.Entity.BookingStatusLog"> <member name="T:Myshipping.Application.Entity.BookingStatusLog">
<summary> <summary>
货运跟踪 货运跟踪
@ -4749,7 +4774,7 @@
</summary> </summary>
<param name="id"></param> <param name="id"></param>
</member> </member>
<member name="M:Myshipping.Application.BookingOrderService.GenReportJson(System.Int64,System.String)"> <member name="M:Myshipping.Application.BookingOrderService.GenReportFile(System.Int64,System.String)">
<summary> <summary>
生成报表文件 生成报表文件
</summary> </summary>
@ -4757,6 +4782,15 @@
<param name="type">类型,对应字典中的【订舱打印模板类型】</param> <param name="type">类型,对应字典中的【订舱打印模板类型】</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Myshipping.Application.BookingOrderService.SaveBookingStatus(System.Int64,System.String,System.String)">
<summary>
记录或更新订舱状态
</summary>
<param name="bookingId"></param>
<param name="code"></param>
<param name="name"></param>
<returns></returns>
</member>
<member name="P:Myshipping.Application.Service.BookingOrder.Dto.BookingLogDto.Type"> <member name="P:Myshipping.Application.Service.BookingOrder.Dto.BookingLogDto.Type">
<summary> <summary>
操作类型(新增,编辑) 操作类型(新增,编辑)

@ -77,6 +77,7 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<BookingSampleBill> _repSampleBill; private readonly SqlSugarRepository<BookingSampleBill> _repSampleBill;
private readonly SqlSugarRepository<DjyUserMailAccount> _repUserMail; private readonly SqlSugarRepository<DjyUserMailAccount> _repUserMail;
private readonly SqlSugarRepository<SysTenant> _repTenant; private readonly SqlSugarRepository<SysTenant> _repTenant;
private readonly SqlSugarRepository<BookingStatus> _repBookingStatus;
const string CONST_MAPPING_MODULE = "BOOK_OR_CLOSING"; const string CONST_MAPPING_MODULE = "BOOK_OR_CLOSING";
@ -88,7 +89,7 @@ namespace Myshipping.Application
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, SqlSugarRepository<BookingOrderContact> repOrderContact, SqlSugarRepository<BookingSampleBill> repSampleBill, SqlSugarRepository<BookingOrderUrl> repOrderUrl, SqlSugarRepository<BookingOrderContact> repOrderContact, SqlSugarRepository<BookingSampleBill> repSampleBill,
SqlSugarRepository<DjyUserMailAccount> repUserMail, SqlSugarRepository<SysTenant> repTenant) SqlSugarRepository<DjyUserMailAccount> repUserMail, SqlSugarRepository<SysTenant> repTenant, SqlSugarRepository<BookingStatus> repBookingStatus)
{ {
this._logger = logger; this._logger = logger;
this._rep = rep; this._rep = rep;
@ -112,6 +113,7 @@ namespace Myshipping.Application
this._repSampleBill = repSampleBill; this._repSampleBill = repSampleBill;
this._repUserMail = repUserMail; this._repUserMail = repUserMail;
this._repTenant = repTenant; this._repTenant = repTenant;
this._repBookingStatus = repBookingStatus;
} }
#region 主表和箱信息 #region 主表和箱信息
@ -820,6 +822,9 @@ namespace Myshipping.Application
bsl.MBLNO = order.MBLNO; bsl.MBLNO = order.MBLNO;
await _repStatuslog.InsertAsync(bsl); await _repStatuslog.InsertAsync(bsl);
//订舱状态
await SaveBookingStatus(bookingId, "sta_letter_yard", "放舱");
#region 发送邮件 #region 发送邮件
var mailSubject = $"放舱信息:{order.MBLNO}/{order.CARRIERID}/{order.VESSEL}/{order.VOYNO}/PO:{order.PONO}/{order.TenantName}"; var mailSubject = $"放舱信息:{order.MBLNO}/{order.CARRIERID}/{order.VESSEL}/{order.VOYNO}/PO:{order.PONO}/{order.TenantName}";
@ -862,6 +867,7 @@ namespace Myshipping.Application
var sendResult = await MailSendHelper.SendMail(mailAcc, mailSubject, mailContent, letterYard.AttnMail); var sendResult = await MailSendHelper.SendMail(mailAcc, mailSubject, mailContent, letterYard.AttnMail);
if (!sendResult.Key) if (!sendResult.Key)
{ {
_logger.LogError($"放舱邮件发送失败:从{mailAcc.MailAccount}到{letterYard.AttnMail},主题 {mailSubject}");
throw Oops.Oh($"邮件发送失败:{sendResult.Value}"); throw Oops.Oh($"邮件发送失败:{sendResult.Value}");
} }
#endregion #endregion
@ -991,6 +997,8 @@ namespace Myshipping.Application
throw Oops.Oh($"发送失败:{rtn.Value}"); throw Oops.Oh($"发送失败:{rtn.Value}");
} }
//订舱状态
await SaveBookingStatus(bookingId, "sta_xhz", "下货纸");
} }
#endregion #endregion
@ -1874,8 +1882,8 @@ namespace Myshipping.Application
/// <param name="id"></param> /// <param name="id"></param>
/// <param name="type">类型,对应字典中的【订舱打印模板类型】</param> /// <param name="type">类型,对应字典中的【订舱打印模板类型】</param>
/// <returns></returns> /// <returns></returns>
[HttpGet("/BookingOrder/GenReportJson")] [HttpGet("/BookingOrder/GenReportFile")]
public async Task<IActionResult> GenReportJson(long id, string type) public async Task<IActionResult> GenReportFile(long id, string type)
{ {
//打印报表服务地址 //打印报表服务地址
var reportUrl = _cache.GetAllDictData().Result.FirstOrDefault(x => x.TypeCode == "url_set" && x.Code == "url_report_generate").Value; var reportUrl = _cache.GetAllDictData().Result.FirstOrDefault(x => x.TypeCode == "url_set" && x.Code == "url_report_generate").Value;
@ -1942,6 +1950,34 @@ namespace Myshipping.Application
} }
} }
/// <summary>
/// 记录或更新订舱状态
/// </summary>
/// <param name="bookingId"></param>
/// <param name="code"></param>
/// <param name="name"></param>
/// <returns></returns>
[NonAction]
public async Task SaveBookingStatus(long bookingId, string code, string name)
{
var bookSta = _repBookingStatus.FirstOrDefault(x => x.BookingId == bookingId && x.StaCode == code);
if (bookSta == null)
{
//记录状态
bookSta = new BookingStatus();
bookSta.BookingId = bookingId;
bookSta.StaCode = "sta_xhz";
bookSta.StaName = "下货纸";
bookSta.StaTime = DateTime.Now;
await _repBookingStatus.InsertAsync(bookSta);
}
else
{
bookSta.StaTime = DateTime.Now;
await _repBookingStatus.UpdateAsync(bookSta);
}
}
#endregion #endregion
} }
} }

Loading…
Cancel
Save