修改重要提醒任务

master
jianghaiqing 7 months ago
parent 022369660c
commit 943f44b986

@ -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("船名变化")]
ChangeVessel,
/// <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
}
}

@ -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; }
}
}

@ -1143,6 +1143,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);
}
}
}

@ -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.ChangeVessel)
{
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

Loading…
Cancel
Save