|
|
|
@ -6,6 +6,7 @@ using Furion.FriendlyException;
|
|
|
|
|
using Furion.JsonSerialization;
|
|
|
|
|
using Furion.RemoteRequest.Extensions;
|
|
|
|
|
using Mapster;
|
|
|
|
|
using MathNet.Numerics.LinearAlgebra.Factorization;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
using Myshipping.Application.ConfigOption;
|
|
|
|
@ -432,9 +433,9 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private BookingTruckDto InnerCreateTruckFromBookingOrder(long bookingId)
|
|
|
|
|
private BookingTruckShowDto InnerCreateTruckFromBookingOrder(long bookingId)
|
|
|
|
|
{
|
|
|
|
|
BookingTruckDto model = null;
|
|
|
|
|
BookingTruckShowDto model = null;
|
|
|
|
|
|
|
|
|
|
//取订舱主信息
|
|
|
|
|
var orderInfo = _bookingOrderRepository.AsQueryable()
|
|
|
|
@ -443,13 +444,16 @@ namespace Myshipping.Application
|
|
|
|
|
if (orderInfo == null)
|
|
|
|
|
throw Oops.Oh($"订舱主键{bookingId}无法获取业务信息");
|
|
|
|
|
|
|
|
|
|
model = new BookingTruckDto();
|
|
|
|
|
model = new BookingTruckShowDto();
|
|
|
|
|
|
|
|
|
|
model.YARDID = orderInfo.YARDID;
|
|
|
|
|
model.YARD = orderInfo.YARD;
|
|
|
|
|
model.ClosingTime = orderInfo.CLOSINGDATE;
|
|
|
|
|
model.InYardID = orderInfo.YARDID;
|
|
|
|
|
model.InYard = orderInfo.YARD;
|
|
|
|
|
model.MBLNo = orderInfo.MBLNO;
|
|
|
|
|
model.Vessel = orderInfo.VESSEL;
|
|
|
|
|
model.VoyNo = orderInfo.VOYNO;
|
|
|
|
|
|
|
|
|
|
model.FromName = UserManager.Name;
|
|
|
|
|
model.FromTel = UserManager.TEl;
|
|
|
|
@ -1494,10 +1498,54 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
var truckCtnList = _bookingTruckContaRepository.AsQueryable().Where(a => a.TruckId == bookingTruckId).ToList();
|
|
|
|
|
|
|
|
|
|
BookingTruckShowDto model = truckOrder.Adapt<BookingTruckShowDto>();
|
|
|
|
|
BookingOrder bookingOrder = null;
|
|
|
|
|
|
|
|
|
|
if (truckOrder.BookingId.HasValue && truckOrder.BookingId.Value > 0)
|
|
|
|
|
{
|
|
|
|
|
bookingOrder = _bookingOrderRepository.AsQueryable().First(a => a.Id == truckOrder.BookingId.Value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BookingTruckPrintDto model = truckOrder.Adapt<BookingTruckPrintDto>();
|
|
|
|
|
|
|
|
|
|
if (truckOrder.ClosingTime.HasValue)
|
|
|
|
|
model.ClosingTime = truckOrder.ClosingTime.Value.ToString("yyyy-MM-dd HH:mm");
|
|
|
|
|
|
|
|
|
|
if (truckOrder.TruckTime.HasValue)
|
|
|
|
|
model.TruckTime = truckOrder.TruckTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
|
|
|
|
if (truckOrder.ReturnTime.HasValue)
|
|
|
|
|
model.ReturnTime = truckOrder.ReturnTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
|
|
|
|
if (truckOrder.NeedArriveTime.HasValue)
|
|
|
|
|
model.NeedArriveTime = truckOrder.NeedArriveTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
|
|
|
|
if (truckOrder.PickUpTime.HasValue)
|
|
|
|
|
model.PickUpTime = truckOrder.PickUpTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
|
|
|
|
if (truckOrder.KGS.HasValue)
|
|
|
|
|
model.KGS = truckOrder.KGS.Value.ToString("0.###");
|
|
|
|
|
|
|
|
|
|
if (truckOrder.Fee.HasValue)
|
|
|
|
|
model.Fee = truckOrder.Fee.Value.ToString("0.##");
|
|
|
|
|
|
|
|
|
|
model.IsGuaJi = truckOrder.IsGuaJi ? "是" : "无";
|
|
|
|
|
if (bookingOrder != null)
|
|
|
|
|
{
|
|
|
|
|
model.Vessel = bookingOrder.VESSEL;
|
|
|
|
|
model.VoyNo = bookingOrder.VOYNO;
|
|
|
|
|
model.MBLNo = bookingOrder.MBLNO;
|
|
|
|
|
model.CarrierID = bookingOrder.CARRIERID;
|
|
|
|
|
model.Carrier = bookingOrder.CARRIER;
|
|
|
|
|
model.DestinationID = bookingOrder.DESTINATIONID;
|
|
|
|
|
model.Destination = bookingOrder.DESTINATION;
|
|
|
|
|
|
|
|
|
|
if (bookingOrder.ETD.HasValue)
|
|
|
|
|
model.ETD = bookingOrder.ETD.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (truckCtnList.Count > 0)
|
|
|
|
|
model.ContaList = truckCtnList.Adapt<List<BookingTruckCtnDto>>();
|
|
|
|
|
model.ContaList = truckCtnList.Adapt<List<BookingTruckCtnPrintDto>>();
|
|
|
|
|
|
|
|
|
|
return await PrintHelper.GeneratePrintFile(JSON.Serialize(model), reportUrl, PRINT_DATASOURCE_KEY,
|
|
|
|
|
printFileType, printTemplate);
|
|
|
|
@ -1551,6 +1599,36 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 派车任务回写派车详情
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="info">派车详情</param>
|
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
|
public async Task<TaskManageOrderResultDto> TruckDispatchCompleteCallBack(BookingTruckDto info)
|
|
|
|
|
{
|
|
|
|
|
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
/*
|
|
|
|
|
回写逻辑
|
|
|
|
|
1、派车任务完成发送派车后,自动回写派车任务表的详情
|
|
|
|
|
2、需校验如果派车不是已提交,不能回写。
|
|
|
|
|
3、比较差异留存。
|
|
|
|
|
*/
|
|
|
|
|
var id = await InnerSave(info);
|
|
|
|
|
|
|
|
|
|
result.succ = true;
|
|
|
|
|
result.msg = "保存成功";
|
|
|
|
|
result.ext = id;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.succ = false;
|
|
|
|
|
result.msg = $"保存派车异常,原因:{ex.Message}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|