From 5a5ae77e4f90f8a74859b97cc5457b4be15e624a Mon Sep 17 00:00:00 2001 From: zhangxiaofeng <1939543722@qq.com> Date: Fri, 19 Jul 2024 14:15:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E8=88=B9=E6=9C=9F=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E8=AE=A2=E8=88=B1=EF=BC=9A=E9=99=A4=E5=92=8C=E5=B7=9D?= =?UTF-8?q?=E5=A4=96=E6=B7=BB=E5=8A=A0=E5=90=AF=E8=BF=90=E6=B8=AF=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingVesselInfoService.cs | 23 ++++++---- .../Service/DataSync/DataSyncService.cs | 44 +++++++++++++++---- 2 files changed, 49 insertions(+), 18 deletions(-) diff --git a/Myshipping.Application/Service/BookingVesselInfo/BookingVesselInfoService.cs b/Myshipping.Application/Service/BookingVesselInfo/BookingVesselInfoService.cs index 17e9797c..72aae781 100644 --- a/Myshipping.Application/Service/BookingVesselInfo/BookingVesselInfoService.cs +++ b/Myshipping.Application/Service/BookingVesselInfo/BookingVesselInfoService.cs @@ -14,6 +14,7 @@ using Myshipping.Core.Service; using Myshipping.Core.Entity; using Microsoft.Extensions.Logging; using Microsoft.AspNetCore.SignalR; +using Furion; namespace Myshipping.Application { @@ -158,15 +159,19 @@ namespace Myshipping.Application && !string.IsNullOrEmpty(old.Voyno) && !string.IsNullOrEmpty(old.CARRIERID)) { - var order = await _order.AsQueryable() - .Filter(null, true) - .Where(x => x.TenantId == UserManager.TENANT_ID - && x.IsDeleted == false - && x.VESSEL == old.Vessel - && x.VOYNO == old.Voyno - && x.CARRIERID == old.CARRIERID) - .WhereIF(!string.IsNullOrEmpty(old.PortLoadingId), x => x.PORTLOADID == old.PortLoadingId) - .ToListAsync(); + var query = _order.AsQueryable() + .Filter(null, true) + .Where(x => x.TenantId == UserManager.TENANT_ID + && x.IsDeleted == false + && x.VESSEL == old.Vessel + && x.VOYNO == old.Voyno + && x.CARRIERID == old.CARRIERID); + if (App.Configuration["RunType"] != CommonConst.RUN_TYPE_HECHUAN) + { + query.WhereIF(!string.IsNullOrEmpty(old.PortLoadingId), x => x.PORTLOADID == old.PortLoadingId); + } + var order = await query.ToListAsync(); + bool issend = false; if (order != null) { diff --git a/Myshipping.Application/Service/DataSync/DataSyncService.cs b/Myshipping.Application/Service/DataSync/DataSyncService.cs index fb0a786a..2c31e362 100644 --- a/Myshipping.Application/Service/DataSync/DataSyncService.cs +++ b/Myshipping.Application/Service/DataSync/DataSyncService.cs @@ -1845,18 +1845,40 @@ namespace Myshipping.Application UpdatedTime = DateTime.Now }); - var orderList = await _rep.AsQueryable().Filter(null, true).Where(x => x.TenantId == UserManager.TENANT_ID - && x.IsDeleted == false - && x.VESSEL == item.Vessel - && x.VOYNO == item.Voyno).ToListAsync(); - + #region 扣费相关 //当前租户配置为实际开船后扣费 var paraVal = _tenantParamValue.AsQueryable().Filter(null, true).First(x => x.TenantId == UserManager.TENANT_ID && x.ParaCode == "BOOKING_FEE_METHOD"); //有实际开船,扣费 if (paraVal != null && paraVal.ItemCode == "ATD" && item.ATD.HasValue) { - feeIdList.AddRange(orderList.Where(x => !feeIdList.Contains(x.Id)).Select(x => x.Id)); + var orderIdList = await _rep.AsQueryable().Filter(null, true).Where(x => x.TenantId == UserManager.TENANT_ID + && x.IsDeleted == false + && x.VESSEL == item.Vessel + && x.VOYNO == item.Voyno).Select(x => x.Id).ToListAsync(); + + feeIdList.AddRange(orderIdList.Where(x => !feeIdList.Contains(x))); + } + #endregion + + // 118订舱系统2024.7.19修改:同一船名航次,启运港不同,船期也会不同;更新订舱时需要判断启运港 + // 钉钉审批单号:202407121821000478565 + var query = _rep.AsQueryable().Filter(null, true).Where(x => x.TenantId == UserManager.TENANT_ID + && x.IsDeleted == false + && x.VESSEL == item.Vessel + && x.VOYNO == item.Voyno); + + if (App.Configuration["RunType"] != CommonConst.RUN_TYPE_HECHUAN) + { + query.Where(x => string.IsNullOrEmpty(x.PORTLOADID)); } + List orderList = await query.Select(x => new BookingOrder + { + Id = x.Id, + StartETA = x.StartETA, + YgtETD = x.YgtETD, + ATD = x.ATD, + StartATA = x.StartATA, + }).ToListAsync(); bool issend = false; //批量变更业务数据 @@ -1896,10 +1918,14 @@ namespace Myshipping.Application { issend = true; await update.Value.Where(b => b.Id == order.Id).ExecuteCommandAsync(); - await _bookingorderservice.SaveLog(newOrder.Value, order, "回推船期"); + await _bookingorderservice.SaveLog(newOrder.Value, order, "回推船期", new List() + { + nameof(BookingOrder.StartATA), + nameof(BookingOrder.StartETA), + nameof(BookingOrder.YgtETD), + nameof(BookingOrder.ATD), + }); } - - } if (issend) {