diff --git a/Myshipping.Application/Entity/TaskManagePlat/TaskRouteChangeAdvisoryInfo.cs b/Myshipping.Application/Entity/TaskManagePlat/TaskRouteChangeAdvisoryInfo.cs
index 6727d784..648eef0c 100644
--- a/Myshipping.Application/Entity/TaskManagePlat/TaskRouteChangeAdvisoryInfo.cs
+++ b/Myshipping.Application/Entity/TaskManagePlat/TaskRouteChangeAdvisoryInfo.cs
@@ -91,6 +91,11 @@ namespace Myshipping.Application
///
public string EMAIL_SUBJECT { get; set; }
+ ///
+ /// 周数
+ ///
+ public int WEEK { get; set; }
+
///
/// 装货港代码
///
diff --git a/Myshipping.Application/Enum/TaskBaseTypeEnum.cs b/Myshipping.Application/Enum/TaskBaseTypeEnum.cs
index 4e1952a6..0a1167d7 100644
--- a/Myshipping.Application/Enum/TaskBaseTypeEnum.cs
+++ b/Myshipping.Application/Enum/TaskBaseTypeEnum.cs
@@ -176,5 +176,10 @@ namespace Myshipping.Application
///
[Description("航线截止时间调整")]
ROUTE_CUT_CHANGE,
+ ///
+ /// 装货港未提箱
+ ///
+ [Description("装货港未提箱")]
+ POL_CTN_NOT_PICKUP,
}
}
diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/Advisory/TaskRouteChangeAdvisoryShowDto.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/Advisory/TaskRouteChangeAdvisoryShowDto.cs
index 647677f0..5aeeff3a 100644
--- a/Myshipping.Application/Service/TaskManagePlat/Dtos/Advisory/TaskRouteChangeAdvisoryShowDto.cs
+++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/Advisory/TaskRouteChangeAdvisoryShowDto.cs
@@ -6,6 +6,9 @@ using System.Threading.Tasks;
namespace Myshipping.Application
{
+ ///
+ /// 船舶相关截止时间的通知
+ ///
public class TaskRouteChangeAdvisoryShowDto
{
///
@@ -42,7 +45,7 @@ namespace Myshipping.Application
///
/// 预计离港时间
///
- public DateTime origETD { get; set; }
+ public Nullable origETD { get; set; }
///
/// 完整 MDGF 截止时间/冻柜/开顶柜/框架箱/超限货物最晚提箱时间:
@@ -80,10 +83,20 @@ namespace Myshipping.Application
public Nullable CYCutDate { get; set; }
///
- /// 启运港名称
+ /// 读取装货港名称
///
public string LoadPortName { get; set; }
+ ///
+ /// 装货港ID
+ ///
+ public string LoadPortId { get; set; }
+
+ ///
+ /// 装货港名称
+ ///
+ public string LoadPort { get; set; }
+
///
/// 航线代码
///
@@ -93,5 +106,61 @@ namespace Myshipping.Application
/// 创建日期
///
public DateTime CreateTime { get; set; }
+
+ ///
+ /// 通知标题
+ ///
+ public string AdvisoryTitle { get; set; }
+
+ ///
+ /// 相关订舱列表
+ ///
+ public List BuisList { get; set; }
+ }
+
+ ///
+ /// 船舶相关截止时间的通知订单明细
+ ///
+ public class TaskRouteChangeAdvisoryBusiShowDto
+ {
+ ///
+ /// 主键
+ ///
+ public string PKId { get; set; }
+
+ ///
+ /// 订舱订单ID
+ ///
+ public long BookingId { get; set; }
+
+ ///
+ /// 提单号
+ ///
+ public string MBlNo { get; set; }
+
+ ///
+ /// 是否已转发客户 true-是 false-否
+ ///
+ public bool IsTransferUser { get; set; }
+
+ ///
+ /// 最后转发客户邮件时间
+ ///
+ public Nullable LstTransferUserDate { get; set; }
+
+ ///
+ /// 最后转发客户邮件结果
+ ///
+ public string LstTransferNote { get; set; }
+
+ ///
+ /// 往来单位名称
+ ///
+ public string CustomerName { get; set; }
+
+ ///
+ /// 是否有效(true-可以点击发送 false-不能点击发送)
+ ///
+ public bool IsEnable { get; set; }
}
}
diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderPOLCtnNotPickUpInfo.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderPOLCtnNotPickUpInfo.cs
new file mode 100644
index 00000000..9365b74c
--- /dev/null
+++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderPOLCtnNotPickUpInfo.cs
@@ -0,0 +1,64 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Myshipping.Application
+{
+ ///
+ /// 装货港未提箱
+ ///
+ public class TaskManageOrderPOLCtnNotPickUpInfo
+ {
+ ///
+ /// 船名
+ ///
+ public string Vessel { get; set; }
+
+ ///
+ /// 航次
+ ///
+ public string Voyno { get; set; }
+
+ ///
+ /// 船公司
+ ///
+ public string Carrier { get; set; }
+
+ ///
+ /// 订舱号
+ ///
+ public string ShipmentNumber { get; set; }
+
+ ///
+ /// 订舱抬头
+ ///
+ public string BookedByCustomerName { get; set; }
+
+ ///
+ /// 订舱参考号
+ ///
+ public string BookedByReference { get; set; }
+
+ ///
+ /// 合约抬头
+ ///
+ public string PriceOwnerName { get; set; }
+
+ ///
+ /// 批次号
+ ///
+ public string BatchNo { get; set; }
+
+ ///
+ /// 预甩的明细总票数
+ ///
+ public int TotalNum { get; set; }
+
+ ///
+ /// 预甩的明细单票总票数
+ ///
+ public int PerTotalNum { get; set; }
+ }
+}
diff --git a/Myshipping.Application/Service/TaskManagePlat/RouteChangeAdvisoryService.cs b/Myshipping.Application/Service/TaskManagePlat/RouteChangeAdvisoryService.cs
index 91c21e96..287fb3c8 100644
--- a/Myshipping.Application/Service/TaskManagePlat/RouteChangeAdvisoryService.cs
+++ b/Myshipping.Application/Service/TaskManagePlat/RouteChangeAdvisoryService.cs
@@ -12,6 +12,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Furion.FriendlyException;
+using NPOI.POIFS.Storage;
namespace Myshipping.Application
{
@@ -27,23 +28,27 @@ namespace Myshipping.Application
private readonly SqlSugarRepository _taskRouteChangeAdvisoryInfoRepository;
private readonly SqlSugarRepository _taskRouteChangeAdvisoryDetailInfoRepository;
private readonly SqlSugarRepository _djyUserMailAccount;
+ private readonly SqlSugarRepository _bookingOrderRepository;
public RouteChangeAdvisoryService(ISysCacheService cache, ILogger logger,
SqlSugarRepository taskBaseRepository,
SqlSugarRepository taskRouteChangeAdvisoryInfoRepository,
SqlSugarRepository taskRouteChangeAdvisoryDetailInfoRepository,
- SqlSugarRepository djyUserMailAccount)
+ SqlSugarRepository djyUserMailAccount,
+ SqlSugarRepository bookingOrderRepository)
{
_cache = cache;
_logger = logger;
_taskBaseRepository = taskBaseRepository;
_taskRouteChangeAdvisoryInfoRepository = taskRouteChangeAdvisoryInfoRepository;
- _taskRouteChangeAdvisoryDetailInfoRepository = _taskRouteChangeAdvisoryDetailInfoRepository;
+ _taskRouteChangeAdvisoryDetailInfoRepository = taskRouteChangeAdvisoryDetailInfoRepository;
_djyUserMailAccount = djyUserMailAccount;
+ _bookingOrderRepository = bookingOrderRepository;
}
+ #region 获取船舶相关截止时间的通知详情
///
/// 获取船舶相关截止时间的通知详情
///
@@ -63,6 +68,8 @@ namespace Myshipping.Application
if (advisoryInfo == null)
throw Oops.Oh($"船舶相关截止时间的通知主键{taskPkId}无法获取业务信息");
+ var detailList = _taskRouteChangeAdvisoryDetailInfoRepository.AsQueryable()
+ .Where(a => a.P_ID == advisoryInfo.PK_ID).ToList();
dto = new TaskRouteChangeAdvisoryShowDto
{
@@ -70,12 +77,85 @@ namespace Myshipping.Application
TaskPKId = advisoryInfo.TASK_ID,
CarrierId = advisoryInfo.CARRIER,
CreateTime = advisoryInfo.CreatedTime,
+ AdvisoryTitle = advisoryInfo.EMAIL_SUBJECT,
+ CYCutDate = advisoryInfo.CY_CUT_DATE,
+ ETA = advisoryInfo.ETA,
+ ETD = advisoryInfo.ETD,
+ MDGFCutDate = advisoryInfo.MDGF_CUT_DATE,
+ origETD = advisoryInfo.ORIG_ETD,
+ RouteCode = advisoryInfo.ROUTE_CODE,
+ SICutDate = advisoryInfo.SI_CUT_DATE,
+ Vessel = advisoryInfo.VESSEL,
+ Voyno = advisoryInfo.VOYNO,
+ VGMCutDate = advisoryInfo.VGM_CUTOFF_TIME,
+ Week = advisoryInfo.WEEK,
+ TerminalShiftCutDate = advisoryInfo.TM_SHIFT_CUT_DATE,
+ LoadPort = advisoryInfo.READ_PORTLOAD,
+ LoadPortId = advisoryInfo.PORTLOADID,
+ LoadPortName = advisoryInfo.PORTLOAD,
+ BuisList = new List()
};
+ if(detailList.Count > 0)
+ {
+ var queryList = detailList.Where(a => a.BOOKING_ID.HasValue).Select(a => a.BOOKING_ID.Value).ToList();
+
+ if(queryList.Count > 0)
+ {
+ //查询整船的订舱订单列表
+ var bookList = _bookingOrderRepository.AsQueryable().Where(a => queryList.Contains(a.Id) && a.IsDeleted == false).ToList();
+
+ dto.BuisList = detailList.Select(p => {
+
+ TaskRouteChangeAdvisoryBusiShowDto detail = new TaskRouteChangeAdvisoryBusiShowDto {
+ PKId = p.PK_ID,
+ LstTransferUserDate = p.LST_TRANSFER_USER_DATE,
+ IsTransferUser = p.IS_TRANSFER_USER,
+ LstTransferNote = p.LST_TRANSFER_NOTES,
+ BookingId = p.BOOKING_ID.Value,
+ IsEnable = true
+ };
+
+ var bookInfo = bookList.FirstOrDefault(x => x.Id == p.BOOKING_ID.Value);
+
+ if (bookInfo != null)
+ {
+ detail.CustomerName = bookInfo.CUSTOMERNAME;
+ detail.MBlNo = bookInfo.MBLNO;
+ }
+ else
+ {
+ //如果对应的订舱已被作废,只能标记不可发送
+ detail.IsEnable = false;
+ }
+
+ return detail;
+ }).ToList();
+ }
+ else
+ {
+ dto.BuisList = detailList.Select(p => {
+
+ TaskRouteChangeAdvisoryBusiShowDto detail = new TaskRouteChangeAdvisoryBusiShowDto
+ {
+ PKId = p.PK_ID,
+ LstTransferUserDate = p.LST_TRANSFER_USER_DATE,
+ IsTransferUser = p.IS_TRANSFER_USER,
+ LstTransferNote = p.LST_TRANSFER_NOTES,
+ BookingId = p.BOOKING_ID.Value,
+ IsEnable = false
+ };
+
+ return detail;
+ }).ToList();
+ }
+ }
return dto;
}
+ #endregion
+ #region 自动转发船舶相关截止时间的通知
///
/// 自动转发船舶相关截止时间的通知
///
@@ -97,7 +177,9 @@ namespace Myshipping.Application
return result;
}
+ #endregion
+ #region 检索同一航次对应的订舱订单(并对应记录)
///
/// 检索同一航次对应的订舱订单(并对应记录)
///
@@ -119,5 +201,6 @@ namespace Myshipping.Application
return result;
}
+ #endregion
}
}
diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs
index 8672b1d1..5d918453 100644
--- a/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs
+++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs
@@ -102,6 +102,9 @@ namespace Myshipping.Application
//租户CANCELLATION默认钉钉消息KEY
const string CONST_CANCELLATION_DING_DEFAULT_PARAM = "CANCELLATION_TASK_DING_NOTICE";
+ //租户默认参数管理(BC任务或舱位生成订舱客户联系人必填)
+ const string CONST_CREATE_BOOKING_NEED_CONTACT = "BC_TASK_OR_SLOT_BOOKING_NEED_CONTACT";
+
public TaskManageBCService(SqlSugarRepository taskBCInfoRepository,
SqlSugarRepository taskBaseRepository,
SqlSugarRepository taskBCCTNInfoRepository,