修改SITC订舱,增加收、发、通拆分

master
jianghaiqing 1 month ago
parent 7c6d8abbce
commit e26c818a5e

@ -600,5 +600,21 @@ namespace Myshipping.Application
/// CUSTNAME
/// </summary>
public string CUSTNAME { get; set; }
/// <summary>
/// 发货人地址
/// </summary>
public string SHIPPERADDR { get; set; }
/// <summary>
/// 收货人地址
/// </summary>
public string CONSIGNEEADDR { get; set; }
/// <summary>
/// 通知人地址
/// </summary>
public string NOTIFYPARTYADDR { get; set; }
}
}

@ -0,0 +1,69 @@
using Myshipping.Core.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.Entity
{
/// <summary>
/// 订舱拆解多行文本记录
/// </summary>
[SugarTable("booking_multiline_split_record")]
[Description("订舱拆解多行文本记录")]
public class BookingMultiLineSplitRecord : DBEntityTenant
{
/// <summary>
/// 订舱ID
/// </summary>
public long BOOKING_ID { get; set; }
/// <summary>
/// 发货人
/// </summary>
public string SHIPPER { get; set; }
/// <summary>
/// 收货人
/// </summary>
public string CONSIGNEE { get; set; }
/// <summary>
/// 通知人
/// </summary>
public string NOTIFYPARTY { get; set; }
/// <summary>
/// 发货人名称
/// </summary>
public string SHIPPERNAME { get; set; }
/// <summary>
/// 发货人地址1
/// </summary>
public string SHIPPERADDR1 { get; set; }
/// <summary>
/// 收货人名称
/// </summary>
public string CONSIGNEENAME { get; set; }
/// <summary>
/// 收货人地址1
/// </summary>
public string CONSIGNEEADDR1 { get; set; }
/// <summary>
/// 通知人名称
/// </summary>
public string NOTIFYPARTYNAME { get; set; }
/// <summary>
/// 通知人地址1
/// </summary>
public string NOTIFYPARTYADDR1 { get; set; }
}
}

@ -147,6 +147,7 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<BookingExtendState> _repextendstate;
private readonly SqlSugarRepository<BookingCustomerOrder> _repCustomerOrder;
private readonly SqlSugarRepository<BookingMultiLineSplitRecord> _repBookingMultiLineSplitRecord;
private readonly IServiceWorkFlowManageService _serviceWorkFlowManageService;
private readonly IDjyUserConfigService _djyUserConfigService;
@ -189,7 +190,7 @@ namespace Myshipping.Application
IServiceWorkFlowManageService serviceWorkFlowManageService, IDjyUserConfigService djyUserConfigService, IEventPublisher publisher, SqlSugarRepository<BookingSlotBase> repSlotBase,
SqlSugarRepository<BookingSlotAllocation> repSlotAllocation, SqlSugarRepository<BookingSlotAllocationCtn> repSlotAllocationCtn, IBookingSlotService bookingSlotService,
SqlSugarRepository<BookingGoodsStatusSubscribe> repBookingStatusSubscribe, SqlSugarRepository<DjyTenantParamValue> repTenantParamValue, IBookingValueAddedService bookingValueAddedService,
SqlSugarRepository<BookingCustomerOrder> repCustomerOrder, IDjyTenantParamService djyTenantParamService, SqlSugarRepository<DjyCustomerContact> repCustomerContact, SqlSugarRepository<PingTaiCustFee> repPingTaiCustFee)
SqlSugarRepository<BookingCustomerOrder> repCustomerOrder, IDjyTenantParamService djyTenantParamService, SqlSugarRepository<DjyCustomerContact> repCustomerContact, SqlSugarRepository<PingTaiCustFee> repPingTaiCustFee, SqlSugarRepository<BookingMultiLineSplitRecord> repBookingMultiLineSplitRecord)
{
this._logger = logger;
this._rep = rep;
@ -248,6 +249,7 @@ namespace Myshipping.Application
_djyTenantParamService = djyTenantParamService;
_repCustomerContact = repCustomerContact;
_repPingTaiCustFee = repPingTaiCustFee;
_repBookingMultiLineSplitRecord = repBookingMultiLineSplitRecord;
}
#region 主表和箱信息
@ -7741,8 +7743,6 @@ namespace Myshipping.Application
primaryModel.CTNGOODSLIST.Add(cargoModel);
}
ediModel.BSLIST.Add(primaryModel);
//SITC
if (ediRouteEnum == EDIRouteEnum.SITC)
{
@ -7750,8 +7750,28 @@ namespace Myshipping.Application
primaryModel.OpEmail = $"{user.EnName};{(string.IsNullOrEmpty(user.Tel) ? user.Phone : user.Tel)};{UserManager.Email}";
//这里需要调取拆分数据,填充收发通
if (model.multilineid.HasValue && model.multilineid.Value > 0)
{
var multiline = _repBookingMultiLineSplitRecord.AsQueryable().First(b => b.Id == model.multilineid.Value);
if(multiline == null)
throw Oops.Oh($"收、发、通拆分信息获取失败");
primaryModel.SHIPPER = multiline.SHIPPERNAME;
primaryModel.SHIPPERADDR = multiline.SHIPPERADDR1;
primaryModel.CONSIGNEE = multiline.CONSIGNEENAME;
primaryModel.CONSIGNEEADDR = multiline.CONSIGNEEADDR1;
primaryModel.NOTIFYPARTY = multiline.NOTIFYPARTYNAME;
primaryModel.NOTIFYPARTYADDR = multiline.NOTIFYPARTYADDR1;
}
}
ediModel.BSLIST.Add(primaryModel);
var result = await InnerSendBookingOrClosingEDI(model, ediModel, ediRouteEnum);
_logger.LogInformation("批次={no} 生成EDI文件完成 结果={result}", batchNo, JSON.Serialize(result));
@ -8109,10 +8129,11 @@ namespace Myshipping.Application
/// <param name="forwarderName">货代称呼</param>
/// <param name="fileRole">文件功能 (9原始,1 更新,5 退舱 )</param>
/// <param name="sendType">发送类型 B-订舱 E-截单</param>
/// <param name="multilineid">多行文本拆分记录ID(SITC-收、发、通拆分)</param>
/// <returns></returns>
[HttpGet("/BookingOrder/DownloadBookingOrClosingEDI")]
public async Task<IActionResult> DownloadBookingOrClosingEDI([FromQuery] long id, [FromQuery] string orderNo, [FromQuery] bool useForwarderCode,
[FromQuery] string forwarderCode, [FromQuery] string forwarderName, [FromQuery] string fileRole, [FromQuery] string sendType)
[FromQuery] string forwarderCode, [FromQuery] string forwarderName, [FromQuery] string fileRole, [FromQuery] string sendType, [FromQuery] string multilineid = "")
{
var order = _rep.FirstOrDefault(x => x.Id == id);
var FORWARDER = order.FORWARDER;
@ -8664,8 +8685,15 @@ namespace Myshipping.Application
forwarderName = forwarderName,
fileRole = fileRole,
send = false,
sendType = sendType
sendType = sendType,
};
if(!string.IsNullOrWhiteSpace(multilineid))
{
model.multilineid = long.Parse(multilineid);
}
var filePath = InnerBookingOrClosingEDI(model).GetAwaiter().GetResult();
var fileInfo = new FileInfo(filePath);
@ -11827,11 +11855,6 @@ namespace Myshipping.Application
_logger.LogInformation("批次={no}获取请求VOLTA截单详情 {msg}", batchNo, JSON.Serialize(model));
if (!model.sendType.Equals("E", StringComparison.OrdinalIgnoreCase))
{
throw Oops.Bah("只接受发送类型截单E");
}
if (model.Id == 0)
throw Oops.Bah("订单Id不能为空");
@ -11845,6 +11868,44 @@ namespace Myshipping.Application
_logger.LogInformation("批次={no}提取订单信息完成", batchNo);
if (order.CARRIERID.Equals("SITC",StringComparison.OrdinalIgnoreCase))
{
VOLTAEDIBaseModel sitcModel = new VOLTAEDIBaseModel();
if (!string.IsNullOrWhiteSpace(order.SHIPPER))
{
string name = order.SHIPPER;
sitcModel.ShpperName = GetShipCneeNotifyDetail(name);
sitcModel.ShpperAddr = GetShipCneeNotifyDetail(name, "addr");
}
if (!string.IsNullOrWhiteSpace(order.CONSIGNEE))
{
string name = order.CONSIGNEE;
sitcModel.ConsigneeName = GetShipCneeNotifyDetail(name);
sitcModel.ConsigneeAddr = GetShipCneeNotifyDetail(name, "addr");
}
if (!string.IsNullOrWhiteSpace(order.NOTIFYPARTY))
{
string name = order.NOTIFYPARTY;
sitcModel.NotifyName = GetShipCneeNotifyDetail(name);
sitcModel.NotifyAddr = GetShipCneeNotifyDetail(name, "addr");
}
sitcModel.EditPageCode = "SITC";
result.succ = true;
result.extra = sitcModel;
return result;
}
if (!model.sendType.Equals("E", StringComparison.OrdinalIgnoreCase))
{
throw Oops.Bah("只接受发送类型截单E");
}
var allowCarrier = App.Configuration["VOLTASIExportCarrier"].Split(new char[] { ',' });
//if (!order.CARRIERID.Equals("VOL", StringComparison.OrdinalIgnoreCase) && !order.CARRIERID.Equals("FCS", StringComparison.OrdinalIgnoreCase)
// && !order.CARRIERID.Equals("SLS", StringComparison.OrdinalIgnoreCase))
@ -13918,5 +13979,22 @@ namespace Myshipping.Application
return model;
}
#endregion
#region 保存多行拆分记录
/// <summary>
/// 保存多行拆分记录
/// </summary>
/// <param name="model">请求详情</param>
/// <returns>返回记录主键ID</returns>
[HttpPost("/BookingOrder/SaveMultilineSplit")]
public async Task<long> SaveMultilineSplit(BookingMultiLineSplitDto model)
{
BookingMultiLineSplitRecord record = model.Adapt<BookingMultiLineSplitRecord>();
_repBookingMultiLineSplitRecord.InsertReturnEntity(record);
return record.Id;
}
#endregion
}
}

@ -57,5 +57,10 @@ namespace Myshipping.Application
/// </summary>
/// <example>true</example>
public bool send { get; set; } = false;
/// <summary>
/// 多行文本拆分记录ID(SITC-收、发、通拆分)
/// </summary>
public Nullable<long> multilineid { 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 BookingMultiLineSplitDto
{
/// <summary>
/// 订舱ID
/// </summary>
public long BOOKING_ID { get; set; }
/// <summary>
/// 发货人
/// </summary>
public string SHIPPER { get; set; }
/// <summary>
/// 收货人
/// </summary>
public string CONSIGNEE { get; set; }
/// <summary>
/// 通知人
/// </summary>
public string NOTIFYPARTY { get; set; }
/// <summary>
/// 发货人名称
/// </summary>
public string SHIPPERNAME { get; set; }
/// <summary>
/// 发货人地址1
/// </summary>
public string SHIPPERADDR1 { get; set; }
/// <summary>
/// 收货人名称
/// </summary>
public string CONSIGNEENAME { get; set; }
/// <summary>
/// 收货人地址1
/// </summary>
public string CONSIGNEEADDR1 { get; set; }
/// <summary>
/// 通知人名称
/// </summary>
public string NOTIFYPARTYNAME { get; set; }
/// <summary>
/// 通知人地址1
/// </summary>
public string NOTIFYPARTYADDR1 { get; set; }
}
}

@ -6555,10 +6555,11 @@ namespace Myshipping.Application
/// <param name="forwarderName">货代称呼</param>
/// <param name="fileRole">文件功能 (9原始,1 更新,5 退舱 )</param>
/// <param name="sendType">发送类型 E-截单</param>
/// <param name="multilineid">多行文本拆分记录ID(SITC-收、发、通拆分)</param>
/// <returns>返回结果</returns>
[HttpGet("/TaskManage/DownloadClosingEDI")]
public async Task<IActionResult> DownloadClosingEDI([FromQuery] string taskPKId, [FromQuery] string orderNo, [FromQuery] bool useForwarderCode,
[FromQuery] string forwarderCode, [FromQuery] string forwarderName, [FromQuery] string fileRole, [FromQuery] string sendType)
[FromQuery] string forwarderCode, [FromQuery] string forwarderName, [FromQuery] string fileRole, [FromQuery] string sendType, [FromQuery] string multilineid = "")
{
if (sendType?.ToUpper() != "E")
throw Oops.Oh($"sendType只接收E-截单");
@ -6594,6 +6595,11 @@ namespace Myshipping.Application
sendType = sendType
};
if (!string.IsNullOrWhiteSpace(multilineid))
{
model.multilineid = long.Parse(multilineid);
}
var bookingOrderService = _namedBookingOrderServiceProvider.GetService<ITransient>(nameof(BookingOrderService));
var filePath = await bookingOrderService.InnerBookingOrClosingEDI(model);
@ -6616,10 +6622,11 @@ namespace Myshipping.Application
/// <param name="forwarderName">货代称呼</param>
/// <param name="fileRole">文件功能 (9原始,1 更新,5 退舱 )</param>
/// <param name="sendType">发送类型 E-截单</param>
/// <param name="multilineid">多行文本拆分记录ID(SITC-收、发、通拆分)</param>
/// <returns>返回结果</returns>
[HttpGet("/TaskManage/SendClosingEDI")]
public async Task<string> SendClosingEDI([FromQuery] string taskPKId, [FromQuery] string orderNo, [FromQuery] bool useForwarderCode,
[FromQuery] string forwarderCode, [FromQuery] string forwarderName, [FromQuery] string fileRole, [FromQuery] string sendType)
[FromQuery] string forwarderCode, [FromQuery] string forwarderName, [FromQuery] string fileRole, [FromQuery] string sendType, [FromQuery] string multilineid = "")
{
if (sendType?.ToUpper() != "E")
throw Oops.Oh($"sendType只接收E-截单");
@ -6655,6 +6662,11 @@ namespace Myshipping.Application
sendType = sendType
};
if (!string.IsNullOrWhiteSpace(multilineid))
{
model.multilineid = long.Parse(multilineid);
}
var bookingOrderService = _namedBookingOrderServiceProvider.GetService<ITransient>(nameof(BookingOrderService));
return await bookingOrderService.InnerBookingOrClosingEDI(model);

Loading…
Cancel
Save