修改任务台

master
jianghaiqing 6 months ago
parent f063c06d3b
commit 5a665033cf

@ -91,6 +91,11 @@ namespace Myshipping.Application
/// </summary>
public string EMAIL_SUBJECT { get; set; }
/// <summary>
/// 周数
/// </summary>
public int WEEK { get; set; }
/// <summary>
/// 装货港代码
/// </summary>

@ -176,5 +176,10 @@ namespace Myshipping.Application
/// </summary>
[Description("航线截止时间调整")]
ROUTE_CUT_CHANGE,
/// <summary>
/// 装货港未提箱
/// </summary>
[Description("装货港未提箱")]
POL_CTN_NOT_PICKUP,
}
}

@ -6,6 +6,9 @@ using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 船舶相关截止时间的通知
/// </summary>
public class TaskRouteChangeAdvisoryShowDto
{
/// <summary>
@ -42,7 +45,7 @@ namespace Myshipping.Application
/// <summary>
/// 预计离港时间
/// </summary>
public DateTime origETD { get; set; }
public Nullable<DateTime> origETD { get; set; }
/// <summary>
/// 完整 MDGF 截止时间/冻柜/开顶柜/框架箱/超限货物最晚提箱时间:
@ -80,10 +83,20 @@ namespace Myshipping.Application
public Nullable<DateTime> CYCutDate { get; set; }
/// <summary>
/// 启运港名称
/// 读取装货港名称
/// </summary>
public string LoadPortName { get; set; }
/// <summary>
/// 装货港ID
/// </summary>
public string LoadPortId { get; set; }
/// <summary>
/// 装货港名称
/// </summary>
public string LoadPort { get; set; }
/// <summary>
/// 航线代码
/// </summary>
@ -93,5 +106,61 @@ namespace Myshipping.Application
/// 创建日期
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 通知标题
/// </summary>
public string AdvisoryTitle { get; set; }
/// <summary>
/// 相关订舱列表
/// </summary>
public List<TaskRouteChangeAdvisoryBusiShowDto> BuisList { get; set; }
}
/// <summary>
/// 船舶相关截止时间的通知订单明细
/// </summary>
public class TaskRouteChangeAdvisoryBusiShowDto
{
/// <summary>
/// 主键
/// </summary>
public string PKId { get; set; }
/// <summary>
/// 订舱订单ID
/// </summary>
public long BookingId { get; set; }
/// <summary>
/// 提单号
/// </summary>
public string MBlNo { get; set; }
/// <summary>
/// 是否已转发客户 true-是 false-否
/// </summary>
public bool IsTransferUser { get; set; }
/// <summary>
/// 最后转发客户邮件时间
/// </summary>
public Nullable<DateTime> LstTransferUserDate { get; set; }
/// <summary>
/// 最后转发客户邮件结果
/// </summary>
public string LstTransferNote { get; set; }
/// <summary>
/// 往来单位名称
/// </summary>
public string CustomerName { get; set; }
/// <summary>
/// 是否有效true-可以点击发送 false-不能点击发送)
/// </summary>
public bool IsEnable { get; set; }
}
}

@ -0,0 +1,64 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 装货港未提箱
/// </summary>
public class TaskManageOrderPOLCtnNotPickUpInfo
{
/// <summary>
/// 船名
/// </summary>
public string Vessel { get; set; }
/// <summary>
/// 航次
/// </summary>
public string Voyno { get; set; }
/// <summary>
/// 船公司
/// </summary>
public string Carrier { get; set; }
/// <summary>
/// 订舱号
/// </summary>
public string ShipmentNumber { get; set; }
/// <summary>
/// 订舱抬头
/// </summary>
public string BookedByCustomerName { get; set; }
/// <summary>
/// 订舱参考号
/// </summary>
public string BookedByReference { get; set; }
/// <summary>
/// 合约抬头
/// </summary>
public string PriceOwnerName { get; set; }
/// <summary>
/// 批次号
/// </summary>
public string BatchNo { get; set; }
/// <summary>
/// 预甩的明细总票数
/// </summary>
public int TotalNum { get; set; }
/// <summary>
/// 预甩的明细单票总票数
/// </summary>
public int PerTotalNum { get; set; }
}
}

@ -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<TaskRouteChangeAdvisoryInfo> _taskRouteChangeAdvisoryInfoRepository;
private readonly SqlSugarRepository<TaskRouteChangeAdvisoryDetailInfo> _taskRouteChangeAdvisoryDetailInfoRepository;
private readonly SqlSugarRepository<DjyUserMailAccount> _djyUserMailAccount;
private readonly SqlSugarRepository<BookingOrder> _bookingOrderRepository;
public RouteChangeAdvisoryService(ISysCacheService cache, ILogger<TaskCautionNoticeService> logger,
SqlSugarRepository<TaskBaseInfo> taskBaseRepository,
SqlSugarRepository<TaskRouteChangeAdvisoryInfo> taskRouteChangeAdvisoryInfoRepository,
SqlSugarRepository<TaskRouteChangeAdvisoryDetailInfo> taskRouteChangeAdvisoryDetailInfoRepository,
SqlSugarRepository<DjyUserMailAccount> djyUserMailAccount)
SqlSugarRepository<DjyUserMailAccount> djyUserMailAccount,
SqlSugarRepository<BookingOrder> bookingOrderRepository)
{
_cache = cache;
_logger = logger;
_taskBaseRepository = taskBaseRepository;
_taskRouteChangeAdvisoryInfoRepository = taskRouteChangeAdvisoryInfoRepository;
_taskRouteChangeAdvisoryDetailInfoRepository = _taskRouteChangeAdvisoryDetailInfoRepository;
_taskRouteChangeAdvisoryDetailInfoRepository = taskRouteChangeAdvisoryDetailInfoRepository;
_djyUserMailAccount = djyUserMailAccount;
_bookingOrderRepository = bookingOrderRepository;
}
#region 获取船舶相关截止时间的通知详情
/// <summary>
/// 获取船舶相关截止时间的通知详情
/// </summary>
@ -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<TaskRouteChangeAdvisoryBusiShowDto>()
};
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 自动转发船舶相关截止时间的通知
/// <summary>
/// 自动转发船舶相关截止时间的通知
/// </summary>
@ -97,7 +177,9 @@ namespace Myshipping.Application
return result;
}
#endregion
#region 检索同一航次对应的订舱订单(并对应记录)
/// <summary>
/// 检索同一航次对应的订舱订单(并对应记录)
/// </summary>
@ -119,5 +201,6 @@ namespace Myshipping.Application
return result;
}
#endregion
}
}

@ -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<TaskBCInfo> taskBCInfoRepository,
SqlSugarRepository<TaskBaseInfo> taskBaseRepository,
SqlSugarRepository<TaskBCCTNInfo> taskBCCTNInfoRepository,

Loading…
Cancel
Save