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