From 336858c0a4a7ed6596e80fb5137b945f520aa6f3 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 18 Apr 2023 13:36:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8B=E8=B4=A7?= =?UTF-8?q?=E7=BA=B8=E6=AF=94=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Myshipping.Application/EDI/TSLEdiHelper.cs | 5 +-- .../BookingOrder/Dto/PageBookingOrder.cs | 4 ++ .../BookingTruck/BookingTruckService.cs | 41 +++++++++++++++++++ 3 files changed, 47 insertions(+), 3 deletions(-) diff --git a/Myshipping.Application/EDI/TSLEdiHelper.cs b/Myshipping.Application/EDI/TSLEdiHelper.cs index f2f9907f..c869f1c0 100644 --- a/Myshipping.Application/EDI/TSLEdiHelper.cs +++ b/Myshipping.Application/EDI/TSLEdiHelper.cs @@ -930,7 +930,6 @@ namespace Myshipping.Application.EDI.TSL } - var voyno = ""; if (!string.IsNullOrEmpty(bill.NVOYNO)) voyno = bill.NVOYNO; else voyno = bill.VOYNO; @@ -945,7 +944,7 @@ namespace Myshipping.Application.EDI.TSL r.WriteLine("LOC+11+" + bill.PORTDISCHARGEID + ":139:6:" + bill.PORTDISCHARGE + "'"); icount = icount + 5; - if (bill.DESTINATION != "") + if (!string.IsNullOrWhiteSpace(bill.DESTINATION)) { r.WriteLine("LOC+7+" + bill.DESTINATIONID + ":139:6:" + bill.DESTINATION + "'"); icount = icount + 1; @@ -977,7 +976,7 @@ namespace Myshipping.Application.EDI.TSL icount = icount + 7; - if (bill.WEITUO != "") + if (!string.IsNullOrWhiteSpace(bill.WEITUO)) { if (bill.WEITUO.Length > 35) r.WriteLine("NAD+FW+++" + formatEdiStr("txt", bill.WEITUO.Substring(0, 35)) + "+" + formatEdiStr("txt", bill.WEITUO.Substring(35)) + "'"); diff --git a/Myshipping.Application/Service/BookingOrder/Dto/PageBookingOrder.cs b/Myshipping.Application/Service/BookingOrder/Dto/PageBookingOrder.cs index d5b6f35a..04b52f37 100644 --- a/Myshipping.Application/Service/BookingOrder/Dto/PageBookingOrder.cs +++ b/Myshipping.Application/Service/BookingOrder/Dto/PageBookingOrder.cs @@ -846,5 +846,9 @@ namespace Myshipping.Application.Service.BookingOrder.Dto /// 最后下货纸比对状态 NO_DIFF-无异常;DIFF-有差异;NO_YARD-无场站数据;EXPT-异常 /// public string LstShipOrderCompareRltName { get; set; } + /// + /// 最后下货纸比对方式 MANUAL-手动 AUTO-自动 + /// + public string LstShipOrderCompareMode { get; set; } } } diff --git a/Myshipping.Application/Service/BookingTruck/BookingTruckService.cs b/Myshipping.Application/Service/BookingTruck/BookingTruckService.cs index 02f4d6fb..c688c07a 100644 --- a/Myshipping.Application/Service/BookingTruck/BookingTruckService.cs +++ b/Myshipping.Application/Service/BookingTruck/BookingTruckService.cs @@ -522,6 +522,7 @@ namespace Myshipping.Application */ try { + //先保存 var id = InnerSave(info); @@ -537,6 +538,46 @@ namespace Myshipping.Application return result; } + /// + /// 校验派车 + /// + /// 操作类型 + /// 派车信息列表 + private void ValidateTruck(OperateTypeEnum operateType, BookingTruck[] entityArg) + { + if (operateType == OperateTypeEnum.Save) + { + if (entityArg.Any(a => a.Status != BookingTruckStatus.TEMP.ToString() + && a.Status != BookingTruckStatus.CANCELED.ToString())) + { + throw Oops.Oh($"派车状态只有暂存、已撤销才能保存"); + } + } + else if (operateType == OperateTypeEnum.Submit) + { + if (entityArg.Any(a => a.Status != BookingTruckStatus.TEMP.ToString() + && a.Status != BookingTruckStatus.CANCELED.ToString())) + { + throw Oops.Oh($"派车状态只有暂存、已撤销才能提交"); + } + } + else if (operateType == OperateTypeEnum.Cancel) + { + if (entityArg.Any(a => a.Status != BookingTruckStatus.SUBMITED.ToString())) + { + throw Oops.Oh($"派车状态只有已提交才能撤销派车"); + } + } + else if (operateType == OperateTypeEnum.Delete) + { + if (entityArg.Any(a => a.Status != BookingTruckStatus.TEMP.ToString() + && a.Status != BookingTruckStatus.CANCELED.ToString())) + { + throw Oops.Oh($"派车状态只有暂存、已撤销才能作废"); + } + } + } + /// /// 批量提交派车 /// From cf17323c0c1bef95cbe3005b73f67ab471346396 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 18 Apr 2023 13:36:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B4=BE=E8=BD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Enum/OperateTypeEnum.cs | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Myshipping.Application/Enum/OperateTypeEnum.cs diff --git a/Myshipping.Application/Enum/OperateTypeEnum.cs b/Myshipping.Application/Enum/OperateTypeEnum.cs new file mode 100644 index 00000000..1eb7f755 --- /dev/null +++ b/Myshipping.Application/Enum/OperateTypeEnum.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Application +{ + /// + /// 操作类型枚举 + /// + public enum OperateTypeEnum + { + /// + /// 保存 + /// + [Description("保存")] + Save, + /// + /// 提交 + /// + [Description("提交")] + Submit, + /// + /// 取消 + /// + [Description("取消")] + Cancel, + /// + /// 删除 + /// + [Description("删除")] + Delete + } +}