修改派车打印

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);
if(truckOrder == null)
throw Oops.Oh($"派车信息获取失败,派车信息不存在或已作废");
throw Oops.Oh($"派车信息获取失败,派车信息不存在或已作废", typeof(InvalidOperationException));
//先校验
ValidateTruck(OperateTypeEnum.Delete, new BookingTruck[] { truckOrder });
@ -1036,7 +1036,7 @@ namespace Myshipping.Application
catch (Exception ex)
{
result.succ = false;
result.msg = $"删除派车异常,原因:{ex.Message}";
result.msg = ex.GetMessage("删除派车异常");
}
return result;
@ -1077,7 +1077,7 @@ namespace Myshipping.Application
catch (Exception ex)
{
result.succ = false;
result.msg = $"删除派车异常,原因:{ex.Message}";
result.msg = ex.GetMessage("删除派车异常");
}
return result;
@ -1507,27 +1507,6 @@ namespace Myshipping.Application
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)
{
@ -1547,9 +1526,7 @@ namespace Myshipping.Application
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");
model.ETD = bookingOrder.ETD;
}

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

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

@ -640,27 +640,6 @@ namespace Myshipping.Application
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)
{
@ -680,10 +659,7 @@ namespace Myshipping.Application
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");
model.ETD = bookingOrder.ETD;
}
if (truckCtnList.Count > 0)

Loading…
Cancel
Save