From d33e94eb0d39f59fa35925d2c3153a437849cfc5 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Fri, 7 Apr 2023 09:03:58 +0800 Subject: [PATCH] 11 --- Myshipping.Application/Service/DataSync/DataSyncService.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Myshipping.Application/Service/DataSync/DataSyncService.cs b/Myshipping.Application/Service/DataSync/DataSyncService.cs index 225e9892..04514ff5 100644 --- a/Myshipping.Application/Service/DataSync/DataSyncService.cs +++ b/Myshipping.Application/Service/DataSync/DataSyncService.cs @@ -2208,11 +2208,11 @@ namespace Myshipping.Application foreach (var item in dto) { - var model = _vesselinfo.Where(x => x.Vessel == item.Vessel && x.Voyno == item.Voyno && x.CARRIERID == item.CARRIERID && x.TenantId == UserManager.TENANT_ID).First(); + var model = _vesselinfo.AsQueryable().Filter(null, true).Where(x => x.Vessel == item.Vessel && x.Voyno == item.Voyno && x.CARRIERID == item.CARRIERID && x.TenantId == UserManager.TENANT_ID).First(); model.ETA = item.ETA; model.ETD = item.ETD; await _vesselinfo.AsUpdateable(model).IgnoreColumns().ExecuteCommandAsync(); - var order = await _rep.AsQueryable().Where(x => x.VESSEL == item.Vessel && x.VOYNO == item.Voyno && x.CARRIERID == item.CARRIERID && x.TenantId == UserManager.TENANT_ID).ToListAsync(); + var order = await _rep.AsQueryable().Filter(null, true).Where(x => x.VESSEL == item.Vessel && x.VOYNO == item.Voyno && x.CARRIERID == item.CARRIERID && x.TenantId == UserManager.TENANT_ID).ToListAsync(); if (order != null) { foreach (var it in order) @@ -2288,13 +2288,14 @@ namespace Myshipping.Application public async Task GetSyncVesselDate() { - var list = await _vesselinfo.AsQueryable().Where(x => x.ETD != null && x.ATD != null && x.TenantId == UserManager.TENANT_ID&&(x.Voyno!=null&&x.Voyno!="")).Select(x => new + var list = await _vesselinfo.AsQueryable().Filter(null, true).Where(x =>( x.ETD == null || x.ATD == null )&& x.TenantId == UserManager.TENANT_ID&&(x.Voyno!=null&&x.Voyno!="")).Select(x => new { Vessel = x.Vessel, Voyno = x.Voyno, CARRIER = x.CARRIER, CARRIERID = x.CARRIERID }).Distinct().ToListAsync(); + return list; }