wet 2 years ago
commit 95652f705e

@ -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;
@ -1475,11 +1479,11 @@ namespace Myshipping.Application
/// <param name="printType">文档类型1pdf、2xlsx、3docx</param>
/// <returns>返回文件流</returns>
[NonAction]
private async Task<byte[]> GenPrintFile(long bookingTruckId, BookingPrintTemplate printTemplate,
private async Task<byte[]> GenPrintFile(long bookingTruckId, BookingPrintTemplate printTemplate,
PrintFileTypeEnum printFileType = PrintFileTypeEnum.PDF)
{
//打印报表服务地址
var reportUrl = _cache.GetAllDictData().Result.FirstOrDefault(x => x.TypeCode == "url_set"
var reportUrl = _cache.GetAllDictData().Result.FirstOrDefault(x => x.TypeCode == "url_set"
&& x.Code == "url_report_generate").Value;
if (!reportUrl.EndsWith("/"))
@ -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;
}
}
}

@ -126,7 +126,12 @@ namespace Myshipping.Application
/// <returns></returns>
Task<dynamic> PrintTemplateWithHistoryList(string cateCode, BookingPrintTemplateType printType);
/// <summary>
/// 派车任务回写派车详情
/// </summary>
/// <param name="info">派车详情</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> TruckDispatchCompleteCallBack(BookingTruckDto info);
}
}

Loading…
Cancel
Save