From 57b9aa9c26e8f4636cebcf4654c7b789ebc61ba5 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Mon, 8 May 2023 11:13:59 +0800 Subject: [PATCH] 1 --- .../Service/DataSync/DataSyncService.cs | 8 ++++++- .../Service/User/SysDataUserMenu.cs | 24 +++++++++---------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Myshipping.Application/Service/DataSync/DataSyncService.cs b/Myshipping.Application/Service/DataSync/DataSyncService.cs index d4281e17..c8004cba 100644 --- a/Myshipping.Application/Service/DataSync/DataSyncService.cs +++ b/Myshipping.Application/Service/DataSync/DataSyncService.cs @@ -1763,7 +1763,13 @@ namespace Myshipping.Application await _rep.AsUpdateable(it).IgnoreColumns().ExecuteCommandAsync(); } - await _bookingorderservice.SendBookingOrder(order.Select(x => x.Id).ToArray()); + 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") + await _bookingorderservice.SendBookingOrder(order.Select(x => x.Id).ToArray()); + } + } diff --git a/Myshipping.Core/Service/User/SysDataUserMenu.cs b/Myshipping.Core/Service/User/SysDataUserMenu.cs index 284fcc72..ffd18110 100644 --- a/Myshipping.Core/Service/User/SysDataUserMenu.cs +++ b/Myshipping.Core/Service/User/SysDataUserMenu.cs @@ -162,18 +162,18 @@ public class SysDataUserMenuService : ISysDataUserMenu, IDynamicApiController, I List list = new List(); List datascope = new List(); - //if (_sysCache.Exists(CommonConst.CACHE_KEY_USERDATASCOPE)) - //{ - // list = await _sysCache.GetAsync>(CommonConst.CACHE_KEY_USERDATASCOPE); - - //} - //else - //{ - // list = await _rep.AsQueryable().ToListAsync(); - // _sysCache.Set(CommonConst.CACHE_KEY_USERDATASCOPE, list); - //} - list = await _rep.AsQueryable().ToListAsync(); - _sysCache.Set(CommonConst.CACHE_KEY_USERDATASCOPE, list); + if (_sysCache.Exists(CommonConst.CACHE_KEY_USERDATASCOPE)) + { + list = await _sysCache.GetAsync>(CommonConst.CACHE_KEY_USERDATASCOPE); + + } + else + { + list = await _rep.AsQueryable().ToListAsync(); + _sysCache.Set(CommonConst.CACHE_KEY_USERDATASCOPE, list); + } + //list = await _rep.AsQueryable().ToListAsync(); + //_sysCache.Set(CommonConst.CACHE_KEY_USERDATASCOPE, list); DataScopeType _dataScopeType = list.Where(x => x.SysMenuId == menuid && x.SysUserId == UserManager.UserId).Select(x => x.DataScopeType).FirstOrDefault(); if (_dataScopeType == DataScopeType.ALL) {