From e0dabde622e384c2dc5849f65acab82d0b8a0adb Mon Sep 17 00:00:00 2001
From: hutongqing <hutongqing@hnkhzn.com>
Date: 星期三, 16 十月 2024 14:43:51 +0800
Subject: [PATCH] 新增堆垛机封装类

---
 WIDESEAWCS_Server/WIDESEAWCS_Core/BaseServices/ServiceBase.cs |   69 +++++++++-------------------------
 1 files changed, 19 insertions(+), 50 deletions(-)

diff --git a/WIDESEAWCS_Server/WIDESEAWCS_Core/BaseServices/ServiceBase.cs b/WIDESEAWCS_Server/WIDESEAWCS_Core/BaseServices/ServiceBase.cs
index 56f224f..6dffe4e 100644
--- a/WIDESEAWCS_Server/WIDESEAWCS_Core/BaseServices/ServiceBase.cs
+++ b/WIDESEAWCS_Server/WIDESEAWCS_Core/BaseServices/ServiceBase.cs
@@ -54,37 +54,6 @@
             Dictionary<string, OrderByType> orderbyDic = GetPageDataSort(options, TProperties);
 
             PageGridData<TEntity> pageGridData = new PageGridData<TEntity>();
-            //if (QueryRelativeExpression != null)
-            //{
-            //    queryable = QueryRelativeExpression.Invoke(queryable);
-            //}
-            //if (options.Export)
-            //{
-            //    queryable = queryable.GetIQueryableOrderBy(orderbyDic);
-            //    if (Limit > 0)
-            //    {
-            //        queryable = queryable.Take(Limit);
-            //    }
-            //    pageGridData.rows = queryable.ToList();
-            //}
-            //else
-            //{
-            //    pageGridData.rows = repository.IQueryablePage(queryable,
-            //                        options.Page,
-            //                        options.Rows,
-            //                        out int rowCount,
-            //                        orderbyDic).ToList();
-            //    pageGridData.total = rowCount;
-            //    //鏌ヨ鐣岄潰缁熻姹傜瓑瀛楁
-            //    if (SummaryExpress != null)
-            //    {
-            //        pageGridData.summary = SummaryExpress.Invoke(queryable);
-            //        //Func<T, T> groupExpress = x =>x;
-            //        //pageGridData.summary = queryable.GroupBy(groupExpress).Select(SummaryExpress).FirstOrDefault();
-            //    }
-            //}
-            //GetPageDataOnExecuted?.Invoke(pageGridData);
-
             pageGridData = BaseDal.QueryPage(wheres, options.Page, options.Rows, orderbyDic);
 
             return pageGridData;
@@ -294,7 +263,7 @@
                 }
 
                 Type detailType = typeof(TEntity).GetDetailType();
-                MethodInfo? methodInfo = GetType().GetMethod("AddDataIncludesDetail");
+                MethodInfo? methodInfo = GetType().GetMethod(nameof(AddDataIncludesDetail));
                 methodInfo = methodInfo?.MakeGenericMethod(new Type[] { detailType });
                 object? obj = methodInfo?.Invoke(this, new object[] { entity, detailType, saveModel.DetailData });
                 return obj as WebResponseContent;
@@ -404,27 +373,27 @@
 
                 TEntity entity = saveModel.MainData.DicToModel<TEntity>();
 
-                List<string> listCol = new List<string>();
-                foreach (var item in saveModel.MainData)
-                {
-                    PropertyInfo propertyInfo = typeof(TEntity).GetProperty(item.Key);
-                    if (propertyInfo == null)
-                    {
-                        propertyInfo = typeof(TEntity).GetProperty(item.Key.FirstLetterToLower());
-                        if (propertyInfo == null)
-                        {
-                            propertyInfo = typeof(TEntity).GetProperty(item.Key.FirstLetterToUpper());
-                        }
-                    }
+                //List<string> listCol = new List<string>();
+                //foreach (var item in saveModel.MainData)
+                //{
+                //    PropertyInfo propertyInfo = typeof(TEntity).GetProperty(item.Key);
+                //    if (propertyInfo == null)
+                //    {
+                //        propertyInfo = typeof(TEntity).GetProperty(item.Key.FirstLetterToLower());
+                //        if (propertyInfo == null)
+                //        {
+                //            propertyInfo = typeof(TEntity).GetProperty(item.Key.FirstLetterToUpper());
+                //        }
+                //    }
 
-                    listCol.Add(propertyInfo?.Name);
-                }
+                //    listCol.Add(propertyInfo?.Name);
+                //}
 
                 if (saveModel.DetailData == null || saveModel.DetailData.Count == 0)
                 {
-                    if (list != null)
-                        listCol = listCol.Where(x => !list.Contains(x)).ToList();
-                    bool result = BaseDal.UpdateData(entity, listCol, list);
+                    //if (list != null)
+                    //    listCol = listCol.Where(x => !list.Contains(x)).ToList();
+                    bool result = BaseDal.UpdateData(entity);
                     return WebResponseContent.Instance.OK();
                 }
 
@@ -434,7 +403,7 @@
                 }
 
                 Type detailType = typeof(TEntity).GetDetailType();
-                MethodInfo? methodInfo = GetType().GetMethod("UpdateDataInculdesDetail");
+                MethodInfo? methodInfo = GetType().GetMethod(nameof(UpdateDataInculdesDetail));
                 methodInfo = methodInfo?.MakeGenericMethod(new Type[] { detailType });
                 object? obj = methodInfo?.Invoke(this, new object[] { entity, detailType, saveModel.DetailData, saveModel.DelKeys });
                 return obj as WebResponseContent;

--
Gitblit v1.9.3