From d4cae5c48af02e109b1febce8c7c21e560cd6525 Mon Sep 17 00:00:00 2001
From: xxyy <cathay_xy@163.com>
Date: 星期二, 18 三月 2025 14:23:55 +0800
Subject: [PATCH] 更新配置和代码逻辑,优化查询及日志

---
 Code Management/WMS/WIDESEA_WMSClient/src/views/system/Sys_Role.vue                               |    2 
 Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json                          |   12 +++---
 .gitignore                                                                                        |    8 ++++
 Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs          |   20 +++------
 Code Management/WMS/WIDESEA_WMSClient/src/api/http.js                                             |    2 
 Code Management/WMS/WIDESEA_WMSClient/src/views/Login.vue                                         |    4 +-
 Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs  |    2 
 Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/UnitOfWorks/UnitOfWorkManage.cs |    6 +-
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs               |   11 ++++-
 9 files changed, 37 insertions(+), 30 deletions(-)

diff --git a/.gitignore b/.gitignore
index dbac3ce..565c9b1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1698,3 +1698,11 @@
 /3F/Code Management/WCS/WIDESEAWCS_Server/.vs/ProjectEvaluation/wideseawcs_server.projects.v7.bin
 /3F/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/DesignTimeBuild/.dtbcache.v2
 /3F/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/v17/.suo
+/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.13.439.2385/CodeChunks.db
+/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.13.439.2385/CodeChunks.db-shm
+/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.13.439.2385/CodeChunks.db-wal
+/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.13.439.2385/SemanticSymbols.db
+/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.13.439.2385/SemanticSymbols.db-shm
+/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.13.439.2385/SemanticSymbols.db-wal
+/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.13.439.2385/CodeChunks.db
+/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.13.439.2385/SemanticSymbols.db
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs
index a60279f..2d7637b 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs
@@ -1,4 +1,5 @@
-锘縰sing SqlSugar;
+锘縰sing Masuit.Tools;
+using SqlSugar;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -98,7 +99,11 @@
                 }
                 visitedRoutes.Add(routeKey);
 
-                List<Dt_Router> dt_Routers = BaseDal.QueryData(x => x.NextPosi == endPosi || x.ChildPosi == endPosi, new Dictionary<string, OrderByType> { { nameof(Dt_Router.IsEnd), OrderByType.Desc } });
+                List<Dt_Router> dt_Routers = BaseDal.QueryData(x => (x.NextPosi == endPosi || x.ChildPosi == endPosi) && x.StartPosi == startPosi, new Dictionary<string, OrderByType> { { nameof(Dt_Router.IsEnd), OrderByType.Desc } });
+                if (dt_Routers.IsNullOrEmpty())
+                {
+                    dt_Routers = BaseDal.QueryData(x => x.NextPosi == endPosi || x.ChildPosi == endPosi, new Dictionary<string, OrderByType> { { nameof(Dt_Router.IsEnd), OrderByType.Desc } });
+                }
                 if (dt_Routers.Count > 0)
                 {
                     foreach (var item in dt_Routers)
@@ -264,7 +269,7 @@
                     {
                         if (routerType == (int)RouterInOutType.Out)
                             router.ChildPosi = routersAddDTOs[i + 1].ChildPositionCode;
-                         router.IsEnd = true;
+                        router.IsEnd = true;
                     }
                     routers.Add(router);
                 }
diff --git a/Code Management/WMS/WIDESEA_WMSClient/src/api/http.js b/Code Management/WMS/WIDESEA_WMSClient/src/api/http.js
index a37567d..efcdc6d 100644
--- a/Code Management/WMS/WIDESEA_WMSClient/src/api/http.js
+++ b/Code Management/WMS/WIDESEA_WMSClient/src/api/http.js
@@ -19,7 +19,7 @@
 }
 else if (process.env.NODE_ENV == 'production') {
   // axios.defaults.baseURL = 'http://127.0.0.1:5000/';
-  axios.defaults.baseURL = 'http://192.168.20.251:5000/';
+  axios.defaults.baseURL = 'http://192.168.5.251:5000/';
 }
 
 //axios.defaults.baseURL = 'http://api.volcore.xyz/';
diff --git a/Code Management/WMS/WIDESEA_WMSClient/src/views/Login.vue b/Code Management/WMS/WIDESEA_WMSClient/src/views/Login.vue
index 5bf8a06..44a5c0f 100644
--- a/Code Management/WMS/WIDESEA_WMSClient/src/views/Login.vue
+++ b/Code Management/WMS/WIDESEA_WMSClient/src/views/Login.vue
@@ -101,8 +101,8 @@
     const loading = ref(false);
     const codeImgSrc = ref('');
     const userInfo = reactive({
-      userName: 'admin',
-      password: '123456',
+      userName: '',
+      password: '',
       verificationCode: '1234',
       UUID: undefined
     });
diff --git a/Code Management/WMS/WIDESEA_WMSClient/src/views/system/Sys_Role.vue b/Code Management/WMS/WIDESEA_WMSClient/src/views/system/Sys_Role.vue
index b5da209..963e063 100644
--- a/Code Management/WMS/WIDESEA_WMSClient/src/views/system/Sys_Role.vue
+++ b/Code Management/WMS/WIDESEA_WMSClient/src/views/system/Sys_Role.vue
@@ -22,7 +22,7 @@
     export default defineComponent({
         setup() {
             const table = ref({
-                key: 'Role_Id',
+                key: 'roleId',
                 footer: "Foots",
                 cnName: '瑙掕壊绠$悊',
                 name: 'Sys_Role',
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/UnitOfWorks/UnitOfWorkManage.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/UnitOfWorks/UnitOfWorkManage.cs
index 4b550f4..32df00e 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/UnitOfWorks/UnitOfWorkManage.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/UnitOfWorks/UnitOfWorkManage.cs
@@ -194,7 +194,7 @@
         public async Task UseTranAsync(Func<Task> action)
         {
             // 寮�濮嬩簨鍔�
-            _sqlSugarClient.Ado.BeginTran();
+            await GetDbClient().BeginTranAsync();
 
             try
             {
@@ -202,12 +202,12 @@
                 await action();
 
                 // 鎻愪氦浜嬪姟
-                await _sqlSugarClient.Ado.CommitTranAsync();
+                await GetDbClient().CommitTranAsync();
             }
             catch (Exception ex)
             {
                 // 鍥炴粴浜嬪姟
-                await _sqlSugarClient.Ado.RollbackTranAsync();
+                await GetDbClient().RollbackTranAsync();
                 throw new Exception (ex.Message); // 閲嶆柊鎶涘嚭寮傚父锛屼互渚胯皟鐢ㄦ柟鍙互澶勭悊
             }
         }
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
index eda759d..f497bd2 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -137,17 +137,11 @@
             });
             try
             {
-                //using (_simpleCacheService.AcquireLock(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, 2000))
-                //{
                 _simpleCacheService.HashDel<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, new string[] { stock.PalletCode });
-                //}
             }
             catch (Exception ex)
             {
                 LogFactory.GetLog("鍒犻櫎缂撳瓨澶辫触").Error(true, $"{stock.PalletCode}_鍒犻櫎缂撳瓨澶辫触锛屽紓甯镐俊鎭細{ex.Message}");
-                //using (_simpleCacheService.AcquireLock(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, 2000))
-                //{
-                //}
             }
 
             return content.OK("浠诲姟瀹屾垚鎴愬姛", task.Remark);
@@ -968,11 +962,10 @@
             List<DtStockInfo> stockInfoList = stockInfos.Values.ToList();
             var result = new DtStockInfo();
 
-            //if (stockInfoList.IsNullOrEmpty())
-            //{
-            //    stockInfoList = await _stockInfoRepository.Db.Queryable<DtStockInfo>()
-            //        .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock).IncludesAllFirstLayer().ToListAsync();
-            //}
+            if (areaCode == "CH001")
+            {
+                LogFactory.GetLog("CH001").Info(true, JsonConvert.SerializeObject(stockInfoList[0], Formatting.Indented));
+            }
 
             result = stockInfoList.Where(x => x.AreaCode == areaCode && x.OutboundTime < DateTime.Now && x.IsFull)
                               .WhereIF(!productionLine.IsNullOrEmpty(), x => x.ProductionLine == productionLine)
@@ -982,16 +975,17 @@
                               .OrderBy(x => x.OutboundTime)
             .FirstOrDefault();
 
+
             if (result != null)
                 _simpleCacheService.HashDel<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, new string[] { result.PalletCode });
             else
-                ConsoleHelper.WriteErrorLine("QueryStockInfoForRealTrayAsync鏌ヨ瀹炵洏搴撳瓨淇℃伅澶辫触:鏈壘鍒扮鍚堟潯浠剁殑鏁版嵁");
+                ConsoleHelper.WriteErrorLine($"{areaCode}-{productionLine}鏌ヨ瀹炵洏搴撳瓨淇℃伅澶辫触:鏈壘鍒扮鍚堟潯浠剁殑鏁版嵁");
 
             return result;
         }
         catch (Exception ex)
         {
-            ConsoleHelper.WriteErrorLine("QueryStockInfoForRealTrayAsync鏌ヨ瀹炵洏搴撳瓨淇℃伅澶辫触:" + ex.Message + "\r\n" + ex.StackTrace);
+            ConsoleHelper.WriteErrorLine("鏌ヨ瀹炵洏搴撳瓨淇℃伅澶辫触:" + ex.Message + "\r\n" + ex.StackTrace);
             return null;
         }
     }
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
index 528d7af..5182457 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
@@ -458,7 +458,7 @@
             else
             {
                 locations = await _locationRepository.QueryDataAsync(x => x.LocationStatus == (int)LocationEnum.Distribute && x.RoadwayNo == requestTask.Roadways && x.EnalbeStatus == 1 && x.LocationType == 1);
-                if (locations == null)
+                if (locations.IsNullOrEmpty())
                 {
                     locations = await _locationRepository.QueryDataAsync(x => x.LocationStatus == (int)LocationEnum.Free && x.RoadwayNo == requestTask.Roadways && x.EnalbeStatus == 1 && x.LocationType == 1);
                 }
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json
index 4475b74..03a4520 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json
@@ -27,7 +27,7 @@
 
   //缂撳瓨璁剧疆
   "CacheSettings": {
-    "UseRedis": false, //鍚敤redis
+    "UseRedis": true, //鍚敤redis
     "RedisSettings": {
       "Address": "127.0.0.1:6379", //鍦板潃
       "Password": "123456", //Redis鏈嶅姟瀵嗙爜
@@ -44,10 +44,10 @@
 
   // 鍏佽鍑哄簱鐨勭紪鐮�
   "OutBoundMateriel": [
-    //{
-    //  "MaterielCode": "CC01050001348",
-    //  "ProductionLine": "ZJ-8",
-    //  "ProcessCode": "CH001"
-    //}
+    {
+      "MaterielCode": "CC01050001523",
+      "ProductionLine": "ZJ-7",
+      "ProcessCode": "CH001"
+    }
   ]
 }

--
Gitblit v1.9.3