修改派车打印

optimize
jianghaiqing 2 years ago
parent 7ad307ac2a
commit 4fcce982b3

@ -0,0 +1,46 @@
using Furion.FriendlyException;
using MySqlX.XDevAPI.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace Myshipping.Application
{
public static class ExceptionExtensionHelper
{
/// <summary>
/// 提取异常详情信息
/// </summary>
/// <param name="currException">异常类型</param>
/// <param name="errorTitle">标题</param>
/// <returns>返回异常详情</returns>
public static string GetMessage(this Exception currException, string errorTitle = "")
{
string msg = string.Empty;
try
{
if (currException is InvalidOperationException)
{
msg = currException.Message;
}
else if(!string.IsNullOrWhiteSpace(errorTitle))
{
msg = $"{errorTitle},原因:{currException.Message}";
}
else
{
msg = currException.Message;
}
}
catch (Exception ex)
{
throw Oops.Bah("提取异常详情失败", ex.Message);
}
return msg;
}
}
}

@ -1020,7 +1020,7 @@ namespace Myshipping.Application
var truckOrder = _bookingTruckRepository.AsQueryable().First(a => a.Id == id); var truckOrder = _bookingTruckRepository.AsQueryable().First(a => a.Id == id);
if(truckOrder == null) if(truckOrder == null)
throw Oops.Oh($"派车信息获取失败,派车信息不存在或已作废"); throw Oops.Oh($"派车信息获取失败,派车信息不存在或已作废", typeof(InvalidOperationException));
//先校验 //先校验
ValidateTruck(OperateTypeEnum.Delete, new BookingTruck[] { truckOrder }); ValidateTruck(OperateTypeEnum.Delete, new BookingTruck[] { truckOrder });
@ -1036,7 +1036,7 @@ namespace Myshipping.Application
catch (Exception ex) catch (Exception ex)
{ {
result.succ = false; result.succ = false;
result.msg = $"删除派车异常,原因:{ex.Message}"; result.msg = ex.GetMessage("删除派车异常");
} }
return result; return result;
@ -1077,7 +1077,7 @@ namespace Myshipping.Application
catch (Exception ex) catch (Exception ex)
{ {
result.succ = false; result.succ = false;
result.msg = $"删除派车异常,原因:{ex.Message}"; result.msg = ex.GetMessage("删除派车异常");
} }
return result; return result;
@ -1507,27 +1507,6 @@ namespace Myshipping.Application
BookingTruckPrintDto model = truckOrder.Adapt<BookingTruckPrintDto>(); 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 ? "是" : "无"; model.IsGuaJi = truckOrder.IsGuaJi ? "是" : "无";
if (bookingOrder != null) if (bookingOrder != null)
{ {
@ -1547,9 +1526,7 @@ namespace Myshipping.Application
model.Carrier = bookingOrder.CARRIER; model.Carrier = bookingOrder.CARRIER;
model.DestinationID = bookingOrder.DESTINATIONID; model.DestinationID = bookingOrder.DESTINATIONID;
model.Destination = bookingOrder.DESTINATION; model.Destination = bookingOrder.DESTINATION;
model.ETD = bookingOrder.ETD;
if (bookingOrder.ETD.HasValue)
model.ETD = bookingOrder.ETD.Value.ToString("yyyy-MM-dd");
} }

@ -68,11 +68,11 @@ namespace Myshipping.Application
/// <summary> /// <summary>
/// 吨数 /// 吨数
/// </summary> /// </summary>
public string KGS { get; set; } public Nullable<decimal> KGS { get; set; }
/// <summary> /// <summary>
/// 陆运费 /// 陆运费
/// </summary> /// </summary>
public string Fee { get; set; } public Nullable<decimal> Fee { get; set; }
/// <summary> /// <summary>
/// 支付方式 /// 支付方式
/// </summary> /// </summary>
@ -82,10 +82,6 @@ namespace Myshipping.Application
/// </summary> /// </summary>
public string PayMethodName { get; set; } public string PayMethodName { get; set; }
/// <summary> /// <summary>
/// 派车日期
/// </summary>
public string TruckTime { get; set; }
/// <summary>
/// 提箱场站ID /// 提箱场站ID
/// </summary> /// </summary>
public string YARDID { get; set; } public string YARDID { get; set; }
@ -104,7 +100,7 @@ namespace Myshipping.Application
/// <summary> /// <summary>
/// 工厂ID /// 工厂ID
/// </summary> /// </summary>
public string FactoryId { get; set; } public Nullable<long> FactoryId { get; set; }
/// <summary> /// <summary>
/// 工厂代码 /// 工厂代码
/// </summary> /// </summary>
@ -122,9 +118,29 @@ namespace Myshipping.Application
/// </summary> /// </summary>
public string FactoryTel { get; set; } public string FactoryTel { get; set; }
/// <summary> /// <summary>
/// 派车日期
/// </summary>
public Nullable<DateTime> TruckTime { get; set; }
/// <summary>
/// 返场时间 /// 返场时间
/// </summary> /// </summary>
public string ReturnTime { get; set; } public Nullable<DateTime> ReturnTime { get; set; }
/// <summary>
/// 要求到达时间
/// </summary>
public Nullable<DateTime> NeedArriveTime { get; set; }
/// <summary>
/// 截港日期
/// </summary>
public Nullable<DateTime> ClosingTime { get; set; }
/// <summary>
/// 提货日期
/// </summary>
public Nullable<DateTime> PickUpTime { get; set; }
/// <summary>
/// 开船日期
/// </summary>
public Nullable<DateTime> ETD { get; set; }
/// <summary> /// <summary>
/// 入货场站ID /// 入货场站ID
/// </summary> /// </summary>
@ -141,18 +157,7 @@ namespace Myshipping.Application
/// 入货联系人电话 /// 入货联系人电话
/// </summary> /// </summary>
public string InYardContractTel { get; set; } 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>
/// 是否挂机 /// 是否挂机
/// </summary> /// </summary>
@ -195,10 +200,7 @@ namespace Myshipping.Application
/// 箱型箱量 /// 箱型箱量
/// </summary> /// </summary>
public string CntrTotal { get; set; } public string CntrTotal { get; set; }
/// <summary>
/// 开船日期
/// </summary>
public string ETD { get; set; }
/// <summary> /// <summary>
/// 目的港代码 /// 目的港代码
/// </summary> /// </summary>
@ -234,11 +236,15 @@ namespace Myshipping.Application
/// <summary> /// <summary>
/// 箱量 /// 箱量
/// </summary> /// </summary>
public string CTNNUM { get; set; } public Nullable<int> CTNNUM { get; set; }
/// <summary> /// <summary>
/// TEU /// TEU
/// </summary> /// </summary>
public string TEU { get; set; } public Nullable<int> TEU { get; set; }
/// <summary>
/// 件数
/// </summary>
public Nullable<int> PKGS { get; set; }
/// <summary> /// <summary>
/// 箱号 /// 箱号
/// </summary> /// </summary>
@ -247,10 +253,7 @@ namespace Myshipping.Application
/// 封号 /// 封号
/// </summary> /// </summary>
public string SEALNO { get; set; } public string SEALNO { get; set; }
/// <summary>
/// 件数
/// </summary>
public string PKGS { get; set; }
/// <summary> /// <summary>
/// 包装 /// 包装
/// </summary> /// </summary>
@ -258,15 +261,19 @@ namespace Myshipping.Application
/// <summary> /// <summary>
/// 毛重 /// 毛重
/// </summary> /// </summary>
public string KGS { get; set; } public Nullable<decimal> KGS { get; set; }
/// <summary> /// <summary>
/// 尺码 /// 尺码
/// </summary> /// </summary>
public string CBM { get; set; } public Nullable<decimal> CBM { get; set; }
/// <summary> /// <summary>
/// 皮重 /// 皮重
/// </summary> /// </summary>
public string TAREWEIGHT { get; set; } public Nullable<decimal> TAREWEIGHT { get; set; }
/// <summary>
/// 称重重量
/// </summary>
public Nullable<decimal> WEIGHKGS { get; set; }
/// <summary> /// <summary>
/// 箱状态 /// 箱状态
/// </summary> /// </summary>
@ -276,10 +283,6 @@ namespace Myshipping.Application
/// </summary> /// </summary>
public string WEIGHTYPE { get; set; } public string WEIGHTYPE { get; set; }
/// <summary> /// <summary>
/// 称重重量
/// </summary>
public string WEIGHKGS { get; set; }
/// <summary>
/// 称重联系人 /// 称重联系人
/// </summary> /// </summary>
public string WEIGHATTN { get; set; } public string WEIGHATTN { get; set; }

@ -70,11 +70,11 @@ namespace Myshipping.Application
/// <summary> /// <summary>
/// 吨数 /// 吨数
/// </summary> /// </summary>
public string KGS { get; set; } public Nullable<decimal> KGS { get; set; }
/// <summary> /// <summary>
/// 陆运费 /// 陆运费
/// </summary> /// </summary>
public string Fee { get; set; } public Nullable<decimal> Fee { get; set; }
/// <summary> /// <summary>
/// 支付方式 /// 支付方式
/// </summary> /// </summary>
@ -84,10 +84,6 @@ namespace Myshipping.Application
/// </summary> /// </summary>
public string PayMethodName { get; set; } public string PayMethodName { get; set; }
/// <summary> /// <summary>
/// 派车日期
/// </summary>
public string TruckTime { get; set; }
/// <summary>
/// 提箱场站ID /// 提箱场站ID
/// </summary> /// </summary>
public string YARDID { get; set; } public string YARDID { get; set; }
@ -106,7 +102,7 @@ namespace Myshipping.Application
/// <summary> /// <summary>
/// 工厂ID /// 工厂ID
/// </summary> /// </summary>
public string FactoryId { get; set; } public Nullable<long> FactoryId { get; set; }
/// <summary> /// <summary>
/// 工厂代码 /// 工厂代码
/// </summary> /// </summary>
@ -124,9 +120,29 @@ namespace Myshipping.Application
/// </summary> /// </summary>
public string FactoryTel { get; set; } public string FactoryTel { get; set; }
/// <summary> /// <summary>
/// 派车日期
/// </summary>
public Nullable<DateTime> TruckTime { get; set; }
/// <summary>
/// 返场时间 /// 返场时间
/// </summary> /// </summary>
public string ReturnTime { get; set; } public Nullable<DateTime> ReturnTime { get; set; }
/// <summary>
/// 要求到达时间
/// </summary>
public Nullable<DateTime> NeedArriveTime { get; set; }
/// <summary>
/// 截港日期
/// </summary>
public Nullable<DateTime> ClosingTime { get; set; }
/// <summary>
/// 提货日期
/// </summary>
public Nullable<DateTime> PickUpTime { get; set; }
/// <summary>
/// 开船日期
/// </summary>
public Nullable<DateTime> ETD { get; set; }
/// <summary> /// <summary>
/// 入货场站ID /// 入货场站ID
/// </summary> /// </summary>
@ -143,18 +159,7 @@ namespace Myshipping.Application
/// 入货联系人电话 /// 入货联系人电话
/// </summary> /// </summary>
public string InYardContractTel { get; set; } 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>
/// 是否挂机 /// 是否挂机
/// </summary> /// </summary>
@ -197,10 +202,7 @@ namespace Myshipping.Application
/// 箱型箱量 /// 箱型箱量
/// </summary> /// </summary>
public string CntrTotal { get; set; } public string CntrTotal { get; set; }
/// <summary>
/// 开船日期
/// </summary>
public string ETD { get; set; }
/// <summary> /// <summary>
/// 目的港代码 /// 目的港代码
/// </summary> /// </summary>
@ -236,11 +238,15 @@ namespace Myshipping.Application
/// <summary> /// <summary>
/// 箱量 /// 箱量
/// </summary> /// </summary>
public string CTNNUM { get; set; } public Nullable<int> CTNNUM { get; set; }
/// <summary> /// <summary>
/// TEU /// TEU
/// </summary> /// </summary>
public string TEU { get; set; } public Nullable<int> TEU { get; set; }
/// <summary>
/// 件数
/// </summary>
public Nullable<int> PKGS { get; set; }
/// <summary> /// <summary>
/// 箱号 /// 箱号
/// </summary> /// </summary>
@ -249,10 +255,7 @@ namespace Myshipping.Application
/// 封号 /// 封号
/// </summary> /// </summary>
public string SEALNO { get; set; } public string SEALNO { get; set; }
/// <summary>
/// 件数
/// </summary>
public string PKGS { get; set; }
/// <summary> /// <summary>
/// 包装 /// 包装
/// </summary> /// </summary>
@ -260,15 +263,19 @@ namespace Myshipping.Application
/// <summary> /// <summary>
/// 毛重 /// 毛重
/// </summary> /// </summary>
public string KGS { get; set; } public Nullable<decimal> KGS { get; set; }
/// <summary> /// <summary>
/// 尺码 /// 尺码
/// </summary> /// </summary>
public string CBM { get; set; } public Nullable<decimal> CBM { get; set; }
/// <summary> /// <summary>
/// 皮重 /// 皮重
/// </summary> /// </summary>
public string TAREWEIGHT { get; set; } public Nullable<decimal> TAREWEIGHT { get; set; }
/// <summary>
/// 称重重量
/// </summary>
public Nullable<decimal> WEIGHKGS { get; set; }
/// <summary> /// <summary>
/// 箱状态 /// 箱状态
/// </summary> /// </summary>
@ -278,10 +285,6 @@ namespace Myshipping.Application
/// </summary> /// </summary>
public string WEIGHTYPE { get; set; } public string WEIGHTYPE { get; set; }
/// <summary> /// <summary>
/// 称重重量
/// </summary>
public string WEIGHKGS { get; set; }
/// <summary>
/// 称重联系人 /// 称重联系人
/// </summary> /// </summary>
public string WEIGHATTN { get; set; } public string WEIGHATTN { get; set; }

@ -640,27 +640,6 @@ namespace Myshipping.Application
TaskTruckPrintDto model = truckOrder.Adapt<TaskTruckPrintDto>(); 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 ? "是" : "无"; model.IsGuaJi = truckOrder.IsGuaJi ? "是" : "无";
if (bookingOrder != null) if (bookingOrder != null)
{ {
@ -680,10 +659,7 @@ namespace Myshipping.Application
model.Carrier = bookingOrder.CARRIER; model.Carrier = bookingOrder.CARRIER;
model.DestinationID = bookingOrder.DESTINATIONID; model.DestinationID = bookingOrder.DESTINATIONID;
model.Destination = bookingOrder.DESTINATION; model.Destination = bookingOrder.DESTINATION;
model.ETD = bookingOrder.ETD;
if (bookingOrder.ETD.HasValue)
model.ETD = bookingOrder.ETD.Value.ToString("yyyy-MM-dd");
} }
if (truckCtnList.Count > 0) if (truckCtnList.Count > 0)

Loading…
Cancel
Save