From 1181f9f764b14abd6e9f598f89f8507b4bbfad0d Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期一, 09 三月 2026 09:47:10 +0800
Subject: [PATCH] 设置登录默认值;添加数据传输对象;更新服务器作业

---
 Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/RepositoryBase.cs |   42 +++++++++++++++++++-----------------------
 1 files changed, 19 insertions(+), 23 deletions(-)

diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/RepositoryBase.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/RepositoryBase.cs
index 2e82046..5c742b4 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/RepositoryBase.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/RepositoryBase.cs
@@ -1,26 +1,11 @@
-锘縰sing SqlSugar;
+锘縰sing Microsoft.Data.SqlClient;
+using SqlSugar;
 using System.Data;
 using System.Linq.Expressions;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 using System.Reflection;
-using WIDESEA_Core.Helper;
-using Microsoft.Data.SqlClient;
-using System.Drawing.Printing;
-using WIDESEA_Core.Tenants;
-using WIDESEA_Core.Seed;
-using WIDESEA_Core.DB;
-using WIDESEA_Core.Const;
-using WIDESEA_Core.AOP;
-using OfficeOpenXml.FormulaParsing.ExpressionGraph;
+using WIDESEA_Core.DB.Models;
 using WIDESEA_Core.Enums;
 using WIDESEA_Core.Utilities;
-using Microsoft.AspNetCore.Mvc.RazorPages;
-using NetTaste;
-using WIDESEA_Core.DB.Models;
 
 namespace WIDESEA_Core.BaseRepository
 {
@@ -39,7 +24,7 @@
                 //var mta = typeof(TEntity).GetCustomAttribute<MultiTenantAttribute>();
                 //if (mta is { TenantType: TenantTypeEnum.Db })
                 //{
-                //    //鑾峰彇绉熸埛淇℃伅 绉熸埛淇℃伅鍙互鎻愬墠缂撳瓨涓嬫潵 
+                //    //鑾峰彇绉熸埛淇℃伅 绉熸埛淇℃伅鍙互鎻愬墠缂撳瓨涓嬫潵
                 //    if (App.User is { TenantId: > 0 })
                 //    {
                 //        dynamic tenant = db.Queryable(MainDb.TenantTableName, "x").Where(MainDb.TenantId, "=", App.User.TenantId).First();
@@ -72,6 +57,7 @@
                 return db;
             }
         }
+
         /// <summary>
         /// 鍒涘缓鏁版嵁搴撹繛鎺ュ璞�
         /// </summary>
@@ -963,21 +949,31 @@
                     }
                     if (list.Count > 0)
                         _db.InsertableByObject(list).AS(type.Name + "_Hty").ExecuteCommand();
-
                 }
             }
             return DeleteData(entities);
         }
 
-        public Task<int> GetTaskNo()
+        public async Task<int> GetTaskNo()
         {
             string sql = "select next value for dbo.GetTaskNum";
-            return Db.Ado.SqlQuerySingleAsync<int>(sql);
+            return await Db.Ado.SqlQuerySingleAsync<int>(sql);
         }
+
+        public virtual async Task<List<TEntity>> QueryDataNavAsync(Expression<Func<TEntity, bool>> whereExpression)
+        {
+            return await _db.Queryable<TEntity>().IncludesAllFirstLayer().ToListAsync();
+        }
+
+        public virtual async Task<TEntity> QueryDataNavFirstAsync(Expression<Func<TEntity, bool>> whereExpression)
+        {
+            return await _db.Queryable<TEntity>().IncludesAllFirstLayer().FirstAsync();
+        }
+
         //List<TResult> QueryMuch<T, T2, T3, TResult>(
         //    Expression<Func<T, T2, T3, object[]>> joinExpression,
         //    Expression<Func<T, T2, T3, TResult>> selectExpression,
         //    Expression<Func<T, T2, T3, bool>> whereLambda = null) where T : class, new(){throw new NotImplementedException();}
         //Task<PageModel<TEntity>> QueryPage(PaginationModel pagination){throw new NotImplementedException();}
     }
-}
+}
\ No newline at end of file

--
Gitblit v1.9.3