修改派车任务打印

optimize
jianghaiqing 2 years ago
parent 01401d194c
commit 752550145c

@ -1532,7 +1532,16 @@ namespace Myshipping.Application
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;
@ -1540,13 +1549,15 @@ namespace Myshipping.Application
model.Destination = bookingOrder.DESTINATION;
if (bookingOrder.ETD.HasValue)
model.ETD = bookingOrder.ETD.Value.ToString("yyyy-MM-dd HH:mm:ss");
model.ETD = bookingOrder.ETD.Value.ToString("yyyy-MM-dd");
}
if (truckCtnList.Count > 0)
model.ContaList = truckCtnList.Adapt<List<BookingTruckCtnPrintDto>>();
_logger.LogInformation($"bookingTruckId={bookingTruckId} 请求打印 JSON={JSON.Serialize(model)}");
return await PrintHelper.GeneratePrintFile(JSON.Serialize(model), reportUrl, PRINT_DATASOURCE_KEY,
printFileType, printTemplate);
}

@ -0,0 +1,325 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
///
/// </summary>
public class TaskTruckPrintDto
{
/// <summary>
/// 主键
/// </summary>
public long Id { get; set; }
/// <summary>
/// 订舱ID
/// </summary>
public string BookingId { get; set; }
/// <summary>
/// 车队ID
/// </summary>
public string TruckId { get; set; }
/// <summary>
/// 车队代码
/// </summary>
public string TruckCode { get; set; }
/// <summary>
/// 车队代码
/// </summary>
public string TruckName { get; set; }
/// <summary>
/// TO
/// </summary>
public string ToName { get; set; }
/// <summary>
/// ATTN
/// </summary>
public string Attn { get; set; }
/// <summary>
/// ATTN电话
/// </summary>
public string AttnTel { get; set; }
/// <summary>
/// ATTN邮箱
/// </summary>
public string AttnMail { get; set; }
/// <summary>
/// ATTN传真
/// </summary>
public string AttnFax { get; set; }
/// <summary>
/// FROM
/// </summary>
public string FromName { get; set; }
/// <summary>
/// FROM电话
/// </summary>
public string FromTel { get; set; }
/// <summary>
/// FROM邮箱
/// </summary>
public string FromMail { get; set; }
/// <summary>
/// FROM传真
/// </summary>
public string FromFax { get; set; }
/// <summary>
/// 吨数
/// </summary>
public string KGS { get; set; }
/// <summary>
/// 陆运费
/// </summary>
public string Fee { get; set; }
/// <summary>
/// 支付方式
/// </summary>
public string PayMethod { get; set; }
/// <summary>
/// 支付方式名称
/// </summary>
public string PayMethodName { get; set; }
/// <summary>
/// 派车日期
/// </summary>
public string TruckTime { get; set; }
/// <summary>
/// 提箱场站ID
/// </summary>
public string YARDID { get; set; }
/// <summary>
/// 提箱场站
/// </summary>
public string YARD { get; set; }
/// <summary>
/// 场站联系人
/// </summary>
public string YARDCONTRACT { get; set; }
/// <summary>
/// 场站联系人电话
/// </summary>
public string YARDCONTRACTTEL { get; set; }
/// <summary>
/// 工厂ID
/// </summary>
public string FactoryId { get; set; }
/// <summary>
/// 工厂代码
/// </summary>
public string FactoryCode { get; set; }
/// <summary>
/// 工厂名称
/// </summary>
public string FactoryName { get; set; }
/// <summary>
/// 工厂联系人
/// </summary>
public string FactoryContact { get; set; }
/// <summary>
/// 工厂联系电话
/// </summary>
public string FactoryTel { get; set; }
/// <summary>
/// 返场时间
/// </summary>
public string ReturnTime { get; set; }
/// <summary>
/// 入货场站ID
/// </summary>
public string InYardID { get; set; }
/// <summary>
/// 入货场站
/// </summary>
public string InYard { get; set; }
/// <summary>
/// 入货联系人
/// </summary>
public string InYardContact { get; set; }
/// <summary>
/// 入货联系人电话
/// </summary>
public string InYardContractTel { get; set; }
/// <summary>
/// 要求到达时间
/// </summary>
public string NeedArriveTime { get; set; }
/// <summary>
/// 截港日期
/// </summary>
public string ClosingTime { get; set; }
/// <summary>
/// 提货日期
/// </summary>
public string PickUpTime { get; set; }
/// <summary>
/// 是否挂机
/// </summary>
public string IsGuaJi { get; set; }
/// <summary>
/// 注意事项
/// </summary>
public string Attention { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 调度ID
/// </summary>
public string DispatcherId { get; set; }
/// <summary>
/// 调度名称
/// </summary>
public string DispatcherName { get; set; }
/// <summary>
/// 工厂地址
/// </summary>
public string FactoryAddr { get; set; }
/// <summary>
/// 船名
/// </summary>
public string Vessel { get; set; }
/// <summary>
/// 航次
/// </summary>
public string VoyNo { get; set; }
/// <summary>
/// 提单号
/// </summary>
public string MBLNo { get; set; }
/// <summary>
/// 箱型箱量
/// </summary>
public string CntrTotal { get; set; }
/// <summary>
/// 开船日期
/// </summary>
public string ETD { get; set; }
/// <summary>
/// 目的港代码
/// </summary>
public string DestinationID { get; set; }
/// <summary>
/// 目的港名称
/// </summary>
public string Destination { get; set; }
/// <summary>
/// 船公司代号
/// </summary>
public string CarrierID { get; set; }
/// <summary>
/// 船公司
/// </summary>
public string Carrier { get; set; }
/// <summary>
/// 集装箱列表
/// </summary>
public List<TaskTruckCtnPrintDto> ContaList { get; set; }
}
public class TaskTruckCtnPrintDto
{
/// <summary>
/// 箱型代码
/// </summary>
public string CTNCODE { get; set; }
/// <summary>
/// 箱型
/// </summary>
public string CTNALL { get; set; }
/// <summary>
/// 箱量
/// </summary>
public string CTNNUM { get; set; }
/// <summary>
/// TEU
/// </summary>
public string TEU { get; set; }
/// <summary>
/// 箱号
/// </summary>
public string CNTRNO { get; set; }
/// <summary>
/// 封号
/// </summary>
public string SEALNO { get; set; }
/// <summary>
/// 件数
/// </summary>
public string PKGS { get; set; }
/// <summary>
/// 包装
/// </summary>
public string KINDPKGS { get; set; }
/// <summary>
/// 毛重
/// </summary>
public string KGS { get; set; }
/// <summary>
/// 尺码
/// </summary>
public string CBM { get; set; }
/// <summary>
/// 皮重
/// </summary>
public string TAREWEIGHT { get; set; }
/// <summary>
/// 箱状态
/// </summary>
public string CTNSTATUS { get; set; }
/// <summary>
/// 称重方式
/// </summary>
public string WEIGHTYPE { get; set; }
/// <summary>
/// 称重重量
/// </summary>
public string WEIGHKGS { get; set; }
/// <summary>
/// 称重联系人
/// </summary>
public string WEIGHATTN { get; set; }
/// <summary>
/// VGM联系公司
/// </summary>
public string VGMCONNCOM { get; set; }
/// <summary>
/// VGM联系电话
/// </summary>
public string WEIGHTEL { get; set; }
/// <summary>
/// 称重日期
/// </summary>
public string WEIGHDATE { get; set; }
/// <summary>
/// VGM地址
/// </summary>
public string VGMADDR { get; set; }
/// <summary>
/// VGM邮箱
/// </summary>
public string VGMEMAIL { get; set; }
/// <summary>
/// 备注
/// </summary>
public string REMARK { get; set; }
/// <summary>
/// 车牌号
/// </summary>
public string CarNumber { get; set; }
/// <summary>
/// 司机
/// </summary>
public string CarDriver { get; set; }
/// <summary>
/// 司机电话
/// </summary>
public string CarDriverTel { get; set; }
}
}

@ -38,6 +38,7 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<BookingPrintTemplate> _bookingPrintTemplateTemplate;
private readonly SqlSugarRepository<DjyUserConfig> _djyUserConfigConfig;
private readonly SqlSugarRepository<BookingExcelTemplate> _bookingExcelTemplateRepository;
private readonly SqlSugarRepository<BookingOrder> _bookingOrderRepository;
const string PRINT_LIST_TYPE_KEY = "booking_truck_print_list";
const string PRINT_DATASOURCE_KEY = "booking_order";
@ -47,6 +48,7 @@ namespace Myshipping.Application
SqlSugarRepository<BookingPrintTemplate> bookingPrintTemplateTemplate,
SqlSugarRepository<DjyUserConfig> djyUserConfigConfig,
SqlSugarRepository<BookingExcelTemplate> bookingExcelTemplateRepository,
SqlSugarRepository<BookingOrder> bookingOrderRepository,
ISysCacheService cache, ILogger<BookingTruckService> logger)
{
_cache = cache;
@ -59,6 +61,7 @@ namespace Myshipping.Application
_bookingPrintTemplateTemplate = bookingPrintTemplateTemplate;
_djyUserConfigConfig = djyUserConfigConfig;
_bookingExcelTemplateRepository = bookingExcelTemplateRepository;
_bookingOrderRepository = bookingOrderRepository;
}
/// <summary>
@ -628,10 +631,65 @@ namespace Myshipping.Application
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)
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,
printFileType, printTemplate);

Loading…
Cancel
Save