zhangxiaofeng 6 months ago
commit 83fe9672fd

@ -391,5 +391,10 @@ namespace Myshipping.Application
/// 处理时间
/// </summary>
public Nullable<DateTime> PROCESS_DATE { get; set; }
/// <summary>
/// 计费日期
/// </summary>
public Nullable<DateTime> PRICE_CALCULATION_DATE { get; set; }
}
}

@ -0,0 +1,64 @@
using Myshipping.Application.Entity;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 重要任务提醒明细
/// </summary>
[SugarTable("task_caution_notice_detail")]
[Description("重要任务提醒明细")]
public class TaskCautionNoticeDetailInfo : TaskManageDbEntity
{
/// <summary>
/// 任务提醒主键
/// </summary>
public string P_ID { get; set; }
/// <summary>
/// 通知人ID
/// </summary>
public string NOTIFY_USER_ID { get; set; }
/// <summary>
/// 被通知人名称
/// </summary>
public string NOTIFY_USER_NAME { get; set; }
/// <summary>
/// 被通知方式
/// </summary>
public string NOTIFY_METHOD { get; set; }
/// <summary>
/// 被通知人手机
/// </summary>
public string NOTIFY_MOBILE { get; set; }
/// <summary>
/// 被通知人邮箱
/// </summary>
public string NOTIFY_EMAIL { get; set; }
/// <summary>
/// 状态
/// </summary>
public string STATUS { get; set; }
/// <summary>
/// 状态名称
/// </summary>
public string STATUS_NAME { get; set; }
/// <summary>
/// 重试次数
/// </summary>
public int RETRY_NUM { get; set; }
}
}

@ -0,0 +1,94 @@
using Myshipping.Application.Entity;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 重要任务提醒
/// </summary>
[SugarTable("task_caution_notice")]
[Description("重要任务提醒")]
public class TaskCautionNoticeInfo : TaskManageDbEntity
{
/// <summary>
/// 任务主键
/// </summary>
public string TASK_ID { get; set; }
/// <summary>
/// 来源系统
/// </summary>
public string SOURCE_SYSTEM { get; set; }
/// <summary>
/// 来源业务类型
/// </summary>
public string SOURCE_BUSI_TYPE { get; set; }
/// <summary>
/// 来源业务类型名称
/// </summary>
public string SOURCE_BUSI_TYPENAME { get; set; }
/// <summary>
/// 通知内容
/// </summary>
public string NOTIFY_CONTENT { get; set; }
/// <summary>
/// 提单号
/// </summary>
public string MBL_NO { get; set; }
/// <summary>
/// 船公司
/// </summary>
public string CARRIER { get; set; }
/// <summary>
/// 是否计费周差异 1-是 0-否
/// </summary>
public bool IS_WEEK_DIFF { get; set; }
/// <summary>
/// 是否计费日差异 1-是 0-否
/// </summary>
public bool IS_PRICE_DATE_DIFF { get; set; }
/// <summary>
/// 是否转为中转 1-是 0-否
/// </summary>
public bool IS_TRANSFER { get; set; }
/// <summary>
/// 是否船名变化 1-是 0-否
/// </summary>
public bool IS_VESSEL_CHANGE { get; set; }
/// <summary>
/// 是否截止时间提前 1-是 0-否
/// </summary>
public bool IS_CUT_DATE_ADVANCED { get; set; }
/// <summary>
/// 订舱ID
/// </summary>
public Nullable<long> BOOKING_ID { get; set; }
/// <summary>
/// 舱位ID
/// </summary>
public Nullable<long> BOOKING_SLOT_ID { get; set; }
/// <summary>
/// 任务ID
/// </summary>
public string SOURCE_TASK_ID { get; set; }
}
}

@ -21,10 +21,25 @@ namespace Myshipping.Application
/// 计费日期差异
/// </summary>
[Description("计费日期差异")]
PriceCalcDate
PriceCalcDate,
/// <summary>
/// 直达转为中转
/// </summary>
[Description("直达转为中转")]
ChangeTransfer,
/// <summary>
/// 船名航次变化
/// </summary>
[Description("船名航次变化")]
ChangeVesselVoyno,
/// <summary>
/// 截止时间提前
/// </summary>
[Description("截止时间提前")]
CutDateAdvanced
}
public enum CautionNoticeTypeEnum
public enum CautionNoticeMethodEnum
{
/// <summary>
/// 钉钉消息
@ -37,4 +52,23 @@ namespace Myshipping.Application
[Description("邮件提醒")]
Email
}
public enum TaskCautionNoticeStatusEnum
{
/// <summary>
/// 暂存
/// </summary>
[Description("暂存")]
TEMP,
/// <summary>
/// 消息发送成功
/// </summary>
[Description("消息发送成功")]
SUCC,
/// <summary>
/// 消息发送失败
/// </summary>
[Description("消息发送失败")]
FAILURE
}
}

@ -2560,15 +2560,15 @@ namespace Myshipping.Application
{
if (bcSrcDto.CarrierId.Equals("MSK", StringComparison.OrdinalIgnoreCase))
{
var bookingList = _repAllocation.AsQueryable().Filter(null, true)
.Where(x => x.BOOKING_SLOT_ID == slotId && x.IsDeleted == false && x.TenantId == UserManager.TENANT_ID).ToList();
string srcWeek = bcSrcDto.WeekAt ?? "";
string targetWeek = bcTargetDto.WeekAt ?? "";
//如果计费周不一致需要推送推送任务台生成重要提醒
if (!srcWeek.Equals(targetWeek, StringComparison.OrdinalIgnoreCase))
{
var bookingList = _repAllocation.AsQueryable().Filter(null, true)
.Where(x => x.BOOKING_SLOT_ID == slotId && x.IsDeleted == false && x.TenantId == UserManager.TENANT_ID).ToList();
if (bookingList.Count > 0)
{
bookingList.ForEach(async ca =>
@ -2611,9 +2611,6 @@ namespace Myshipping.Application
if (!srcPriceCalcDate.Equals(targePriceCalcDate, StringComparison.OrdinalIgnoreCase))
{
var bookingList = _repAllocation.AsQueryable().Filter(null, true)
.Where(x => x.BOOKING_SLOT_ID == slotId && x.IsDeleted == false && x.TenantId == UserManager.TENANT_ID).ToList();
if (bookingList.Count > 0)
{
bookingList.ForEach(async ca =>
@ -2650,6 +2647,97 @@ namespace Myshipping.Application
}));
}
}
string srcVessel = bcSrcDto.Vessel ?? "";
string targetVessel = bcTargetDto.Vessel ?? "";
string srcVoyno = bcSrcDto.VoyNo ?? "";
string targetVoyno = bcTargetDto.VoyNo ?? "";
//船名航次出现变化需要做重要提醒
if (!srcVessel.Equals(targetVessel, StringComparison.OrdinalIgnoreCase) || !srcVoyno.Equals(targetVoyno, StringComparison.OrdinalIgnoreCase))
{
if (bookingList.Count > 0)
{
bookingList.ForEach(async ca =>
{
await _publisher.PublishAsync(new ChannelEventSource("CautionNoticeTask:Add",
new CautionNoticeTaskDto
{
cautionNoticeType = CautionNoticeTaskEnum.ChangeVesselVoyno,
bookingId = ca.BOOKING_ID,
bookingSlotId = ca.BOOKING_SLOT_ID,
createTime = DateTime.Now,
origVal = $"{srcVessel}/{srcVoyno}",
newVal = $"{targetVessel}/{targetVoyno}",
tenentId = UserManager.TENANT_ID,
userId = UserManager.UserId,
userName = UserManager.Name,
}));
});
}
else
{
await _publisher.PublishAsync(new ChannelEventSource("CautionNoticeTask:Add",
new CautionNoticeTaskDto
{
cautionNoticeType = CautionNoticeTaskEnum.ChangeVesselVoyno,
bookingSlotId = slotId,
createTime = DateTime.Now,
origVal = srcWeek,
newVal = targetWeek,
tenentId = UserManager.TENANT_ID,
userId = UserManager.UserId,
userName = UserManager.Name,
}));
}
}
string srcCarrierType = bcSrcDto.CarriageType ?? "";
string targetCarrierType = bcTargetDto.CarriageType ?? "";
//如果原来是直航现在变成了中转需要做重要提醒
if (!srcVessel.Equals(targetVessel, StringComparison.OrdinalIgnoreCase)
&& srcVessel.Equals("DIRECT_SHIP", StringComparison.OrdinalIgnoreCase)
&& targetCarrierType.Equals("TRANSFER_SHIP", StringComparison.OrdinalIgnoreCase))
{
if (bookingList.Count > 0)
{
bookingList.ForEach(async ca =>
{
await _publisher.PublishAsync(new ChannelEventSource("CautionNoticeTask:Add",
new CautionNoticeTaskDto
{
cautionNoticeType = CautionNoticeTaskEnum.ChangeTransfer,
bookingId = ca.BOOKING_ID,
bookingSlotId = ca.BOOKING_SLOT_ID,
createTime = DateTime.Now,
origVal = srcCarrierType,
newVal = targetCarrierType,
tenentId = UserManager.TENANT_ID,
userId = UserManager.UserId,
userName = UserManager.Name,
}));
});
}
else
{
await _publisher.PublishAsync(new ChannelEventSource("CautionNoticeTask:Add",
new CautionNoticeTaskDto
{
cautionNoticeType = CautionNoticeTaskEnum.ChangeTransfer,
bookingSlotId = slotId,
createTime = DateTime.Now,
origVal = srcCarrierType,
newVal = targetCarrierType,
tenentId = UserManager.TENANT_ID,
userId = UserManager.UserId,
userName = UserManager.Name,
}));
}
}
}
}
#endregion

@ -6,6 +6,9 @@ using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 重要提醒任务
/// </summary>
public class TaskManageOrderCautionNoticeInfo
{
/// <summary>
@ -43,6 +46,36 @@ namespace Myshipping.Application
/// </summary>
public string NewVal { get; set; }
/// <summary>
/// 提单号
/// </summary>
public string MBlNo { get; set; }
/// <summary>
/// 船公司
/// </summary>
public string Carrier { get; set; }
/// <summary>
/// 来源系统
/// </summary>
public string SourceSystem { get; set; }
/// <summary>
/// 来源业务类型
/// </summary>
public string SourceBusiType { get; set; }
/// <summary>
/// 来源业务类型名称
/// </summary>
public string SourceBusiTypeName { get; set; }
/// <summary>
/// 通知内容
/// </summary>
public string NotifyContent { get; set; }
/// <summary>
/// 消息列表
/// </summary>
@ -57,16 +90,26 @@ namespace Myshipping.Application
/// <summary>
/// 重要提醒消息类型
/// </summary>
public CautionNoticeTypeEnum CautionNoticeType { get; set; }
public CautionNoticeMethodEnum CautionNoticeType { get; set; }
/// <summary>
/// 用户ID
/// </summary>
public string UserId { get; set; }
/// <summary>
/// 用户名称
/// </summary>
public string UserName { get; set; }
/// <summary>
/// 用户手机号
/// </summary>
public string Mobile { get; set; }
/// <summary>
/// 用户邮箱
/// </summary>
public string Email { get; set; }
}
}

@ -817,7 +817,8 @@ namespace Myshipping.Application
.Map(dest => dest.SECOND_ETD, src => src.SecondETD)
.Map(dest => dest.SECOND_ETA, src => src.SecondETA)
.Map(dest => dest.BOOKING_COMFIRM_DATE, src => src.BookingConfirmDate)
.Map(dest => dest.BATCH_NO, src => src.BatchNo);
.Map(dest => dest.BATCH_NO, src => src.BatchNo)
.Map(dest => dest.PRICE_CALCULATION_DATE, src => src.PriceCalculationDate);
config.ForType<TaskBCCTNInfo, TaskBCCTNInfoDto>()
.Map(dest => dest.CtnCode, src => src.CTNCODE)
@ -1143,6 +1144,21 @@ namespace Myshipping.Application
.Map(dest => dest.HSCode, src => src.HSCODE)
.Map(dest => dest.Description, src => src.DESCRIPTION)
.Map(dest => dest.KindPKGS, src => src.KINDPKGS);
config.ForType<TaskManageOrderCautionNoticeInfo, TaskCautionNoticeInfo>()
.Map(dest => dest.MBL_NO, src => src.MBlNo)
.Map(dest => dest.CARRIER, src => src.Carrier)
.Map(dest => dest.BOOKING_ID, src => src.BookingId)
.Map(dest => dest.BOOKING_SLOT_ID, src => src.BookingSlotId)
.Map(dest => dest.SOURCE_TASK_ID, src => src.TaskPKId)
.Map(dest => dest.NOTIFY_CONTENT, src => src.NotifyContent);
config.ForType<TaskManageOrderCautionNoticeDetailInfo, TaskCautionNoticeDetailInfo>()
.Map(dest => dest.NOTIFY_USER_ID, src => src.UserId)
.Map(dest => dest.NOTIFY_USER_NAME, src => src.UserName)
.Map(dest => dest.NOTIFY_EMAIL, src => src.Email)
.Map(dest => dest.NOTIFY_MOBILE, src => src.Mobile);
}
}
}

@ -346,5 +346,10 @@ namespace Myshipping.Application
/// 批次号
/// </summary>
public string BatchNo { get; set; }
/// <summary>
/// 计费时间
/// </summary>
public Nullable<DateTime> PriceCalculationDate { get; set; }
}
}

@ -234,5 +234,10 @@ namespace Myshipping.Application
/// 格式单
/// </summary>
public TaskManageOrderDraftInfo DraftInfo { get; set; }
/// <summary>
/// 重要通知
/// </summary>
public TaskManageOrderCautionNoticeInfo CautionNoticeInfo { get; set; }
}
}

@ -115,6 +115,8 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<TaskPODDischargeGateoutFullInfo> _taskPODDischargeGateoutFullInfoRepository;
private readonly SqlSugarRepository<TaskPODDischargeGateoutFullDetailInfo> _taskPODDischargeGateoutFullDetailInfoRepository;
private readonly SqlSugarRepository<TaskCautionNoticeInfo> _taskCautionNoticeInfoRepository;
private readonly SqlSugarRepository<TaskCautionNoticeDetailInfo> _taskCautionNoticeDetailInfoRepository;
private readonly IDjyWebsiteAccountConfigService _webAccountConfig;
private readonly ISysCacheService _cache;
@ -176,6 +178,8 @@ namespace Myshipping.Application
SqlSugarRepository<TaskDraftInfo> taskDraftInfoRepository,
SqlSugarRepository<TaskPODDischargeGateoutFullInfo> taskPODDischargeGateoutFullInfoRepository,
SqlSugarRepository<TaskPODDischargeGateoutFullDetailInfo> taskPODDischargeGateoutFullDetailInfoRepository,
SqlSugarRepository<TaskCautionNoticeInfo> taskCautionNoticeInfoRepository,
SqlSugarRepository<TaskCautionNoticeDetailInfo> taskCautionNoticeDetailInfoRepository,
INamedServiceProvider<IBookingOrderService> namedBookingOrderServiceProvider,
IDjyWebsiteAccountConfigService webAccountConfig,
ISysCacheService cache,
@ -239,6 +243,9 @@ namespace Myshipping.Application
_taskPODDischargeGateoutFullDetailInfoRepository = taskPODDischargeGateoutFullDetailInfoRepository;
_namedBookingMSKAPIServiceProvider = namedBookingMSKAPIServiceProvider;
_taskCautionNoticeInfoRepository = taskCautionNoticeInfoRepository;
_taskCautionNoticeDetailInfoRepository = taskCautionNoticeDetailInfoRepository;
}
#region 创建任务
@ -1400,6 +1407,69 @@ namespace Myshipping.Application
}
#endregion
#region 重要提醒
if (info.Main.TaskType == TaskBaseTypeEnum.CAUTION_NOTICE)
{
TaskCautionNoticeInfo taskCautionNoticeInfo = info.Main.CautionNoticeInfo.Adapt<TaskCautionNoticeInfo>();
taskCautionNoticeInfo.PK_ID = IDGen.NextID().ToString();
taskCautionNoticeInfo.TASK_ID = taskInfo.PK_ID;
taskCautionNoticeInfo.CreatedTime = taskInfo.CreatedTime;
taskCautionNoticeInfo.UpdatedTime = taskInfo.CreatedTime;
taskCautionNoticeInfo.CreatedUserId = taskInfo.CreatedUserId;
taskCautionNoticeInfo.CreatedUserName = taskInfo.CreatedUserName;
taskCautionNoticeInfo.TenantId = taskInfo.TenantId;
taskCautionNoticeInfo.TenantName = taskInfo.TenantName;
if (info.Main.CautionNoticeInfo.CautionNoticeType == CautionNoticeTaskEnum.WeekAt)
{
taskCautionNoticeInfo.IS_WEEK_DIFF = true;
}
else if (info.Main.CautionNoticeInfo.CautionNoticeType == CautionNoticeTaskEnum.PriceCalcDate)
{
taskCautionNoticeInfo.IS_PRICE_DATE_DIFF = true;
}
else if (info.Main.CautionNoticeInfo.CautionNoticeType == CautionNoticeTaskEnum.ChangeVesselVoyno)
{
taskCautionNoticeInfo.IS_VESSEL_CHANGE = true;
}
else if (info.Main.CautionNoticeInfo.CautionNoticeType == CautionNoticeTaskEnum.ChangeTransfer)
{
taskCautionNoticeInfo.IS_TRANSFER = true;
}
else if (info.Main.CautionNoticeInfo.CautionNoticeType == CautionNoticeTaskEnum.CutDateAdvanced)
{
taskCautionNoticeInfo.IS_CUT_DATE_ADVANCED = true;
}
await _taskCautionNoticeInfoRepository.InsertAsync(taskCautionNoticeInfo);
//异步写入集装箱
info.Main.CautionNoticeInfo.NoticeList.ForEach(async notice =>
{
var noticeInfo = notice.Adapt<TaskCautionNoticeDetailInfo>();
noticeInfo.PK_ID = IDGen.NextID().ToString();
noticeInfo.P_ID = taskCautionNoticeInfo.PK_ID;
noticeInfo.CreatedTime = taskInfo.CreatedTime;
noticeInfo.UpdatedTime = taskInfo.CreatedTime;
noticeInfo.CreatedUserId = taskInfo.CreatedUserId;
noticeInfo.CreatedUserName = taskInfo.CreatedUserName;
noticeInfo.TenantId = taskInfo.TenantId;
noticeInfo.TenantName = taskInfo.TenantName;
noticeInfo.STATUS = TaskCautionNoticeStatusEnum.TEMP.ToString();
noticeInfo.STATUS_NAME = TaskCautionNoticeStatusEnum.TEMP.GetDescription();
await _taskCautionNoticeDetailInfoRepository.InsertAsync(noticeInfo);
});
}
#endregion
if (info.Main.SerialMsgInfo != null)
{
var storeInfo = new TaskStoreMsgInfo

@ -57,7 +57,7 @@
<PackageReference Include="RabbitMQ.Client" Version="6.5.0" />
<PackageReference Include="SqlSugarCore" Version="5.1.2.6" />
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.2.20" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.3.14" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" />
<PackageReference Include="TinyPinyin.Net" Version="1.0.2" />
<PackageReference Include="UAParser" Version="3.1.47" />

Loading…
Cancel
Save