修改马士基 SPOT订舱

master
jianghaiqing 5 months ago
parent eb78803227
commit d631229b66

@ -34,15 +34,20 @@ namespace Myshipping.Application.Service.BookingOrder
private readonly IDjyWebsiteAccountConfigService _webAccountConfig; private readonly IDjyWebsiteAccountConfigService _webAccountConfig;
private readonly ILogger<BookingMSKSPOTAPIService> _logger; private readonly ILogger<BookingMSKSPOTAPIService> _logger;
private readonly ISysDataUserMenu _sysDataUserMenuService; private readonly ISysDataUserMenu _sysDataUserMenuService;
private readonly IDjyTenantParamService _djyTenantParamService;
const string CONST_MSK_API_COMMODITY_URL = "MSKApiCommodity"; const string CONST_MSK_API_COMMODITY_URL = "MSKApiCommodity";
const string CONST_MSK_API_BOOKING_URL = "MSKApiBooking"; const string CONST_MSK_API_BOOKING_URL = "MSKApiBooking";
const string CONST_MSK_SPOT_API_QUERY_SCHEDULE_RATE_URL = "MSKSPOTScheduleRate"; const string CONST_MSK_SPOT_API_QUERY_SCHEDULE_RATE_URL = "MSKSPOTScheduleRate";
const string CONST_MSK_SPOT_API_LOCATION_URL = "MSKSPOTApilocation"; const string CONST_MSK_SPOT_API_LOCATION_URL = "MSKSPOTApilocation";
//租户MSK SPOT的备案注册信息
const string CONST_MSK_SPOT_COMPANY_INFO = "MSK_SPOT_API_COMPANY_INFO";
public BookingMSKSPOTAPIService(ILogger<BookingMSKSPOTAPIService> logger, ISysCacheService cache, public BookingMSKSPOTAPIService(ILogger<BookingMSKSPOTAPIService> logger, ISysCacheService cache,
IDjyWebsiteAccountConfigService webAccountConfig, SqlSugarRepository<BookingDeliveryRecord> bookingDeliveryRecordRep, IDjyWebsiteAccountConfigService webAccountConfig, SqlSugarRepository<BookingDeliveryRecord> bookingDeliveryRecordRep,
ISysDataUserMenu sysDataUserMenuService, ISysDataUserMenu sysDataUserMenuService,
IDjyTenantParamService djyTenantParamService,
SqlSugarRepository<BookingDeliveryRecordCtn> bookingDeliveryRecordCtnRep) SqlSugarRepository<BookingDeliveryRecordCtn> bookingDeliveryRecordCtnRep)
{ {
_logger = logger; _logger = logger;
@ -51,6 +56,7 @@ namespace Myshipping.Application.Service.BookingOrder
_bookingDeliveryRecordRep = bookingDeliveryRecordRep; _bookingDeliveryRecordRep = bookingDeliveryRecordRep;
_bookingDeliveryRecordCtnRep = bookingDeliveryRecordCtnRep; _bookingDeliveryRecordCtnRep = bookingDeliveryRecordCtnRep;
_sysDataUserMenuService = sysDataUserMenuService; _sysDataUserMenuService = sysDataUserMenuService;
_djyTenantParamService = djyTenantParamService;
} }
#region 检索始发地、目的港口信息 #region 检索始发地、目的港口信息
@ -434,9 +440,6 @@ namespace Myshipping.Application.Service.BookingOrder
return showDto; return showDto;
}).ToList(); }).ToList();
} }
else else
{ {
@ -500,7 +503,7 @@ namespace Myshipping.Application.Service.BookingOrder
/// <param name="model">请求订舱详情</param> /// <param name="model">请求订舱详情</param>
/// <returns></returns> /// <returns></returns>
[HttpPost("/BookingMSKSPOTAPI/SendMSKBooking")] [HttpPost("/BookingMSKSPOTAPI/SendMSKBooking")]
public async Task<MSKBookingResultDto> SendMSKBooking(MSKBookingDto model) public async Task<MSKBookingResultDto> SendMSKBooking(MSKSPOTBookingDto model)
{ {
MSKBookingResultDto result = await InnerSendMSKBooking(model, 0); MSKBookingResultDto result = await InnerSendMSKBooking(model, 0);
return result; return result;
@ -515,7 +518,7 @@ namespace Myshipping.Application.Service.BookingOrder
/// <param name="currId">当前马士基订舱主键</param> /// <param name="currId">当前马士基订舱主键</param>
/// <param name="isDefaultSave">是否默认保存</param> /// <param name="isDefaultSave">是否默认保存</param>
/// <returns></returns> /// <returns></returns>
private async Task<MSKBookingResultDto> InnerSendMSKBooking(MSKBookingDto model, long currId, bool isDefaultSave = true) private async Task<MSKBookingResultDto> InnerSendMSKBooking(MSKSPOTBookingDto model, long currId, bool isDefaultSave = true)
{ {
MSKBookingResultDto result = new MSKBookingResultDto(); MSKBookingResultDto result = new MSKBookingResultDto();
@ -830,7 +833,7 @@ namespace Myshipping.Application.Service.BookingOrder
/// 校验马士基API订舱必填项 /// 校验马士基API订舱必填项
/// </summary> /// </summary>
/// <param name="model"></param> /// <param name="model"></param>
private void ValidateMSKAPIData(MSKBookingDto model) private void ValidateMSKAPIData(MSKSPOTBookingDto model)
{ {
/* /*
API API
@ -1071,9 +1074,9 @@ namespace Myshipping.Application.Service.BookingOrder
/// <param name="id">马士基API订舱ID</param> /// <param name="id">马士基API订舱ID</param>
/// <returns>返回详情</returns> /// <returns>返回详情</returns>
[HttpGet("/BookingMSKSPOTAPI/GetInfo")] [HttpGet("/BookingMSKSPOTAPI/GetInfo")]
public async Task<MSKBookingDto> GetInfo(long id) public async Task<MSKSPOTBookingDto> GetInfo(long id)
{ {
MSKBookingDto model = null; MSKSPOTBookingDto model = null;
var entity = await _bookingDeliveryRecordRep.AsQueryable() var entity = await _bookingDeliveryRecordRep.AsQueryable()
.FirstAsync(a => a.Id == id); .FirstAsync(a => a.Id == id);
@ -1081,7 +1084,7 @@ namespace Myshipping.Application.Service.BookingOrder
if (entity == null) if (entity == null)
throw Oops.Oh($"获取马士基API订舱详情失败不存在或已作废"); throw Oops.Oh($"获取马士基API订舱详情失败不存在或已作废");
model = entity.Adapt<MSKBookingDto>(); model = entity.Adapt<MSKSPOTBookingDto>();
var ctnList = _bookingDeliveryRecordCtnRep.AsQueryable() var ctnList = _bookingDeliveryRecordCtnRep.AsQueryable()
.Where(a => a.RECORD_ID == id && a.IsDeleted == false).ToList(); .Where(a => a.RECORD_ID == id && a.IsDeleted == false).ToList();
@ -1112,7 +1115,7 @@ namespace Myshipping.Application.Service.BookingOrder
/// <param name="model">请求订舱详情</param> /// <param name="model">请求订舱详情</param>
/// <returns>返回ID</returns> /// <returns>返回ID</returns>
[HttpPost("/BookingMSKSPOTAPI/Save")] [HttpPost("/BookingMSKSPOTAPI/Save")]
public async Task<long> Save([FromBody] MSKBookingDto model) public async Task<long> Save([FromBody] MSKSPOTBookingDto model)
{ {
return await InnerSave(model); return await InnerSave(model);
} }
@ -1125,7 +1128,7 @@ namespace Myshipping.Application.Service.BookingOrder
/// <param name="model">API订舱详情</param> /// <param name="model">API订舱详情</param>
/// <param name="isSendApi">是否发送APItrue-发送需要校验状态false-不校验状态</param> /// <param name="isSendApi">是否发送APItrue-发送需要校验状态false-不校验状态</param>
/// <returns></returns> /// <returns></returns>
private async Task<long> InnerSave(MSKBookingDto model, bool isSendApi = false) private async Task<long> InnerSave(MSKSPOTBookingDto model, bool isSendApi = false)
{ {
DateTime nowDate = DateTime.Now; DateTime nowDate = DateTime.Now;
@ -1400,7 +1403,7 @@ namespace Myshipping.Application.Service.BookingOrder
/// <param name="model">马士基API批量复制指定数据</param> /// <param name="model">马士基API批量复制指定数据</param>
/// <returns>返回执行结果消息</returns> /// <returns>返回执行结果消息</returns>
[HttpPost("/BookingMSKSPOTAPI/BatchCopy")] [HttpPost("/BookingMSKSPOTAPI/BatchCopy")]
public async Task<string> BatchCopy(MSKAPIBookingCopyDto model) public async Task<string> BatchCopy(MSKAPISPOTBookingCopyDto model)
{ {
@ -1594,7 +1597,7 @@ namespace Myshipping.Application.Service.BookingOrder
/// <param name="model">马士基API批量复制指定数据</param> /// <param name="model">马士基API批量复制指定数据</param>
/// <returns>返回提示信息</returns> /// <returns>返回提示信息</returns>
[HttpPost("/BookingMSKSPOTAPI/CheckWarningBatchCopy")] [HttpPost("/BookingMSKSPOTAPI/CheckWarningBatchCopy")]
public async Task<string> CheckWarningBatchCopy(MSKAPIBookingCopyDto model) public async Task<string> CheckWarningBatchCopy(MSKAPISPOTBookingCopyDto model)
{ {
/* /*
@ -1678,5 +1681,21 @@ namespace Myshipping.Application.Service.BookingOrder
return "校验成功"; return "校验成功";
} }
#endregion #endregion
#region 获取初始化页面默认值
/// <summary>
/// 获取初始化页面默认值
/// </summary>
/// <returns>返回详情</returns>
public async Task<MSKSPOTBookingInitDto> GetInitInfo()
{
return null;
//var paramList = _djyTenantParamService.GetParaCodeWithValue(new[] { CONST_AMENDMENT_DEFAULT_PARAM,
// CONST_CANCELLATION_DEFAULT_PARAM,
// CONST_AMENDMENT_DING_DEFAULT_PARAM,
// CONST_CANCELLATION_DING_DEFAULT_PARAM }).GetAwaiter().GetResult();
}
#endregion
} }
} }

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
public class MSKAPISPOTBookingCopyDto
{
/// <summary>
/// 被复制马士基API订舱主键
/// </summary>
public long originalId { get; set; }
/// <summary>
/// 操作类型 only_copy-只单票复制copy_edit-复制使用提交的编辑信息
/// </summary>
public string opType { get; set; }
/// <summary>
/// 编辑详情(弹出编辑框后修改的详情内容)
/// </summary>
public MSKBookingDto bookingDto { get; set; }
/// <summary>
/// 复制数量
/// </summary>
public int copyNum { get; set; } = 1;
}
}

@ -7,6 +7,9 @@ using System.Threading.Tasks;
namespace Myshipping.Application namespace Myshipping.Application
{ {
/// <summary>
/// 马士基SPOT订舱保存
/// </summary>
public class MSKSPOTBookingDto public class MSKSPOTBookingDto
{ {
/// <summary> /// <summary>

@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// MSK SPOT 订舱初始加载详情
/// </summary>
public class MSKSPOTBookingInitDto
{
/// <summary>
/// 订舱方备案编号(马士基)
/// </summary>
public string bookedByMaerskPartyCode { get; set; }
/// <summary>
/// 订舱方备案全称(马士基)
/// </summary>
public string bookedByCompanyName { get; set; }
/// <summary>
/// 订舱方联系人(马士基)
/// </summary>
public string bookedByPartyContactName { get; set; }
/// <summary>
/// 订舱方联系邮箱(马士基)
/// </summary>
public string bookedByPartyContactEmail { get; set; }
/// <summary>
/// 持约方备案代码(马士基)
/// </summary>
public string priceOwnerMaerskPartyCode { get; set; }
/// <summary>
/// 持约方备案全称(马士基)
/// </summary>
public string priceOwnerCompanyName { get; set; }
}
}

@ -33,7 +33,7 @@ namespace Myshipping.Application.Service.BookingOrder
/// </summary> /// </summary>
/// <param name="model">请求订舱详情</param> /// <param name="model">请求订舱详情</param>
/// <returns>返回检索结果</returns> /// <returns>返回检索结果</returns>
Task<MSKBookingResultDto> SendMSKBooking(MSKBookingDto model); Task<MSKBookingResultDto> SendMSKBooking(MSKSPOTBookingDto model);
/// <summary> /// <summary>
/// 检索商品名称 /// 检索商品名称
@ -47,14 +47,14 @@ namespace Myshipping.Application.Service.BookingOrder
/// </summary> /// </summary>
/// <param name="id">马士基API订舱ID</param> /// <param name="id">马士基API订舱ID</param>
/// <returns>返回详情</returns> /// <returns>返回详情</returns>
Task<MSKBookingDto> GetInfo(long id); Task<MSKSPOTBookingDto> GetInfo(long id);
/// <summary> /// <summary>
/// 保存 /// 保存
/// </summary> /// </summary>
/// <param name="model">请求订舱详情</param> /// <param name="model">请求订舱详情</param>
/// <returns>返回ID</returns> /// <returns>返回ID</returns>
Task<long> Save(MSKBookingDto model); Task<long> Save(MSKSPOTBookingDto model);
/// <summary> /// <summary>
/// 删除 /// 删除
@ -82,14 +82,14 @@ namespace Myshipping.Application.Service.BookingOrder
/// </summary> /// </summary>
/// <param name="model">马士基API批量复制指定数据</param> /// <param name="model">马士基API批量复制指定数据</param>
/// <returns>返回提示信息</returns> /// <returns>返回提示信息</returns>
Task<string> CheckWarningBatchCopy(MSKAPIBookingCopyDto model); Task<string> CheckWarningBatchCopy(MSKAPISPOTBookingCopyDto model);
/// <summary> /// <summary>
/// 批量复制 /// 批量复制
/// </summary> /// </summary>
/// <param name="model">马士基API批量复制指定数据</param> /// <param name="model">马士基API批量复制指定数据</param>
/// <returns>返回执行结果消息</returns> /// <returns>返回执行结果消息</returns>
Task<string> BatchCopy(MSKAPIBookingCopyDto model); Task<string> BatchCopy(MSKAPISPOTBookingCopyDto model);
/// <summary> /// <summary>
/// 同步BC状态BC,Cancellation /// 同步BC状态BC,Cancellation
@ -99,5 +99,12 @@ namespace Myshipping.Application.Service.BookingOrder
/// <param name="opTypeName">操作类型 BC-同步BC状态 Cancellation-同步取消状态</param> /// <param name="opTypeName">操作类型 BC-同步BC状态 Cancellation-同步取消状态</param>
/// <returns>返回回执</returns> /// <returns>返回回执</returns>
Task<MSKBookingResultDto> SyncBCInfo(string mblno, long tenantId, string opTypeName = "BookingConfirmation"); Task<MSKBookingResultDto> SyncBCInfo(string mblno, long tenantId, string opTypeName = "BookingConfirmation");
/// <summary>
/// 获取初始化页面默认值
/// </summary>
/// <returns>返回详情</returns>
Task<MSKSPOTBookingInitDto> GetInitInfo();
} }
} }

Loading…
Cancel
Save