From 7e1117448739eb1906c6f07eb4d59ad20cdff4e9 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <1247017146@qq.com>
Date: 星期三, 16 四月 2025 16:22:14 +0800
Subject: [PATCH] 去除Redis
---
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/StockInfoService.cs | 9 +
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs | 102 +++++++------------
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs | 22 ++++
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 2
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MCS/Partial/NotifyFinishTest.cs | 2
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemServices/ISys_UserService.cs | 2
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs | 1
Code Management/WCS/WIDESEAWCS_Client/src/extension/system/Sys_User/Sys_UserGridHeader.vue | 2
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Communicator/Siemens/SiemensS7Communicator.cs | 6
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs | 3
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_UserController.cs | 8 +
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs | 103 +++++++++++++-------
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs | 8 -
Code Management/WCS/WIDESEAWCS_Client/src/api/http.js | 2
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/AspNetCoreSchedule.cs | 22 +++-
15 files changed, 172 insertions(+), 122 deletions(-)
diff --git a/Code Management/WCS/WIDESEAWCS_Client/src/api/http.js b/Code Management/WCS/WIDESEAWCS_Client/src/api/http.js
index 084d5c7..a92c0c7 100644
--- a/Code Management/WCS/WIDESEAWCS_Client/src/api/http.js
+++ b/Code Management/WCS/WIDESEAWCS_Client/src/api/http.js
@@ -20,7 +20,7 @@
}
else if (process.env.NODE_ENV == 'production') {
- axios.defaults.baseURL = 'http://192.168.15.253:9291/';
+ axios.defaults.baseURL = 'http://192.168.20.253:9291/';
}
if (!axios.defaults.baseURL.endsWith('/')) {
axios.defaults.baseURL+="/";
diff --git a/Code Management/WCS/WIDESEAWCS_Client/src/extension/system/Sys_User/Sys_UserGridHeader.vue b/Code Management/WCS/WIDESEAWCS_Client/src/extension/system/Sys_User/Sys_UserGridHeader.vue
index f6f59be..6b72347 100644
--- a/Code Management/WCS/WIDESEAWCS_Client/src/extension/system/Sys_User/Sys_UserGridHeader.vue
+++ b/Code Management/WCS/WIDESEAWCS_Client/src/extension/system/Sys_User/Sys_UserGridHeader.vue
@@ -62,7 +62,7 @@
"/api/user/modifyUserPwd?password=" +
this.password +
"&userName=" +
- this.row.UserName;
+ this.row.userName;
this.http.post(url, {}, true).then((x) => {
if (!x.status) {
return this.$message.error(x.message);
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Communicator/Siemens/SiemensS7Communicator.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Communicator/Siemens/SiemensS7Communicator.cs
index 6b3e1fa..7f60bfc 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Communicator/Siemens/SiemensS7Communicator.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Communicator/Siemens/SiemensS7Communicator.cs
@@ -159,7 +159,7 @@
{
//return true;
object? obj = null;
- for (int i = 0; i < 3; i++)
+ for (int i = 0; i < 5; i++)
{
T readValue = Read<T>(address);
stringBuilder.AppendLine(string.Format(CommunicationInfoMessage.WriteAfterRead, readValue, value));
@@ -169,7 +169,7 @@
stringBuilder.AppendLine(string.Format(CommunicationInfoMessage.WriteAndReadCheckSuccess, address, value, readValue));
return true;
}
- else if (i < 2)
+ else if (i < 4)
{
Write(address, value);
}
@@ -608,7 +608,7 @@
if (operateResult.IsSuccess)
{
object? obj = null;
- for (int i = 0; i < 2; i++)
+ for (int i = 0; i < 5; i++)
{
T readValue = ReadCustomer<T>(address);
stringBuilder.AppendLine(string.Format(CommunicationInfoMessage.WriteAfterRead, address, JsonConvert.SerializeObject(readValue)));
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemServices/ISys_UserService.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemServices/ISys_UserService.cs
index c3e720b..63c9031 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemServices/ISys_UserService.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemServices/ISys_UserService.cs
@@ -18,5 +18,7 @@
WebResponseContent GetCurrentUserInfo();
WebResponseContent ModifyPwd(string oldPwd, string newPwd);
+
+ WebResponseContent ModifyUserPwd(string password, string userName);
}
}
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_UserController.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_UserController.cs
index 4d1ac2b..f866bf1 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_UserController.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_UserController.cs
@@ -44,7 +44,13 @@
{
return Json(Service.ModifyPwd(oldPwd, newPwd));
}
-
+ //鍙兘瓒呯骇绠$悊鍛樻墠鑳戒慨鏀瑰瘑鐮�
+ //2020.08.01澧炲姞淇敼瀵嗙爜鍔熻兘
+ [HttpPost, Route("modifyUserPwd")]
+ public IActionResult ModifyUserPwd(string password, string userName)
+ {
+ return Json(Service.ModifyUserPwd(password, userName));
+ }
[HttpGet, Route("getVierificationCode"), AllowAnonymous]
public IActionResult GetVierificationCode()
{
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs
index 2c740c4..1928834 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_UserService.cs
@@ -183,5 +183,27 @@
}
return content;
}
+
+ public WebResponseContent ModifyUserPwd(string password, string userName)
+ {
+ WebResponseContent webResponse = new WebResponseContent();
+ if (string.IsNullOrEmpty(password) || string.IsNullOrEmpty(userName))
+ {
+ return webResponse.Error("鍙傛暟涓嶅畬鏁�");
+ }
+ if (password.Length < 6) return webResponse.Error("瀵嗙爜闀垮害涓嶈兘灏戜簬6浣�");
+
+
+ Sys_User user = BaseDal.QueryFirst(x => x.UserName == userName);
+ if (user == null)
+ {
+ return webResponse.Error("鐢ㄦ埛涓嶅瓨鍦�");
+ }
+ user.UserPwd = password.EncryptDES(AppSecret.User);
+ BaseDal.UpdateData(user);
+ //濡傛灉鐢ㄦ埛鍦ㄧ嚎锛屽己鍒朵笅绾�
+ //UserContext.Current.LogOut(user.User_Id);
+ return webResponse.OK("瀵嗙爜淇敼鎴愬姛");
+ }
}
}
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
index 6bd7ee0..5cafee4 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -646,7 +646,7 @@
task.ModifyDate = DateTime.Now;
task.Modifier = "System";
- BaseDal.UpdateData(task);
+
_taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"绯荤粺鑷姩娴佺▼锛屾洿鏂板綋鍓嶄綅缃�恵oldCurrentPos} ----> {task.CurrentAddress}銆戝拰涓嬩竴浣嶇疆銆恵oldNextPos} ----> {task.NextAddress}銆�");
return task;
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
index ba4df09..9719f2b 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -403,6 +403,7 @@
WriteInfo(conveyorLine.DeviceName, logs);
conveyorLine.SendCommand(taskCommand, childDeviceCode);
+ _taskService.UpdateData(newTask);
}
}
}
@@ -584,6 +585,8 @@
// 鏍囪杈撻�佺嚎鍙戦�佷换鍔″畬鎴�
ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
+
+ _taskService.UpdateData(newTask);
}
}
}
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
index 7c9d3af..6dc3b07 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
@@ -244,13 +244,10 @@
Dt_Task? newTask = _taskService.UpdatePosition(task.TaskNum, task.CurrentAddress);
if (newTask != null)
{
- //conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, newTask.TaskNum, childDeviceCode);
- //conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, newTask.NextAddress, childDeviceCode);
- //conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, command.ConveyorLineBarcode, childDeviceCode);
ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask);
- //taskCommand.InteractiveSignal = command.InteractiveSignal;
conveyorLine.SendCommand(taskCommand, childDeviceCode);
conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
+ _taskService.UpdateData(newTask);
}
}
}
@@ -267,8 +264,6 @@
var task = _taskService.QueryExecutingTaskByBarcode(command.ConveyorLineBarcode, childDeviceCode);
if (task != null && task.TaskState != (int)TaskInStatusEnum.Line_InFinish)
{
- //ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
-
WebResponseContent content = _taskService.UpdateTaskStatusToNext(task);
if (content.Status)
@@ -350,6 +345,7 @@
ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask);
conveyorLine.SendCommand(taskCommand, childDeviceCode);
conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
+ _taskService.UpdateData(newTask);
}
}
else
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
index 25b0ab3..5deef7f 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
@@ -196,6 +196,7 @@
{
task = _taskRepository.QueryFirst(x => x.TaskNum == e.TaskNum);
Dt_Task? newTask = _taskService.UpdatePosition(task.TaskNum, task.CurrentAddress);
+ _taskService.UpdateData(newTask);
}
if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup && (task.TargetAddress == "002-021-001" || task.TargetAddress == "001-021-001"))
{
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MCS/Partial/NotifyFinishTest.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MCS/Partial/NotifyFinishTest.cs
index a38f83b..bfd2724 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MCS/Partial/NotifyFinishTest.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MCS/Partial/NotifyFinishTest.cs
@@ -108,7 +108,7 @@
location.LocationStatus = (int) LocationEnum.InStockDisable;
_locationRepository.UpdateData(location);
- _simpleCacheService.HashDel<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, new string[] { taskDTO.PalletCode });
+ //_simpleCacheService.HashDel<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, new string[] { taskDTO.PalletCode });
}
else
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/StockInfoService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/StockInfoService.cs
index 3f05072..d6eceeb 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/StockInfoService.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/StockInfoService.cs
@@ -115,7 +115,14 @@
_locationStatusChangeRecordRepository.AddLocationStatusChangeRecord(location, lastStatus, (int)StatusChangeTypeEnum.ManualOperation, 0);
}
- _simpleCacheService.HashDel<DtStockInfo>(CacheConst.Cache_DtStockInfo, stocks.ToArray());
+ //_simpleCacheService.HashDel<DtStockInfo>(CacheConst.Cache_DtStockInfo, stocks.ToArray());
+ //var hty = BaseDal.Db.InsertNav(stockInfos)
+ // .Include(x => x.StockInfoDetails)
+ // .ExecuteCommand();
+
+ //var locationd = SqlSugarHelper.DbWMS.Updateable(locationInfos).ExecuteCommandHasChange();
+ //return base.DeleteData(keys);
+
var hty = BaseDal.Db.InsertNav(stockInfos)
.Include(x => x.StockInfoDetails)
.ExecuteCommand();
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/AspNetCoreSchedule.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/AspNetCoreSchedule.cs
index a707ae0..3e818e6 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/AspNetCoreSchedule.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/AspNetCoreSchedule.cs
@@ -48,13 +48,21 @@
if (area == null) { return; }
- IDictionary<string, DtStockInfo>? stockInfos = _simpleCacheService.HashGetAll<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo);
- List<DtStockInfo> stockInfoList = stockInfos.Values.ToList();
+ //IDictionary<string, DtStockInfo>? stockInfos = _simpleCacheService.HashGetAll<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo);
+ //List<DtStockInfo> stockInfoList = stockInfos.Values.ToList();
- var stockInfo = stockInfoList.Where(x => x.AreaCode == area.AreaCode && x.OutboundTime < DateTime.Now && x.IsFull == true) // 杩囨护鏉′欢
- .Where(x => x.LocationInfo != null && x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID) // 杩囨护鏉′欢
- .OrderBy(x => x.OutboundTime) // 鎺掑簭
- .ToList(); // 鑾峰彇绗竴涓厓绱�
+ //var stockInfo = stockInfoList.Where(x => x.AreaCode == area.AreaCode && x.OutboundTime < DateTime.Now && x.IsFull == true) // 杩囨护鏉′欢
+ // .Where(x => x.LocationInfo != null && x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID) // 杩囨护鏉′欢
+ // .OrderBy(x => x.OutboundTime) // 鎺掑簭
+ // .ToList(); // 鑾峰彇绗竴涓厓绱�
+ var stockInfo = _stockInfoRepository.Db.Queryable<DtStockInfo>()
+ .Where(x => x.AreaCode == area.AreaCode && x.OutboundTime < DateTime.Now && x.IsFull == true)
+ .Includes(x => x.LocationInfo)
+ .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID) // 杩囨护鏉′欢
+ .Includes(x => x.StockInfoDetails)
+ .OrderBy(x => x.OutboundTime) // 鎺掑簭
+ .ToList(); // 鑾峰彇绗竴涓厓绱�
+
if (stockInfo.Count <= 0) return;
foreach (var item in stockInfo)
@@ -93,7 +101,7 @@
_taskRepository.AddData(task);
// 鏇存柊搴撳瓨浣嶇疆鐘舵�佷负涓嶅彲鐢�
item.LocationInfo.LocationStatus = (int)LocationEnum.InStockDisable;
- _simpleCacheService.HashDel<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, new string[] { taskDTO.PalletCode });
+ //_simpleCacheService.HashDel<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, new string[] { taskDTO.PalletCode });
_locationRepository.UpdateData(item.LocationInfo);
}
}
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 3b62b3b..bc5d0c0 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
@@ -135,14 +135,14 @@
await DeleteTaskAsync(task.TaskId);
await AddTaskHtyAsync(taskHty);
});
- try
- {
- _simpleCacheService.HashDel<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, new string[] { stock.PalletCode });
- }
- catch (Exception ex)
- {
- LogFactory.GetLog("鍒犻櫎缂撳瓨澶辫触").Error(true, $"{stock.PalletCode}_鍒犻櫎缂撳瓨澶辫触锛屽紓甯镐俊鎭細{ex.Message}");
- }
+ //try
+ //{
+ // _simpleCacheService.HashDel<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, new string[] { stock.PalletCode });
+ //}
+ //catch (Exception ex)
+ //{
+ // LogFactory.GetLog("鍒犻櫎缂撳瓨澶辫触").Error(true, $"{stock.PalletCode}_鍒犻櫎缂撳瓨澶辫触锛屽紓甯镐俊鎭細{ex.Message}");
+ //}
return content.OK("浠诲姟瀹屾垚鎴愬姛", task.Remark);
}
@@ -380,16 +380,6 @@
stock.StockInfoDetails = new List<DtStockInfoDetail>() { { stock.StockInfoDetails[0] } };
stock.LocationInfo = locationInf;
- //using(_simpleCacheService.AcquireLock(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, 2000))
- //{
- try
- {
- _simpleCacheService.HashAdd(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, stock.PalletCode, stock);
- }
- catch (Exception ex)
- {
- LogFactory.GetLog("娣诲姞缂撳瓨澶辫触").Error(true, $"{stock.PalletCode}_娣诲姞缂撳瓨澶辫触锛屽紓甯镐俊鎭細{ex.Message}");
- }
content.OK("鍏ュ簱浠诲姟瀹屾垚鎴愬姛");
}
@@ -990,28 +980,21 @@
.ToList()
: null;
- IDictionary<string, DtStockInfo>? stockInfos = _simpleCacheService.HashGetAll<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo);
- List<DtStockInfo> stockInfoList = stockInfos.Values.ToList();
var result = new DtStockInfo();
- if (areaCode == "CH001")
- {
- LogFactory.GetLog("CH001").Info(true, JsonConvert.SerializeObject(stockInfoList[0], Formatting.Indented));
- }
+ result = await _stockInfoRepository.Db.Queryable<DtStockInfo>()
+ .Includes(x => x.LocationInfo)
+ .Includes(x => x.StockInfoDetails)
+ .Where(x => x.AreaCode == areaCode && x.OutboundTime < DateTime.Now && x.IsFull)
+ .WhereIF(!productionLine.IsNullOrEmpty(), x => x.ProductionLine == productionLine)
+ .WhereIF(!devices.IsNullOrEmpty(), x => devices.Contains(x.LocationInfo.RoadwayNo))
+ .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID && x.LocationInfo.EnalbeStatus == (int)EnableEnum.Enable)
+ .WhereIF(!materielCodes.IsNullOrEmpty(), x => x.StockInfoDetails.Any(y => materielCodes.Contains(y.MaterielCode)))
+ .OrderBy(x => x.OutboundTime)
+ .FirstAsync();
- result = stockInfoList.Where(x => x.AreaCode == areaCode && x.OutboundTime < DateTime.Now && x.IsFull)
- .WhereIF(!productionLine.IsNullOrEmpty(), x => x.ProductionLine == productionLine)
- .Where(x => x.LocationInfo != null && x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID && x.LocationInfo.EnalbeStatus == (int)EnableEnum.Enable)
- .WhereIF(!devices.IsNullOrEmpty(), x => devices.Contains(x.LocationInfo.RoadwayNo))
- .WhereIF(!materielCodes.IsNullOrEmpty(), x => x.StockInfoDetails != null && x.StockInfoDetails.Any(y => materielCodes.Contains(y.MaterielCode)))
- .OrderBy(x => x.OutboundTime)
- .FirstOrDefault();
-
-
- if (result != null)
- _simpleCacheService.HashDel<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, new string[] { result.PalletCode });
- else
- ConsoleHelper.WriteErrorLine($"{areaCode}-{productionLine}鏌ヨ瀹炵洏搴撳瓨淇℃伅澶辫触:鏈壘鍒扮鍚堟潯浠剁殑鏁版嵁");
+ if (result.IsNullOrEmpty())
+ ConsoleHelper.WriteErrorLine($"{area.AreaName}-{productionLine}鏌ヨ瀹炵洏搴撳瓨淇℃伅澶辫触:鏈壘鍒扮鍚堟潯浠剁殑鏁版嵁");
return result;
}
@@ -1054,27 +1037,20 @@
.Where(x => x.DeviceStatus == "1")
.Where(x => x.DeviceCode.Contains("CWSC"))
.ToList().Select(x => x.DeviceCode).ToList();
- //var deviceCode = devices.Select(x => x.DeviceCode).ToList();
- IDictionary<string, DtStockInfo>? stockInfos = _simpleCacheService.HashGetAll<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo);
- List<DtStockInfo> stockInfoList = stockInfos.Values.ToList();
-
- var result = stockInfoList.Where(x => areaCodes.Contains(x.AreaCode) && x.OutboundTime < DateTime.Now && x.IsFull == true) // 杩囨护鏉′欢
+ var result = await _stockInfoRepository.Db.Queryable<DtStockInfo>()
+ .Where(x => areaCodes.Contains(x.AreaCode) && x.OutboundTime < DateTime.Now && x.IsFull == true) // 杩囨护鏉′欢
.WhereIF(!productionLine.IsNullOrEmpty(), x => x.ProductionLine == productionLine)
- .Where(x => x.LocationInfo != null && x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && areaId.Contains(x.LocationInfo.AreaId) && x.LocationInfo.EnalbeStatus == (int)EnableEnum.Enable) // 杩囨护鏉′欢
+ .Includes(x => x.LocationInfo)
.WhereIF(!deviceCode.IsNullOrEmpty(), x => deviceCode.Contains(x.LocationInfo.RoadwayNo))
- .WhereIF(!materielCodes.IsNullOrEmpty(), x => x.StockInfoDetails != null && x.StockInfoDetails.Any(y => materielCodes.Contains(y.MaterielCode)))
+ .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && areaId.Contains(x.LocationInfo.AreaId) && x.LocationInfo.EnalbeStatus == (int)EnableEnum.Enable) // 杩囨护鏉′欢
+ .Includes(x => x.StockInfoDetails)
+ .WhereIF(!materielCodes.IsNullOrEmpty(), x => x.StockInfoDetails.Any(y => materielCodes.Contains(y.MaterielCode)))
.OrderBy(x => x.OutboundTime) // 鎺掑簭
- .FirstOrDefault(); // 鑾峰彇绗竴涓厓绱�
+ .FirstAsync(); // 鑾峰彇绗竴涓厓绱�
- if (result != null)
- {
- _simpleCacheService.HashDel<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, new string[] { result.PalletCode });
- }
- else
- {
- ConsoleHelper.WriteErrorLine("QueryStockInfoForRealTrayCWAsync鏌ヨ甯告俯瀹炵洏搴撳瓨淇℃伅澶辫触:鏈壘鍒扮鍚堟潯浠剁殑鏁版嵁");
- }
+ if (result.IsNullOrEmpty())
+ ConsoleHelper.WriteErrorLine($"{JsonConvert.SerializeObject(areaCodes)}-{productionLine}鏌ヨ甯告俯瀹炵洏搴撳瓨淇℃伅澶辫触:鏈壘鍒扮鍚堟潯浠剁殑鏁版嵁");
return result;
}
@@ -1105,21 +1081,19 @@
.Where(x => stackers.Contains(x.DeviceCode))
.ToList().Select(x => x.DeviceCode).ToList();
- IDictionary<string, DtStockInfo>? stockInfos = _simpleCacheService.HashGetAll<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo);
- List<DtStockInfo> stockInfoList = stockInfos.Values.ToList();
-
- var result = stockInfoList.Where(x => x.ProductionLine == station.productLine)
+ var result = await _stockInfoRepository.Db.Queryable<DtStockInfo>()
+ .Where(x => x.ProductionLine == station.productLine)
.Where(x => x.AreaCode == areaCode && x.IsFull == false)
- .Where(x => x.StockInfoDetails != null && x.StockInfoDetails.Any(y => y.MaterielCode == "绌烘墭鐩�"))
- .Where(x => x.LocationInfo != null && x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID && x.LocationInfo.EnalbeStatus == (int)EnableEnum.Enable) // 杩囨护鏉′欢
+ .Includes(x => x.StockInfoDetails)
+ .Where(x => x.StockInfoDetails.Any(y => y.MaterielCode == "绌烘墭鐩�"))
+ .Includes(x => x.LocationInfo)
.WhereIF(!deviceCode.IsNullOrEmpty(), x => deviceCode.Contains(x.LocationInfo.RoadwayNo))
+ .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID && x.LocationInfo.EnalbeStatus == (int)EnableEnum.Enable) // 杩囨护鏉′欢
.OrderBy(x => x.CreateDate) // 鎺掑簭
- .FirstOrDefault(); // 杞崲涓哄垪琛�
+ .FirstAsync(); // 杞崲涓哄垪琛�
- if (result != null)
- _simpleCacheService.HashDel<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, new string[] { result.PalletCode });
- else
- ConsoleHelper.WriteErrorLine("QueryStockInfoForEmptyTrayAsync鏌ヨ绌虹洏搴撳瓨淇℃伅澶辫触:鏈壘鍒扮鍚堟潯浠剁殑鏁版嵁");
+ if (result.IsNullOrEmpty())
+ ConsoleHelper.WriteErrorLine($"{area}-{station.productLine}鏌ヨ绌虹洏搴撳瓨淇℃伅澶辫触:鏈壘鍒扮鍚堟潯浠剁殑鏁版嵁");
return result;
}
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 e990f18..b4ea154 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
@@ -541,13 +541,17 @@
if (stationManager.stationType != 7) throw new Exception("閿欒鐨勮皟鍙�");
// 浠庣紦瀛樹腑鑾峰彇搴撳瓨淇℃伅
- IDictionary<string, DtStockInfo>? stockInfos = _simpleCacheService.HashGetAll<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo);
- List<DtStockInfo> stockInfoList = stockInfos.Values.ToList();
+ //IDictionary<string, DtStockInfo>? stockInfos = _simpleCacheService.HashGetAll<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo);
+ //List<DtStockInfo> stockInfoList = stockInfos.Values.ToList();
- var stockinfo1 = stockInfoList.OrderBy(x => x.CreateDate)
- .ToList();
- var stockinfo = stockinfo1.Where(x => x.LocationInfo != null && !x.IsFull && x.LocationInfo.RoadwayNo == stationManager.Roadway)
- .FirstOrDefault();
+ //var stockinfo1 = stockInfoList.OrderBy(x => x.CreateDate)
+ // .ToList();
+ //var stockinfo = stockinfo1.Where(x => x.LocationInfo != null && !x.IsFull && x.LocationInfo.RoadwayNo == stationManager.Roadway)
+ // .FirstOrDefault();
+ var stockinfo = await _stockInfoRepository.Db.Queryable<DtStockInfo>()
+ .Where(x => !x.IsFull && x.LocationInfo.RoadwayNo == stationManager.Roadway)
+ .OrderBy(x=>x.CreateDate)
+ .FirstAsync();
if (stockinfo == null) return null;
@@ -569,7 +573,7 @@
Creater = "System",
ProductionLine = stockinfo.ProductionLine,
};
- _simpleCacheService.HashDel<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, new string[] { task.PalletCode });
+ //_simpleCacheService.HashDel<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, new string[] { task.PalletCode });
return task;
}
catch (Exception ex)
@@ -980,23 +984,36 @@
.ToList().Select(x => x.DeviceCode).ToList();
// 浠庣紦瀛樹腑鑾峰彇搴撳瓨淇℃伅
- IDictionary<string, DtStockInfo>? stockInfos = _simpleCacheService.HashGetAll<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo);
- List<DtStockInfo> stockInfoList = stockInfos.Values.ToList();
+ //IDictionary<string, DtStockInfo>? stockInfos = _simpleCacheService.HashGetAll<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo);
+ //List<DtStockInfo> stockInfoList = stockInfos.Values.ToList();
- var result1 = stockInfoList.Where(x => x.ProductionLine == productLine)
- .Where(x => x.AreaCode == areaCode && x.IsFull == false)
- .WhereIF(!deviceCode.IsNullOrEmpty(), x => x.LocationInfo != null && deviceCode.Contains(x.LocationInfo.RoadwayNo))
- .OrderBy(x => x.CreateDate) // 鎺掑簭
- .ToList(); // 杞崲涓哄垪琛�
+ //var result1 = stockInfoList.Where(x => x.ProductionLine == productLine)
+ // .Where(x => x.AreaCode == areaCode && x.IsFull == false)
+ // .WhereIF(!deviceCode.IsNullOrEmpty(), x => x.LocationInfo != null && deviceCode.Contains(x.LocationInfo.RoadwayNo))
+ // .OrderBy(x => x.CreateDate) // 鎺掑簭
+ // .ToList(); // 杞崲涓哄垪琛�
- var result = result1.Where(x => x.StockInfoDetails != null && x.StockInfoDetails.Any(y => y.MaterielCode == "绌烘墭鐩�"))
- .Where(x => x.LocationInfo != null && x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID && x.LocationInfo.EnalbeStatus == (int)EnableEnum.Enable) // 杩囨护鏉′欢
- .FirstOrDefault(); // 鑾峰彇绗竴涓厓绱�
+ //var result = result1.Where(x => x.StockInfoDetails != null && x.StockInfoDetails.Any(y => y.MaterielCode == "绌烘墭鐩�"))
+ // .Where(x => x.LocationInfo != null && x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID && x.LocationInfo.EnalbeStatus == (int)EnableEnum.Enable) // 杩囨护鏉′欢
+ // .FirstOrDefault(); // 鑾峰彇绗竴涓厓绱�
- if (result != null)
- _simpleCacheService.HashDel<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, new string[] { result.PalletCode });
- else
+ //if (result != null)
+ // _simpleCacheService.HashDel<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, new string[] { result.PalletCode });
+ //else
+ // ConsoleHelper.WriteColorLine($"甯告俯{productLine}绌烘墭鐩樺簱瀛樹笉瓒�", ConsoleColor.Red);
+ var result = await _stockInfoRepository.Db.Queryable<DtStockInfo>()
+ .Includes(x => x.LocationInfo)
+ .Includes(x => x.StockInfoDetails)
+ .Where(x => x.AreaCode == areaCode && x.IsFull == false && x.ProductionLine == productLine)
+ .WhereIF(!deviceCode.IsNullOrEmpty(), x => deviceCode.Contains(x.LocationInfo.RoadwayNo))
+ .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID && x.LocationInfo.EnalbeStatus == (int)EnableEnum.Enable) // 杩囨护鏉′欢
+ .Where(x => x.StockInfoDetails.Any(y => y.MaterielCode == "绌烘墭鐩�"))
+ .OrderBy(x => x.CreateDate) // 鎺掑簭
+ .FirstAsync();
+
+ if (result.IsNullOrEmpty())
ConsoleHelper.WriteColorLine($"甯告俯{productLine}绌烘墭鐩樺簱瀛樹笉瓒�", ConsoleColor.Red);
+
return result;
}
@@ -1033,24 +1050,38 @@
.ToList()
: null;
- // 浠庣紦瀛樹腑鑾峰彇搴撳瓨淇℃伅
- IDictionary<string, DtStockInfo>? stockInfos = _simpleCacheService.HashGetAll<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo);
- List<DtStockInfo> stockInfoList = stockInfos.Values.ToList();
+ //// 浠庣紦瀛樹腑鑾峰彇搴撳瓨淇℃伅
+ //IDictionary<string, DtStockInfo>? stockInfos = _simpleCacheService.HashGetAll<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo);
+ //List<DtStockInfo> stockInfoList = stockInfos.Values.ToList();
+ //// 淇敼鍚庣殑鏌ヨ浠g爜
+ //var stockInfo1 = stockInfoList
+ // .Where(x => x.ProductionLine == station.productLine)
+ // .Where(x => x.AreaCode == "CWSC3" && x.IsFull == true)
+ // .OrderBy(x => x.OutboundTime)
+ // .ToList();
+
+ //var stockInfo = stockInfo1
+ // // 澧炲姞瀵� LocationInfo 鐨勭┖鍊兼鏌�
+ // .Where(x => x.LocationInfo != null && x.LocationInfo.LocationStatus == (int)LocationEnum.InStock)
+ // // 澧炲姞瀵� LocationInfo 鐨勭┖鍊兼鏌�
+ // .WhereIF(!deviceCode.IsNullOrEmpty(), x => x.LocationInfo != null && deviceCode.Contains(x.LocationInfo.RoadwayNo))
+ // .WhereIF(!materielCodes.IsNullOrEmpty(), x => x.StockInfoDetails != null && x.StockInfoDetails.Any(y => materielCodes.Contains(y.MaterielCode)))
+ // .FirstOrDefault();
// 淇敼鍚庣殑鏌ヨ浠g爜
- var stockInfo1 = stockInfoList
- .Where(x => x.ProductionLine == station.productLine)
- .Where(x => x.AreaCode == "CWSC3" && x.IsFull == true)
- .OrderBy(x => x.OutboundTime)
- .ToList();
+ var stockInfo = await _stockInfoRepository.Db.Queryable<DtStockInfo>()
+ .Includes(x => x.LocationInfo)
+ .Includes(x => x.StockInfoDetails)
+ .Where(x => x.ProductionLine == station.productLine)
+ .Where(x => x.AreaCode == "CWSC3" && x.IsFull == true)
+ // 澧炲姞瀵� LocationInfo 鐨勭┖鍊兼鏌�
+ .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock)
+ // 澧炲姞瀵� LocationInfo 鐨勭┖鍊兼鏌�
+ .WhereIF(!deviceCode.IsNullOrEmpty(), x => deviceCode.Contains(x.LocationInfo.RoadwayNo))
+ .WhereIF(!materielCodes.IsNullOrEmpty(), x => x.StockInfoDetails.Any(y => materielCodes.Contains(y.MaterielCode)))
+ .OrderBy(x => x.OutboundTime)
+ .FirstAsync();
- var stockInfo = stockInfo1
- // 澧炲姞瀵� LocationInfo 鐨勭┖鍊兼鏌�
- .Where(x => x.LocationInfo != null && x.LocationInfo.LocationStatus == (int)LocationEnum.InStock)
- // 澧炲姞瀵� LocationInfo 鐨勭┖鍊兼鏌�
- .WhereIF(!deviceCode.IsNullOrEmpty(), x => x.LocationInfo != null && deviceCode.Contains(x.LocationInfo.RoadwayNo))
- .WhereIF(!materielCodes.IsNullOrEmpty(), x => x.StockInfoDetails != null && x.StockInfoDetails.Any(y => materielCodes.Contains(y.MaterielCode)))
- .FirstOrDefault();
if (stockInfo == null) throw new Exception($"搴撳唴{station.productLine}鏃犳弧瓒虫潯浠剁殑搴撳瓨鍙嚭搴�");
@@ -1087,7 +1118,7 @@
stockInfo.LocationInfo.LocationStatus = (int)LocationEnum.InStockDisable;
_locationRepository.UpdateData(stockInfo.LocationInfo);
- _simpleCacheService.HashDel<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, new string[] { taskDTO.PalletCode });
+ //_simpleCacheService.HashDel<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, new string[] { taskDTO.PalletCode });
_locationStatusChangeRecordRepository.AddLocationStatusChangeRecord(stockInfo.LocationInfo, lastStatus, (int)StatusChangeTypeEnum.AutomaticDelivery, task.TaskNum);
--
Gitblit v1.9.3