|
|
@ -38,6 +38,7 @@ namespace Myshipping.Application
|
|
|
|
private readonly SqlSugarRepository<BookingPrintTemplate> _bookingPrintTemplateTemplate;
|
|
|
|
private readonly SqlSugarRepository<BookingPrintTemplate> _bookingPrintTemplateTemplate;
|
|
|
|
private readonly SqlSugarRepository<DjyUserConfig> _djyUserConfigConfig;
|
|
|
|
private readonly SqlSugarRepository<DjyUserConfig> _djyUserConfigConfig;
|
|
|
|
private readonly SqlSugarRepository<BookingExcelTemplate> _bookingExcelTemplateRepository;
|
|
|
|
private readonly SqlSugarRepository<BookingExcelTemplate> _bookingExcelTemplateRepository;
|
|
|
|
|
|
|
|
private readonly SqlSugarRepository<BookingOrder> _bookingOrderRepository;
|
|
|
|
|
|
|
|
|
|
|
|
const string PRINT_LIST_TYPE_KEY = "booking_truck_print_list";
|
|
|
|
const string PRINT_LIST_TYPE_KEY = "booking_truck_print_list";
|
|
|
|
const string PRINT_DATASOURCE_KEY = "booking_order";
|
|
|
|
const string PRINT_DATASOURCE_KEY = "booking_order";
|
|
|
@ -47,6 +48,7 @@ namespace Myshipping.Application
|
|
|
|
SqlSugarRepository<BookingPrintTemplate> bookingPrintTemplateTemplate,
|
|
|
|
SqlSugarRepository<BookingPrintTemplate> bookingPrintTemplateTemplate,
|
|
|
|
SqlSugarRepository<DjyUserConfig> djyUserConfigConfig,
|
|
|
|
SqlSugarRepository<DjyUserConfig> djyUserConfigConfig,
|
|
|
|
SqlSugarRepository<BookingExcelTemplate> bookingExcelTemplateRepository,
|
|
|
|
SqlSugarRepository<BookingExcelTemplate> bookingExcelTemplateRepository,
|
|
|
|
|
|
|
|
SqlSugarRepository<BookingOrder> bookingOrderRepository,
|
|
|
|
ISysCacheService cache, ILogger<BookingTruckService> logger)
|
|
|
|
ISysCacheService cache, ILogger<BookingTruckService> logger)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_cache = cache;
|
|
|
|
_cache = cache;
|
|
|
@ -59,6 +61,7 @@ namespace Myshipping.Application
|
|
|
|
_bookingPrintTemplateTemplate = bookingPrintTemplateTemplate;
|
|
|
|
_bookingPrintTemplateTemplate = bookingPrintTemplateTemplate;
|
|
|
|
_djyUserConfigConfig = djyUserConfigConfig;
|
|
|
|
_djyUserConfigConfig = djyUserConfigConfig;
|
|
|
|
_bookingExcelTemplateRepository = bookingExcelTemplateRepository;
|
|
|
|
_bookingExcelTemplateRepository = bookingExcelTemplateRepository;
|
|
|
|
|
|
|
|
_bookingOrderRepository = bookingOrderRepository;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -628,10 +631,65 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
|
|
var truckCtnList = _taskTruckContaRepository.AsQueryable().Where(a => a.P_ID == taskTruckId).ToList();
|
|
|
|
var truckCtnList = _taskTruckContaRepository.AsQueryable().Where(a => a.P_ID == taskTruckId).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
TaskTruckShowDto model = truckOrder.Adapt<TaskTruckShowDto>();
|
|
|
|
BookingOrder bookingOrder = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (truckOrder.BookingId.HasValue && truckOrder.BookingId.Value > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
bookingOrder = _bookingOrderRepository.AsQueryable().First(a => a.Id == truckOrder.BookingId.Value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TaskTruckPrintDto model = truckOrder.Adapt<TaskTruckPrintDto>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(bookingOrder.VOYNO))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
model.VoyNo = bookingOrder.VOYNO;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
model.VoyNo = bookingOrder.VOYNOINNER;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (truckCtnList.Count > 0)
|
|
|
|
if (truckCtnList.Count > 0)
|
|
|
|
model.ContaList = truckCtnList.Adapt<List<TaskTruckCtnDto>>();
|
|
|
|
model.ContaList = truckCtnList.Adapt<List<TaskTruckCtnPrintDto>>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation($"taskTruckId={taskTruckId} 请求打印 JSON={JSON.Serialize(model)}");
|
|
|
|
|
|
|
|
|
|
|
|
return await PrintHelper.GeneratePrintFile(JSON.Serialize(model), genUrl, PRINT_DATASOURCE_KEY,
|
|
|
|
return await PrintHelper.GeneratePrintFile(JSON.Serialize(model), genUrl, PRINT_DATASOURCE_KEY,
|
|
|
|
printFileType, printTemplate);
|
|
|
|
printFileType, printTemplate);
|
|
|
|