From f1ac3ee6fba5197170f3408b796497625d20621c Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Mon, 3 Jul 2023 13:44:24 +0800 Subject: [PATCH] 1 --- .../BookingOrder/BookingOrderService.cs | 37 ++++++++++++++++++- .../Service/DataSync/Dto/BookingOrderDto.cs | 10 +++++ 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index ff8173d2..28a70cdc 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -962,8 +962,10 @@ namespace Myshipping.Application { throw Oops.Bah(ms); } + JsonUtil.PropToUpper(input, "ORDNO", "BSSTATUS", "YARDID", "YardContract", "YardContractTel", "YardContractEmail", "MARKS", "DESCRIPTION", "CONSIGNEENAME", "SHIPPERNAME", "NOTIFYPARTYNAME", "DZRemark", "CZRemark"); + if (input.ctnInputs != null) { var groupList = input.ctnInputs.Where(x => x.CTNNUM > 0).GroupBy(c => c.CTNALL).Select(g => $"{g.Key}*{g.Sum(gg => gg.CTNNUM)}"); @@ -1082,7 +1084,18 @@ namespace Myshipping.Application } else { + var mlist = await _rep.AsQueryable().Filter(null, true).Where(x => x.Id == input.Id).FirstAsync(); + if (!(mlist.OPID==UserManager.UserId.ToString()|| mlist.DOCID==UserManager.UserId.ToString()||mlist.CUSTSERVICEID==UserManager.UserId.ToString()||mlist.ROUTEID==UserManager.UserId.ToString()||mlist.CreatedUserId.ToString()==UserManager.UserId.ToString())) { + + throw Oops.Bah("您没有当前单据的操作权限!"); + + } + + + + + if (string.IsNullOrEmpty(entity.VOYNO)) { entity.VOYNO = entity.VOYNOINNER; @@ -2376,6 +2389,10 @@ namespace Myshipping.Application { throw Oops.Bah("订阅目的港船公司或提单号不能为空!"); } + if (!item.isBook && (string.IsNullOrWhiteSpace(item.YARD) || string.IsNullOrWhiteSpace(item.YardCode) || string.IsNullOrWhiteSpace(item.MBLNO))) + { + throw Oops.Bah("订阅港前数据提单号或场站不能为空!"); + } billTraceList.Add(new BillTraceList { BusinessId = item.BusinessId, @@ -8628,9 +8645,9 @@ namespace Myshipping.Application order.ATD = sjlg_time; await _rep.AsUpdateable(order).IgnoreColumns().ExecuteCommandAsync(); - var list = await _rep.AsQueryable().Filter(null, true).Where(x => x.IsDeleted == false && x.TenantId == UserManager.TENANT_ID && x.CARRIERID == order.CARRIERID && x.VESSEL == order.VESSEL && x.VOYNO == order.VOYNO && x.Id != order.Id&&x.ATD!=null) + var orderlist = await _rep.AsQueryable().Filter(null, true).Where(x => x.IsDeleted == false && x.TenantId == UserManager.TENANT_ID && x.CARRIERID == order.CARRIERID && x.VESSEL == order.VESSEL && x.VOYNO == order.VOYNO && x.Id != order.Id) .WhereIF(!string.IsNullOrEmpty(order.VOYNOINNER), x => x.VOYNOINNER == order.VOYNOINNER).ToListAsync(); - foreach (var i in list) + foreach (var i in orderlist) { i.StartETA = yjdk_time; i.YgtETD = yjlk_time; @@ -8638,6 +8655,22 @@ namespace Myshipping.Application i.ATD = sjlg_time; await _rep.AsUpdateable(i).IgnoreColumns().ExecuteCommandAsync(); } + + var itemcode = _cache.GetAllTenantParam().Result.Where(x => x.ParaCode == "BOOKING_DATA_PUSH" && x.TenantId == UserManager.TENANT_ID).Select(x => x.ItemCode).FirstOrDefault(); + if (!string.IsNullOrEmpty(itemcode)) + { + if (itemcode == "true") + { + List list = new List(); + list = orderlist.Where(x => x.ParentId == 0).Select(x => x.Id).ToList(); + list.Add(order.Id); + if (list != null && list.Count > 0) + { + await SendBookingOrder(list.ToArray()); + } + + } + } return order; } diff --git a/Myshipping.Application/Service/DataSync/Dto/BookingOrderDto.cs b/Myshipping.Application/Service/DataSync/Dto/BookingOrderDto.cs index 8c6113a4..09f97ae3 100644 --- a/Myshipping.Application/Service/DataSync/Dto/BookingOrderDto.cs +++ b/Myshipping.Application/Service/DataSync/Dto/BookingOrderDto.cs @@ -781,7 +781,17 @@ namespace Myshipping.Application.Service.DataSync.Dto /// public string ForeignAgent { get; set; } + + + /// + /// 三方付费 + /// + public string ThirdPay { get; set; } + /// + /// 三方付费Code + /// + public string ThirdPayCode { get; set; } public List ctnInputs { get; set; } ///