修改舱位合票

新增重要整船通知
master
jianghaiqing 5 months ago
parent 081fafd086
commit 8ef44b6f85

@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
public class TaskCautionNoticeWholeShipDetailInfo
{
/// <summary>
/// 任务主键
/// </summary>
public string TASK_ID { get; set; }
/// <summary>
/// 任务提醒主键
/// </summary>
public string P_ID { get; set; }
/// <summary>
/// 提单号
/// </summary>
public string MBL_NO { 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 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,105 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 重要任务提醒整船通知
/// </summary>
public class TaskCautionNoticeWholeShipInfo
{
/// <summary>
/// 任务主键
/// </summary>
public string TASK_ID { 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>
/// VGM截止时间原始值
/// </summary>
public string VGM_CUT_OLD_VAL { get; set; }
/// <summary>
/// VGM截止时间修改值
/// </summary>
public string VGM_CUT_NEW_VAL { get; set; }
/// <summary>
/// SI截止时间原始值
/// </summary>
public string SI_CUT_OLD_VAL { get; set; }
/// <summary>
/// SI截止时间修改值
/// </summary>
public string SI_CUT_NEW_VAL { get; set; }
/// <summary>
/// 直达变中转原值
/// </summary>
public string DIRECT_TO_TRANS_OLD_VAL { get; set; }
/// <summary>
/// 直达变中转修改值
/// </summary>
public string DIRECT_TO_TRANS_NEW_VAL { get; set; }
/// <summary>
/// 船名原始值
/// </summary>
public string VESSEL_OLD_VAL { get; set; }
/// <summary>
/// 船名修改值
/// </summary>
public string VESSEL_NEW_VAL { get; set; }
/// <summary>
/// 航次原始值
/// </summary>
public string VOYNO_OLD_VAL { get; set; }
/// <summary>
/// 航次修改值
/// </summary>
public string VOYNO_NEW_VAL { get; set; }
/// <summary>
/// 原始值MD5
/// </summary>
public string OLD_VAL_MD5 { get; set; }
}
}

@ -7,5 +7,12 @@ namespace Myshipping.Application
public interface IBookingLabelService
{
Task<List<BookingLabelBaseDto>> List(int? scope);
/// <summary>
/// 设定标签
/// </summary>
/// <param name="input">请求参数</param>
/// <returns></returns>
Task SetLabel(BindLabelDto input);
}
}

@ -74,6 +74,7 @@ namespace Myshipping.Application
private readonly IEventPublisher _publisher;
private readonly INamedServiceProvider<IBookingOrderService> _namedBookingOrderServiceProvider;
private readonly INamedServiceProvider<ITaskManageService> _namedTaskManageServiceProvider;
private readonly INamedServiceProvider<IBookingLabelService> _namedBookingLabelServiceProvider;
private readonly IDjyCustomerService _djyCustomerService;
private readonly IBookingValueAddedService _bookingValueAddedService;
@ -81,6 +82,7 @@ namespace Myshipping.Application
private readonly IDjyTenantParamService _djyTenantParamService;
private readonly ISysDataUserMenu _sysDataUserMenuService;
const string CONST_BC_FILE_CODE = "bc";
const string CONST_BC_FILE_NAME = "Booking Confirmation";
@ -112,7 +114,7 @@ namespace Myshipping.Application
SqlSugarRepository<BookingSlotCompare> bookingSlotCompareRepository,
SqlSugarRepository<BookingOrderContact> bookingOrderContactRepository,
INamedServiceProvider<IBookingOrderService> namedBookingOrderServiceProvider,
INamedServiceProvider<IBookingLabelService> namedBookingLabelServiceProvider,
IBookingValueAddedService bookingValueAddedService,
SqlSugarRepository<BookingOrder> repBookingOrder,
SqlSugarRepository<BookingLabelAllocation> repLabelAllocation,
@ -152,6 +154,7 @@ namespace Myshipping.Application
_djyTenantParamService = djyTenantParamService;
_sysDataUserMenuService = sysDataUserMenuService;
_namedBookingLabelServiceProvider = namedBookingLabelServiceProvider;
}
#region 舱位
@ -860,6 +863,9 @@ namespace Myshipping.Application
CONST_BC_NOTICE_FILE_CODE, CONST_BC_NOTICE_FILE_NAME).GetAwaiter();
}
}
//触发标签自动绑定
await GenerateSlotLabel(dto, id);
}
else if (dto.OpType == "update")
{
@ -1019,6 +1025,9 @@ namespace Myshipping.Application
//一般更新数据指的是Booking Amendment,需要与舱位进行数据比对
await PushCompareBCInfo(bcSrcDto, bcTargetDto, id, dto.BatchNo);
//触发标签自动绑定
await GenerateSlotLabel(dto,id);
}
else if (dto.OpType == "del")
{
@ -3892,11 +3901,13 @@ namespace Myshipping.Application
userIdList.Add(bookingInfo.CreatedUserId.Value);
}
else
{
if (bookingSlotInfo != null)
{
userIdList.Add(bookingSlotInfo.CreatedUserId.Value);
}
}
userIdList = userIdList.Distinct().ToList();
@ -4092,7 +4103,7 @@ namespace Myshipping.Application
.Select(a => $"{a.Key}*{a.Sum(b => b.CTNNUM)}").ToArray());
}
if (slotList.Any(a => string.IsNullOrWhiteSpace(a.LOAD_GUARANTEE_FLAG)))
if (slotList.Any(a => !string.IsNullOrWhiteSpace(a.LOAD_GUARANTEE_FLAG)))
{
rlt.importantNotes = string.Join(";", slotList.Where(a => !string.IsNullOrWhiteSpace(a.LOAD_GUARANTEE_FLAG))
.GroupBy(a => a.LOAD_GUARANTEE_FLAG_NAME)
@ -4244,8 +4255,9 @@ namespace Myshipping.Application
/// 自动生成舱位标签
/// </summary>
/// <param name="dto">舱位详情</param>
/// <param name="id">舱位ID</param>
/// <returns></returns>
private async Task GenerateSlotLabel(BookingSlotBaseApiDto dto)
private async Task GenerateSlotLabel(BookingSlotBaseApiDto dto,long id)
{
try
{
@ -4417,7 +4429,20 @@ namespace Myshipping.Application
if (ruleList.Count > 0)
{
//_namedBookingLabelServiceServiceProvider.
var name = _namedBookingLabelServiceProvider
.GetService<ITransient>(nameof(BookingLabelService));
var bindModel = new BindLabelDto
{
BusinessIdArray = new[] { id },
LabelIdArray = ruleList.Select(a => a.Id.Value).ToArray()
};
_logger.LogInformation($"标签绑定请求,{JSON.Serialize(bindModel)}");
await name.SetLabel(bindModel);
_logger.LogInformation($"标签绑定请求完成");
}
}
}

Loading…
Cancel
Save