From 0aed9c9ee65bd8a17837d83ec05e756d11fab297 Mon Sep 17 00:00:00 2001
From: xiazhengtongxue <133085197+xiazhengtongxue@users.noreply.github.com>
Date: 星期二, 21 四月 2026 15:29:48 +0800
Subject: [PATCH] Merge branch 'dev' of http://115.159.85.185:8098/r/SuZhouGuanHong/ShanMeiXinNengYuan into dev
---
Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoDetailController.cs | 91 +++++----
Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/MesUploadHelper.cs | 20 +
Code/WMS/WIDESEA_WMSClient/src/views/system/Mes_Log.vue | 14 +
Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/HttpRequestMiddleware.cs | 2
Code/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/MesService.cs | 2
Code/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/IMesService.cs | 7
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Filter/ApiAuthorizeFilter.cs | 3
Code/WMS/WIDESEA_WMSClient/src/extension/system/Mes_Log.jsx | 6
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTaskFilter.cs | 5
Code/WMS/WIDESEA_WMSClient/src/extension/stock/stockInfo.jsx | 44 +++-
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json | 2
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/CommonConveyorLineNewJob.cs | 25 ++
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineDispatchHandler.cs | 9
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs | 20 +
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneCommandBuilder.cs | 10
Code/.omc/state/subagent-tracking.json | 2
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Middlewares/HttpRequestMiddleware.cs | 2
Code/WMS/WIDESEA_WMSClient/src/extension/stock/extend/RobotSelect.vue | 125 +++++++++++++
Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/ApiAuthorizeFilter.cs | 2
Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Outbound.cs | 3
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs | 2
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/QuartzLogHelper.cs | 41 +++
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneTaskSelector.cs | 24 +-
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS_Server.csproj | 2
Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockSerivce.cs | 6
Code/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/IMesUploadHelper.cs | 2
Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Inbound.cs | 3
Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoController.cs | 11
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/LogHelper/QuartzLogger.cs | 2
Code/WMS/WIDESEA_WMSClient/src/api/http.js | 2
Code/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/UnbindContainerRequestDto.cs | 5
Code/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/BindContainerRequestDto.cs | 5
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTargetAddressSelector.cs | 7
33 files changed, 368 insertions(+), 138 deletions(-)
diff --git a/Code/.omc/state/subagent-tracking.json b/Code/.omc/state/subagent-tracking.json
index ccae26c..585696f 100644
--- a/Code/.omc/state/subagent-tracking.json
+++ b/Code/.omc/state/subagent-tracking.json
@@ -1459,5 +1459,5 @@
"total_spawned": 135,
"total_completed": 157,
"total_failed": 0,
- "last_updated": "2026-04-20T17:02:18.739Z"
+ "last_updated": "2026-04-21T06:46:41.255Z"
}
\ No newline at end of file
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Filter/ApiAuthorizeFilter.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Filter/ApiAuthorizeFilter.cs
index 36e0e7a..2591142 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Filter/ApiAuthorizeFilter.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Filter/ApiAuthorizeFilter.cs
@@ -7,6 +7,7 @@
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Hosting;
using WIDESEAWCS_Core.Authorization;
@@ -112,7 +113,7 @@
int ExpMinutes = AppSettings.Get("ExpMinutes").ObjToInt();
if ((expDate.GetValueOrDefault() - DateTime.Now).TotalMinutes < ExpMinutes / 3 && context.HttpContext.Request.Path != replaceTokenPath)
{
- context.HttpContext.Response.Headers.Add("wideseawcs_exp", "1");
+ context.HttpContext.Response.Headers.Append("wideseawcs_exp", "1");
}
}
}
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/LogHelper/QuartzLogger.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/LogHelper/QuartzLogger.cs
index 8789c83..a9baa03 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/LogHelper/QuartzLogger.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/LogHelper/QuartzLogger.cs
@@ -166,7 +166,7 @@
string fileName = GetLogFileName(entry.Source);
string filePath = Path.Combine(_logFolder, fileName);
string content = entry.ToFormattedString() + Environment.NewLine;
- ConsoleHelper.WriteInfoLine(content);
+ //ConsoleHelper.WriteInfoLine(content);
File.AppendAllText(filePath, content);
}
}
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Middlewares/HttpRequestMiddleware.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Middlewares/HttpRequestMiddleware.cs
index 9e651d3..2060a13 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Middlewares/HttpRequestMiddleware.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Middlewares/HttpRequestMiddleware.cs
@@ -25,7 +25,7 @@
public async Task InvokeAsync(HttpContext context)
{
- context.Response.Headers.Add("Access-Control-Expose-Headers", "wideseawcs_exp");
+ context.Response.Headers.Append("Access-Control-Expose-Headers", "wideseawcs_exp");
await _next(context);
}
}
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs
index 9bd9909..815c704 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs
@@ -49,7 +49,7 @@
.Enrich.WithProperty("Application", "WCS")
// 璁剧疆Microsoft鍛藉悕绌洪棿鐨勬棩蹇楃骇鍒负Information
// 杩欐牱鍙互鍑忓皯Microsoft妗嗘灦鏈韩鐨勮缁嗘棩蹇楋紝閬垮厤杩囧鐨凞ebug鏃ュ織
- .MinimumLevel.Override("Microsoft", LogEventLevel.Information)
+ .MinimumLevel.Override("Microsoft", LogEventLevel.Debug)
.WriteTo.Console() // 娣诲姞鎺у埗鍙拌緭鍑烘帴鏀跺櫒锛屾棩蹇楀皢鏄剧ず鍦ㄦ帶鍒跺彴绐楀彛涓�
// 娣诲姞鏂囦欢杈撳嚭鎺ユ敹鍣紝灏嗘棩蹇楀啓鍏ユ枃浠剁郴缁�
.WriteTo.File(
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS_Server.csproj b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS_Server.csproj
index 3d0d2f9..c9b8993 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS_Server.csproj
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS_Server.csproj
@@ -65,7 +65,7 @@
</ItemGroup>
<ItemGroup>
- <PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
+ <PackageReference Include="Swashbuckle.AspNetCore" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json
index caf766d..9d1eeae 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json
@@ -39,7 +39,7 @@
//璺ㄥ煙
"Cors": {
"PolicyName": "CorsIpAccess", //绛栫暐鍚嶇О
- "EnableAllIPs": false, //褰撲负true鏃讹紝寮�鏀炬墍鏈塈P鍧囧彲璁块棶銆�
+ "EnableAllIPs": true, //褰撲负true鏃讹紝寮�鏀炬墍鏈塈P鍧囧彲璁块棶銆�
// 鏀寔澶氫釜鍩熷悕绔彛锛屾敞鎰忕鍙e彿鍚庝笉瑕佸甫/鏂滄潌锛氭瘮濡俵ocalhost:8000/锛屾槸閿欑殑
// 娉ㄦ剰锛宧ttp://127.0.0.1:1818 鍜� http://localhost:1818 鏄笉涓�鏍风殑
"IPs": "http://127.0.0.1:8080,http://localhost:8080,http://localhost:8081"
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/CommonConveyorLineNewJob.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/CommonConveyorLineNewJob.cs
index c88e03c..79096d3 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/CommonConveyorLineNewJob.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/CommonConveyorLineNewJob.cs
@@ -1,15 +1,14 @@
using MapsterMapper;
using Masuit.Tools;
using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Quartz;
+using Serilog;
using SqlSugar;
using WIDESEA_Core;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Helper;
-using WIDESEAWCS_Core.LogHelper;
using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
@@ -41,7 +40,6 @@
/// 浠诲姟鏈嶅姟
/// </summary>
private readonly ITaskService _taskService;
-
/// <summary>
/// 鏈哄櫒浜轰换鍔℃湇鍔�
@@ -82,7 +80,7 @@
/// <summary>
/// 鏃ュ織璁板綍鍣�
/// </summary>
- private readonly ILogger<CommonConveyorLineNewJob> _logger;
+ private readonly ILogger _logger;
/// <summary>
/// 鐩爣鍦板潃鍒拌澶囩被鍨嬬殑鏄犲皠
@@ -90,6 +88,11 @@
/// <remarks>
/// </remarks>
private static List<string> AddressToDeviceType = new List<string> { "11020", "11028" };
+
+ /// <summary>
+ /// 鎵樼洏妫�鏌ヤ綅缃殑鏈�杩戞墽琛屾椂闂达紙鐢ㄤ簬30绉掗棿闅旈檺鍒讹級
+ /// </summary>
+ private static readonly Dictionary<string, DateTime> _lastPalletCheckTime = new();
/// <summary>
/// 鏋勯�犲嚱鏁�
@@ -100,7 +103,7 @@
/// <param name="mapper">瀵硅薄鏄犲皠鍣�</param>
/// <param name="httpClientHelper">HTTP 瀹㈡埛绔府鍔╃被</param>
/// <param name="logger">鏃ュ織璁板綍鍣�</param>
- public CommonConveyorLineNewJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, HttpClientHelper httpClientHelper, ILogger<CommonConveyorLineNewJob> logger, IRobotTaskService robotTaskService)
+ public CommonConveyorLineNewJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, HttpClientHelper httpClientHelper, ILogger logger, IRobotTaskService robotTaskService)
{
_taskService = taskService;
_taskExecuteDetailService = taskExecuteDetailService;
@@ -179,6 +182,13 @@
// 濡傛灉褰撳墠璁惧鍦ㄦ鏌ュ垪琛ㄤ腑
if (checkPalletPositions.Any(x => x.Code == childDeviceCode))
{
+ // 30绉掗棿闅旈檺鍒�
+ if (_lastPalletCheckTime.TryGetValue(childDeviceCode, out var lastTime) &&
+ (DateTime.Now - lastTime).TotalSeconds < 30)
+ {
+ continue;
+ }
+
// 妫�鏌ヨ緭閫佺嚎鐘舵�侊紙鏄惁鏈夋墭鐩橈級
if (command.CV_State == 2)
{
@@ -196,6 +206,8 @@
TargetAddress = childDeviceCode
}.Serialize());
+ _lastPalletCheckTime[childDeviceCode] = DateTime.Now;
+
// 濡傛灉璇锋眰鎴愬姛锛屾帴鏀� WMS 杩斿洖鐨勪换鍔�
if (responseResult.IsSuccess && responseResult.Data.Status)
{
@@ -208,7 +220,7 @@
}
}
- #endregion
+ #endregion 妫�娴嬫槸鍚﹂渶瑕佺┖鎵樼洏
// ========== 妫�鏌� PLC_STB 鏍囧織 ==========
// 鍙湁褰� PLC_STB 涓� 1 鏃舵墠澶勭悊浠诲姟
@@ -278,7 +290,6 @@
RobotTargetAddressLineCode = childDeviceCode,
RobotTaskNum = num, // 鐢熸垚浠诲姟鍙�
RobotDispatchertime = DateTime.Now,
-
};
if (_robotTaskService.AddData(robotTask).Status)
{
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineDispatchHandler.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineDispatchHandler.cs
index 614a8bd..2d946c4 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineDispatchHandler.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineDispatchHandler.cs
@@ -1,9 +1,7 @@
using MapsterMapper;
-using Microsoft.Extensions.Logging;
+using Serilog;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
-using WIDESEAWCS_Core.Helper;
-using WIDESEAWCS_Core.LogHelper;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
@@ -201,7 +199,6 @@
Dt_Task? task = _taskFilter.QueryExecutingTask(command.TaskNo, childDeviceCode);
if (task != null)
{
-
// 鏇存柊浠诲姟鐘舵�佸埌涓嬩竴闃舵锛堥�氬父鏄畬鎴愶級
if (_taskService.UpdateTaskStatusToNext(task).Status)
{
@@ -209,8 +206,6 @@
conveyorLine.SetValue(ConveyorLineDBNameNew.WCS_ACK, (short)1, childDeviceCode);
QuartzLogHelper.LogInfo(_logger, "ConveyorLineInFinish锛氬叆搴撳畬鎴愶紝浠诲姟鍙�: {TaskNum}锛屽瓙璁惧: {ChildDeviceCode}", $"鍏ュ簱瀹屾垚锛屼换鍔″彿: {task.TaskNum}", conveyorLine.DeviceCode, task.TaskNum, childDeviceCode);
}
-
-
}
}
@@ -316,4 +311,4 @@
}
}
}
-}
+}
\ No newline at end of file
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTargetAddressSelector.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTargetAddressSelector.cs
index 24c16e3..1fd2000 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTargetAddressSelector.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTargetAddressSelector.cs
@@ -1,5 +1,4 @@
-using Microsoft.Extensions.Logging;
-using WIDESEAWCS_Core.LogHelper;
+using Serilog;
using WIDESEAWCS_QuartzJob;
namespace WIDESEAWCS_Tasks
@@ -276,7 +275,7 @@
if (device == null)
{
// 璁惧鏈壘鍒版椂璁板綍璋冭瘯鏃ュ織锛屾柟渚挎帓鏌ラ厤缃棶棰�
- _logger.LogDebug("FindDevice锛氭湭鎵惧埌 {DeviceName}", deviceName);
+ _logger.Debug("FindDevice锛氭湭鎵惧埌 {DeviceName}", deviceName);
}
return device; // 鍙兘涓� null锛岀敱璋冪敤鏂硅礋璐� null 妫�鏌�
}
@@ -456,4 +455,4 @@
QuartzLogHelper.LogDebug(_logger, "Handle{Scenario}锛氬瓙璁惧: {ChildDeviceCode}锛岀洰鏍囧湴鍧�: {NextAddress}", $"Handle{scenario}锛氬瓙璁惧: {childDeviceCode}锛岀洰鏍囧湴鍧�: {nextAddress}", conveyorLine.DeviceCode, scenario, childDeviceCode, nextAddress);
}
}
-}
+}
\ No newline at end of file
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTaskFilter.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTaskFilter.cs
index 1d3b938..5339fee 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTaskFilter.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTaskFilter.cs
@@ -1,5 +1,4 @@
-using Microsoft.Extensions.Logging;
-using WIDESEAWCS_Core.LogHelper;
+using Serilog;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
@@ -94,4 +93,4 @@
return result.Status;
}
}
-}
+}
\ No newline at end of file
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/QuartzLogHelper.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/QuartzLogHelper.cs
index 20d43ff..cc0c9a5 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/QuartzLogHelper.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/QuartzLogHelper.cs
@@ -1,4 +1,4 @@
-using Microsoft.Extensions.Logging;
+using Serilog;
using WIDESEAWCS_Core.LogHelper;
namespace WIDESEAWCS_Tasks;
@@ -23,7 +23,7 @@
/// <param name="args">ILogger 缁撴瀯鍖栨棩蹇楃殑鍙傛暟</param>
public static void LogError(ILogger logger, Exception ex, string loggerMessage, string quartzMessage, string deviceCode, params object[] args)
{
- logger.LogError(ex, loggerMessage, args);
+ logger.Error(ex, loggerMessage, args);
QuartzLogger.Error(quartzMessage, deviceCode, ex);
}
@@ -37,7 +37,7 @@
/// <param name="args">ILogger 缁撴瀯鍖栨棩蹇楃殑鍙傛暟</param>
public static void LogError(ILogger logger, string loggerMessage, string quartzMessage, string deviceCode, params object[] args)
{
- logger.LogError(loggerMessage, args);
+ logger.Error(loggerMessage, args);
QuartzLogger.Error(quartzMessage, deviceCode);
}
@@ -51,8 +51,21 @@
/// <param name="args">ILogger 缁撴瀯鍖栨棩蹇楃殑鍙傛暟</param>
public static void LogInfo(ILogger logger, string loggerMessage, string quartzMessage, string deviceCode, params object[] args)
{
- logger.LogInformation(loggerMessage, args);
+ logger.Information(loggerMessage, args);
QuartzLogger.Info(quartzMessage, deviceCode);
+ }
+
+ /// <summary>
+ /// 璁板綍淇℃伅鏃ュ織
+ /// </summary>
+ /// <param name="logger">ILogger 瀹炰緥</param>
+ /// <param name="loggerMessage">ILogger 鐨勭粨鏋勫寲鏃ュ織妯℃澘</param>
+ /// <param name="quartzMessage">QuartzLogger 鐨勬棩蹇楁秷鎭�</param>
+ /// <param name="deviceCode">璁惧缂栫爜</param>
+ public static void LogInfo(ILogger logger, string loggerMessage, string deviceCode)
+ {
+ logger.Information(loggerMessage);
+ QuartzLogger.Info(loggerMessage, deviceCode);
}
/// <summary>
@@ -65,7 +78,7 @@
/// <param name="args">ILogger 缁撴瀯鍖栨棩蹇楃殑鍙傛暟</param>
public static void LogWarn(ILogger logger, string loggerMessage, string quartzMessage, string deviceCode, params object[] args)
{
- logger.LogWarning(loggerMessage, args);
+ logger.Warning(loggerMessage, args);
QuartzLogger.Warn(quartzMessage, deviceCode);
}
@@ -79,7 +92,21 @@
/// <param name="args">ILogger 缁撴瀯鍖栨棩蹇楃殑鍙傛暟</param>
public static void LogDebug(ILogger logger, string loggerMessage, string quartzMessage, string deviceCode, params object[] args)
{
- logger.LogDebug(loggerMessage, args);
+ logger.Debug(loggerMessage, args);
QuartzLogger.Debug(quartzMessage, deviceCode);
}
-}
+
+ /// <summary>
+ /// 璁板綍璋冭瘯鏃ュ織
+ /// </summary>
+ /// <param name="logger">ILogger 瀹炰緥</param>
+ /// <param name="loggerMessage">ILogger 鐨勭粨鏋勫寲鏃ュ織妯℃澘锛堟敮鎸佸崰浣嶇锛�</param>
+ /// <param name="quartzMessage">QuartzLogger 鐨勬棩蹇楁秷鎭�</param>
+ /// <param name="deviceCode">璁惧缂栫爜</param>
+ /// <param name="args">ILogger 缁撴瀯鍖栨棩蹇楃殑鍙傛暟</param>
+ public static void LogDebug(ILogger logger, string loggerMessage, string deviceCode)
+ {
+ logger.Debug(loggerMessage);
+ QuartzLogger.Debug(loggerMessage, deviceCode);
+ }
+}
\ No newline at end of file
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
index 385b838..cba170a 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
@@ -1,7 +1,8 @@
-using Microsoft.Extensions.Logging;
+//using Microsoft.Extensions.Logging;
using Quartz;
+using Serilog;
using WIDESEA_Core;
-using WIDESEAWCS_Core;
+using WIDESEAWCS_Common.Constants;
using WIDESEAWCS_Core.LogHelper;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
@@ -10,7 +11,6 @@
using WIDESEAWCS_QuartzJob.Service;
using WIDESEAWCS_QuartzJob.StackerCrane;
using WIDESEAWCS_QuartzJob.StackerCrane.Enum;
-using WIDESEAWCS_Common.Constants;
using WIDESEAWCS_Tasks.StackerCraneJob;
namespace WIDESEAWCS_Tasks
@@ -81,7 +81,7 @@
/// <summary>
/// 鏃ュ織璁板綍鍣�
/// </summary>
- private readonly ILogger<CommonStackerCraneJob> _logger;
+ private readonly ILogger _logger;
/// <summary>
/// 鍫嗗灈鏈鸿澶囩紪鐮�
@@ -103,7 +103,7 @@
ITaskRepository taskRepository,
IRouterService routerService,
HttpClientHelper httpClientHelper,
- ILogger<CommonStackerCraneJob> logger)
+ ILogger logger)
{
_taskService = taskService;
_taskExecuteDetailService = taskExecuteDetailService;
@@ -169,10 +169,12 @@
{
try
{
+ //QuartzLogger.Info($"CommonStackerCraneJob Execute锛氬紑濮嬫墽琛屽爢鍨涙満浠诲姟璋冨害 銆恵DateTime.Now.ToString("F")}銆�", "CommonStackerCraneJob Execute ");
// 浠� JobDataMap 鑾峰彇鍫嗗灈鏈鸿澶囧弬鏁�
bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value);
if (!flag || value is not CommonStackerCrane commonStackerCrane)
{
+ _logger.Information("Execute锛氬弬鏁版棤鏁堬紝鏈壘鍒� JobParams 鎴栫被鍨嬩笉鍖归厤");
// 鍙傛暟鏃犳晥锛岀洿鎺ヨ繑鍥�
QuartzLogHelper.LogWarn(_logger, "Execute锛氬弬鏁版棤鏁�", "Execute锛氬弬鏁版棤鏁�", "CommonStackerCraneJob");
return Task.CompletedTask;
@@ -193,7 +195,7 @@
// ========== 妫�鏌ユ槸鍚﹀彲浠ュ彂閫佹柊浠诲姟 ==========
//if (!commonStackerCrane.IsCanSendTask(commonStackerCrane.Communicator, commonStackerCrane.DeviceProDTOs, commonStackerCrane.DeviceProtocolDetailDTOs))
- if (commonStackerCrane.StackerCraneStatusValue != StackerCraneStatus.Normal )
+ if (commonStackerCrane.StackerCraneStatusValue != StackerCraneStatus.Normal)
{
// 鍫嗗灈鏈轰笉鍙敤锛堝姝e湪鎵ц涓婁竴浠诲姟锛夛紝鐩存帴杩斿洖
return Task.CompletedTask;
@@ -207,6 +209,8 @@
// 娌℃湁鍙敤浠诲姟
return Task.CompletedTask;
}
+
+
// ========== 鏋勫缓鍛戒护 ==========
// 鍛戒护鏋勫缓涓嬫矇鍒颁笓鐢ㄦ瀯寤哄櫒
@@ -240,6 +244,10 @@
// 璁板綍寮傚父
QuartzLogHelper.LogError(_logger, ex, "Execute锛氭墽琛屽紓甯革紝璁惧: {DeviceCode}", $"鎵ц寮傚父: {ex.Message}", _deviceCode, _deviceCode);
}
+ finally
+ {
+ QuartzLogHelper.LogInfo(_logger, $"CommonStackerCraneJob Execute锛氬爢鍨涙満浠诲姟璋冨害鎵ц瀹屾垚 銆恵DateTime.Now.ToString("F")}銆�", _deviceCode);
+ }
return Task.CompletedTask;
}
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneCommandBuilder.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneCommandBuilder.cs
index ae7cb04..1fd63c4 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneCommandBuilder.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneCommandBuilder.cs
@@ -1,9 +1,7 @@
-using Microsoft.Extensions.Logging;
-using System;
+using Serilog;
using System.Diagnostics.CodeAnalysis;
using WIDESEAWCS_Common.Constants;
using WIDESEAWCS_Common.TaskEnum;
-using WIDESEAWCS_Core.LogHelper;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob.Models;
@@ -68,7 +66,7 @@
/// <returns>鍫嗗灈鏈哄懡浠ゅ璞★紝杞崲澶辫触杩斿洖 null</returns>
public object? ConvertToStackerCraneTaskCommand([NotNull] Dt_Task task)
{
- return BuildCommand(task, CreateStandardCommand(task));
+ return BuildCommand(task, CreateStandardCommand(task));
// 鏍规嵁宸烽亾鑾峰彇鍛戒护绫诲瀷
//string commandType = GetCommandType(task.Roadway);
@@ -198,7 +196,7 @@
{
taskType = StackerCraneConst.EmptyPalletTaskType;
}
- else if(task.TaskType == (int)TaskInboundTypeEnum.InEmpty)
+ else if (task.TaskType == (int)TaskInboundTypeEnum.InEmpty)
{
taskType = StackerCraneConst.EmptyInPalletTaskType;
}
@@ -388,4 +386,4 @@
&& short.TryParse(parts[2], out layer);
}
}
-}
+}
\ No newline at end of file
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneTaskSelector.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneTaskSelector.cs
index bcb57da..80771a1 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneTaskSelector.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneTaskSelector.cs
@@ -1,12 +1,11 @@
-using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
+using Serilog;
using System.Diagnostics.CodeAnalysis;
using WIDESEA_Core;
using WIDESEAWCS_Common.Constants;
using WIDESEAWCS_Common.HttpEnum;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
-using WIDESEAWCS_Core.LogHelper;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
@@ -101,15 +100,14 @@
Dt_Task? candidateTask;
var deviceCode = commonStackerCrane.DeviceCode;
- //_logger.LogInformation("SelectTask锛氬紑濮嬮�夋嫨浠诲姟锛岃澶�: {DeviceCode}锛屼笂涓�浠诲姟绫诲瀷: {LastTaskType}", deviceCode, commonStackerCrane.LastTaskType);
- //QuartzLogger.Info($"寮�濮嬮�夋嫨浠诲姟锛岃澶�: {deviceCode}锛屼笂涓�浠诲姟绫诲瀷: {commonStackerCrane.LastTaskType}", deviceCode);
+ QuartzLogHelper.LogDebug(_logger, $"寮�濮嬮�夋嫨浠诲姟锛岃澶�: {deviceCode}锛屼笂涓�浠诲姟绫诲瀷: {commonStackerCrane.LastTaskType}",commonStackerCrane.DeviceName);
// 鏍规嵁涓婁竴浠诲姟绫诲瀷鍐冲畾鏌ヨ绛栫暐
if (commonStackerCrane.LastTaskType == null || commonStackerCrane.LastTaskType == TaskRelocationTypeEnum.Relocation.GetHashCode())
{
// 娌℃湁涓婁竴浠诲姟绫诲瀷锛屾煡璇㈡櫘閫氫换鍔�
candidateTask = _taskService.QueryStackerCraneTask(deviceCode);
- //QuartzLogHelper.LogDebug(_logger, "SelectTask锛氭煡璇㈡櫘閫氫换鍔★紝璁惧: {DeviceCode}锛岀粨鏋�: {TaskNum}", $"鏌ヨ鏅�氫换鍔★紝璁惧: {deviceCode}锛岀粨鏋�: {candidateTask?.TaskNum}", deviceCode, deviceCode, candidateTask?.TaskNum);
+ QuartzLogHelper.LogDebug(_logger, $"鏌ヨ鏅�氫换鍔★紝璁惧: {deviceCode}锛岀粨鏋�: {candidateTask?.TaskNum}", commonStackerCrane.DeviceName);
}
else if (commonStackerCrane.LastTaskType.GetValueOrDefault().GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
{
@@ -117,26 +115,26 @@
candidateTask = _taskService.QueryStackerCraneInTask(deviceCode);
// 濡傛灉娌℃湁鍏ュ簱浠诲姟锛屽啀鏌ヤ竴涓嬪嚭搴撲换鍔�
candidateTask ??= _taskService.QueryStackerCraneOutTask(deviceCode);
- //QuartzLogHelper.LogDebug(_logger, "SelectTask锛氬嚭搴撳悗浼樺厛鏌ュ叆搴擄紝璁惧: {DeviceCode}锛岀粨鏋�: {TaskNum}", $"鍑哄簱鍚庝紭鍏堟煡鍏ュ簱锛岃澶�: {deviceCode}锛岀粨鏋�: {candidateTask?.TaskNum}", deviceCode, deviceCode, candidateTask?.TaskNum);
+ QuartzLogHelper.LogDebug(_logger, $"鍑哄簱鍚庝紭鍏堟煡鍏ュ簱锛岃澶�: {deviceCode}锛岀粨鏋�: {candidateTask?.TaskNum}", commonStackerCrane.DeviceName);
}
else
{
// 涓婁竴浠诲姟鏄叆搴擄紙闈炲嚭搴擄級锛屼紭鍏堟煡鍑哄簱浠诲姟
candidateTask = _taskService.QueryStackerCraneOutTask(deviceCode);
- //QuartzLogHelper.LogDebug(_logger, "SelectTask锛氬叆搴撳悗浼樺厛鏌ュ嚭搴擄紝璁惧: {DeviceCode}锛岀粨鏋�: {TaskNum}", $"鍏ュ簱鍚庝紭鍏堟煡鍑哄簱锛岃澶�: {deviceCode}锛岀粨鏋�: {candidateTask?.TaskNum}", deviceCode, deviceCode, candidateTask?.TaskNum);
+ QuartzLogHelper.LogDebug(_logger, $"鍏ュ簱鍚庝紭鍏堟煡鍑哄簱锛岃澶�: {deviceCode}锛岀粨鏋�: {candidateTask?.TaskNum}", commonStackerCrane.DeviceName);
}
// 濡傛灉娌℃湁鍊欓�変换鍔★紝杩斿洖 null
if (candidateTask == null)
{
- //QuartzLogHelper.LogDebug(_logger, "SelectTask锛氭病鏈夊�欓�変换鍔★紝璁惧: {DeviceCode}", $"娌℃湁鍊欓�変换鍔★紝璁惧: {deviceCode}", deviceCode, deviceCode);
+ QuartzLogHelper.LogDebug(_logger, $"娌℃湁鍊欓�変换鍔★紝璁惧: {deviceCode}", commonStackerCrane.DeviceName);
return null;
}
// 濡傛灉涓嶆槸鍑哄簱浠诲姟锛岀洿鎺ヨ繑鍥�
if (candidateTask.TaskType.GetTaskTypeGroup() != TaskTypeGroup.OutbondGroup)
{
- QuartzLogHelper.LogInfo(_logger, "SelectTask锛氶�変腑闈炲嚭搴撲换鍔★紝璁惧: {DeviceCode}锛屼换鍔″彿: {TaskNum}锛屼换鍔$被鍨�: {TaskType}", $"閫変腑闈炲嚭搴撲换鍔★紝浠诲姟鍙�: {candidateTask.TaskNum}锛屼换鍔$被鍨�: {candidateTask.TaskType}", deviceCode, deviceCode, candidateTask.TaskNum, candidateTask.TaskType);
+ QuartzLogHelper.LogDebug(_logger, $"閫変腑闈炲嚭搴撲换鍔★紝浠诲姟鍙�: {candidateTask.TaskNum}锛屼换鍔$被鍨�: {candidateTask.TaskType}", commonStackerCrane.DeviceName);
return candidateTask;
}
@@ -144,7 +142,7 @@
Dt_Task? selectedTask = TrySelectOutboundTask(candidateTask);
if (selectedTask != null)
{
- QuartzLogHelper.LogInfo(_logger, "SelectTask锛氶�変腑鍑哄簱浠诲姟锛岃澶�: {DeviceCode}锛屼换鍔″彿: {TaskNum}", $"閫変腑鍑哄簱浠诲姟锛屼换鍔″彿: {selectedTask.TaskNum}", deviceCode, deviceCode, selectedTask.TaskNum);
+ QuartzLogHelper.LogDebug(_logger, $"閫変腑鍑哄簱浠诲姟锛屼换鍔″彿: {selectedTask.TaskNum}", commonStackerCrane.DeviceName);
return selectedTask;
}
@@ -161,14 +159,14 @@
selectedTask = TrySelectOutboundTask(alternativeTask);
if (selectedTask != null)
{
- QuartzLogHelper.LogInfo(_logger, "SelectTask锛氶�変腑澶囬�夊嚭搴撲换鍔★紝璁惧: {DeviceCode}锛屼换鍔″彿: {TaskNum}", $"閫変腑澶囬�夊嚭搴撲换鍔★紝浠诲姟鍙�: {selectedTask.TaskNum}", deviceCode, deviceCode, selectedTask.TaskNum);
+ QuartzLogHelper.LogDebug(_logger, $"閫変腑澶囬�夊嚭搴撲换鍔★紝浠诲姟鍙�: {selectedTask.TaskNum}", commonStackerCrane.DeviceName);
return selectedTask;
}
}
// 娌℃湁鍙敤鍑哄簱浠诲姟锛屽皾璇曡繑鍥炲叆搴撲换鍔�
var inboundTask = _taskService.QueryStackerCraneInTask(deviceCode);
- QuartzLogHelper.LogInfo(_logger, "SelectTask锛氳繑鍥炲叆搴撲换鍔★紝璁惧: {DeviceCode}锛屼换鍔″彿: {TaskNum}", $"杩斿洖鍏ュ簱浠诲姟锛屼换鍔″彿: {inboundTask?.TaskNum}", deviceCode, deviceCode, inboundTask?.TaskNum);
+ QuartzLogHelper.LogDebug(_logger, $"杩斿洖鍏ュ簱浠诲姟锛屼换鍔″彿: {inboundTask?.TaskNum}", commonStackerCrane.DeviceName);
return inboundTask;
}
@@ -316,4 +314,4 @@
return isOccupied;
}
}
-}
+}
\ No newline at end of file
diff --git a/Code/WMS/WIDESEA_WMSClient/src/api/http.js b/Code/WMS/WIDESEA_WMSClient/src/api/http.js
index 30892ab..0a26762 100644
--- a/Code/WMS/WIDESEA_WMSClient/src/api/http.js
+++ b/Code/WMS/WIDESEA_WMSClient/src/api/http.js
@@ -12,7 +12,7 @@
let loadingInstance;
let loadingStatus = false;
if (process.env.NODE_ENV == 'development') {
- axios.defaults.baseURL = 'http://127.0.0.1:9291/';
+ axios.defaults.baseURL = window.webConfig.webApiProduction;
}
else if (process.env.NODE_ENV == 'debug') {
axios.defaults.baseURL = window.webConfig.webApiBaseUrl;
diff --git a/Code/WMS/WIDESEA_WMSClient/src/extension/stock/extend/RobotSelect.vue b/Code/WMS/WIDESEA_WMSClient/src/extension/stock/extend/RobotSelect.vue
new file mode 100644
index 0000000..80bd972
--- /dev/null
+++ b/Code/WMS/WIDESEA_WMSClient/src/extension/stock/extend/RobotSelect.vue
@@ -0,0 +1,125 @@
+<template>
+ <div>
+ <vol-box
+ v-model="showDetialBox"
+ :lazy="true"
+ width="400px"
+ :padding="15"
+ title="閫夋嫨鏈烘鎵�"
+ >
+ <div>
+ <el-form>
+ <el-form-item required label="鏈烘鎵嬶細">
+ <el-select v-model="selectedRobot" placeholder="璇烽�夋嫨鏈烘鎵�" style="width: 100%">
+ <el-option
+ v-for="item in robotList"
+ :key="item.robotCode"
+ :label="item.robotName"
+ :value="item.robotCode"
+ >
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-form>
+ </div>
+ <template #footer>
+ <el-button type="primary" size="small" @click="submit">纭</el-button>
+ <el-button type="danger" size="small" @click="close">鍏抽棴</el-button>
+ </template>
+ </vol-box>
+ </div>
+</template>
+
+<script>
+import VolBox from "@/components/basic/VolBox.vue";
+export default {
+ components: { VolBox },
+ data() {
+ return {
+ showDetialBox: false,
+ robotList: [
+ { robotCode: '娉ㄦ恫缁勭洏鏈烘鎵�', robotName: '娉ㄦ恫缁勭洏鏈烘鎵�' },
+ { robotCode: '楂樻俯鎹㈢洏鏈烘鎵�', robotName: '楂樻俯鎹㈢洏鏈烘鎵�' },
+ { robotCode: '鍖栨垚鎹㈢洏鏈烘鎵�', robotName: '鍖栨垚鎹㈢洏鏈烘鎵�' },
+ { robotCode: '鎷嗙洏鏈烘鎵�', robotName: '鎷嗙洏鏈烘鎵�' },
+ { robotCode: '鎴愬搧缁勭洏鏈烘鎵�', robotName: '鎴愬搧缁勭洏鏈烘鎵�' }
+ ],
+ selectedRobot: '',
+ currentRow: null,
+ actionType: null // 'bind' or 'unbind'
+ };
+ },
+ methods: {
+ open(action, row) {
+ this.actionType = action;
+ this.currentRow = row;
+ this.selectedRobot = '';
+ this.showDetialBox = true;
+ },
+ close() {
+ this.showDetialBox = false;
+ },
+ async submit() {
+ if (!this.selectedRobot) {
+ return this.$message.error("璇烽�夋嫨鏈烘鎵�");
+ }
+
+ this.showDetialBox = false;
+
+ try {
+ if (this.actionType === 'bind') {
+ // 缁勭洏纭
+ await this.$confirm(
+ `纭鎵ц鎵樼洏缁勭洏鎿嶄綔锛焅n鎵樼洏缂栧彿锛�${this.currentRow.palletCode}\n鏈烘鎵嬶細${this.selectedRobot}`,
+ "缁勭洏纭",
+ {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning"
+ }
+ );
+
+ const result = await this.http.post("/api/StockInfoDetail/BindContainer", {
+ palletCode: this.currentRow.palletCode,
+ robotCode: this.selectedRobot
+ }, "姝e湪璋冪敤MES鎺ュ彛...");
+
+ if (result.status) {
+ this.$Message.success(result.message || "鎵樼洏缁勭洏鎴愬姛");
+ this.$parent.$refs.table.load();
+ } else {
+ this.$error(result.message || "鎵樼洏缁勭洏澶辫触");
+ }
+ } else if (this.actionType === 'unbind') {
+ // 鎷嗙洏纭
+ await this.$confirm(
+ `纭鎵ц鎵樼洏鎷嗙洏鎿嶄綔锛焅n鎵樼洏缂栧彿锛�${this.currentRow.palletCode}\n鏈烘鎵嬶細${this.selectedRobot}`,
+ "鎷嗙洏纭",
+ {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning"
+ }
+ );
+
+ const result = await this.http.post("/api/StockInfoDetail/UnbindContainer", {
+ palletCode: this.currentRow.palletCode,
+ robotCode: this.selectedRobot
+ }, "姝e湪璋冪敤MES鎺ュ彛...");
+
+ if (result.status) {
+ this.$Message.success(result.message || "鎵樼洏鎷嗙洏鎴愬姛");
+ this.$parent.$refs.table.load();
+ } else {
+ this.$error(result.message || "鎵樼洏鎷嗙洏澶辫触");
+ }
+ }
+ } catch (error) {
+ if (error !== "cancel") {
+ this.$error(error.message || "缃戠粶閿欒锛岃绋嶅悗閲嶈瘯");
+ }
+ }
+ }
+ }
+};
+</script>
diff --git a/Code/WMS/WIDESEA_WMSClient/src/extension/stock/stockInfo.jsx b/Code/WMS/WIDESEA_WMSClient/src/extension/stock/stockInfo.jsx
index 6a0c613..0204d4e 100644
--- a/Code/WMS/WIDESEA_WMSClient/src/extension/stock/stockInfo.jsx
+++ b/Code/WMS/WIDESEA_WMSClient/src/extension/stock/stockInfo.jsx
@@ -1,11 +1,12 @@
//姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜
+import RobotSelect from './extend/RobotSelect.vue';
let extension = {
components: {
//鏌ヨ鐣岄潰鎵╁睍缁勪欢
- gridHeader: "",
- gridBody: "",
- gridFooter: "",
+ gridHeader: '',
+ gridBody: RobotSelect,
+ gridFooter: '',
//鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
modelHeader: "",
modelBody: "",
@@ -28,26 +29,34 @@
<el-button
type="primary"
size="small"
- onClick={($e) => {
- this.handleInbound(row);
- }}
- >
- 杩涚珯
- </el-button>
+ onClick={($e) => { this.handleBind(row); }}
+ >缁戝畾</el-button>
+ <el-button
+ type="primary"
+ size="small"
+ onClick={($e) => { this.handleInbound(row); }}
+ >杩涚珯</el-button>
<el-button
type="success"
size="small"
style="margin-left: 8px"
- onClick={($e) => {
- this.handleOutbound(row);
- }}
- >
- 鍑虹珯
- </el-button>
+ onClick={($e) => { this.handleOutbound(row); }}
+ >鍑虹珯</el-button>
+ <el-button
+ type="success"
+ size="small"
+ style="margin-left: 8px"
+ onClick={($e) => { this.handleUnbind(row); }}
+ >瑙g粦</el-button>
</div>
);
},
});
+ },
+
+ // 鎵樼洏缁勭洏鎿嶄綔
+ handleBind(row) {
+ this.$refs.gridBody.open('bind', row);
},
// 鎵樼洏杩涚珯鎿嶄綔
@@ -120,6 +129,11 @@
}
},
+ // 鎵樼洏鎷嗙洏鎿嶄綔
+ handleUnbind(row) {
+ this.$refs.gridBody.open('unbind', row);
+ },
+
onInited() {
// 妗嗘灦鍒濆鍖栭厤缃悗
},
diff --git a/Code/WMS/WIDESEA_WMSClient/src/extension/system/Mes_Log.jsx b/Code/WMS/WIDESEA_WMSClient/src/extension/system/Mes_Log.jsx
index 560c165..71c12a9 100644
--- a/Code/WMS/WIDESEA_WMSClient/src/extension/system/Mes_Log.jsx
+++ b/Code/WMS/WIDESEA_WMSClient/src/extension/system/Mes_Log.jsx
@@ -48,13 +48,15 @@
this.showJsonDetail(row, 'request');
} else if (column.property === 'responseJson' && row.responseJson) {
this.showJsonDetail(row, 'response');
+ } else if (column.property === 'errorMessage' && row.errorMessage) {
+ this.showJsonDetail(row, 'errorMessage');
}
},
// 鏄剧ず JSON 璇︽儏鎶藉眽
showJsonDetail(row, type = 'request') {
- const jsonContent = type === 'request' ? row.requestJson : row.responseJson;
- const title = type === 'request' ? '馃搵 璇锋眰 JSON' : '馃摜 鍝嶅簲 JSON';
+ const jsonContent = type === 'request' ? row.requestJson : type === 'response' ? row.responseJson : row.errorMessage;
+ const title = type === 'request' ? '馃搵 璇锋眰 JSON' : type === 'response' ? '馃搵 璇锋眰 JSON': '馃摜 閿欒娑堟伅';
// 瑙f瀽 JSON 瀵硅薄锛岃В鏋愬け璐ュ垯淇濈暀鍘熷瀛楃涓�
let jsonData;
diff --git a/Code/WMS/WIDESEA_WMSClient/src/views/system/Mes_Log.vue b/Code/WMS/WIDESEA_WMSClient/src/views/system/Mes_Log.vue
index f74319b..bddd800 100644
--- a/Code/WMS/WIDESEA_WMSClient/src/views/system/Mes_Log.vue
+++ b/Code/WMS/WIDESEA_WMSClient/src/views/system/Mes_Log.vue
@@ -81,7 +81,19 @@
return `<span style="color: #409EFF; cursor: pointer;">${preview}</span>`;
}
},
- { field: "errorMessage", title: "閿欒淇℃伅", width: 250 },
+ {
+ field: "errorMessage",
+ title: "閿欒淇℃伅",
+ width: 250,
+
+ formatter: (row) => {
+ if (!row.responseJson) return '-';
+ const preview = row.responseJson.length > 50
+ ? row.responseJson.substring(0, 50) + '...'
+ : row.responseJson;
+ return `<span style="color: #409EFF; cursor: pointer;">${preview}</span>`;
+ }
+ },
{ field: "elapsedMs", title: "鑰楁椂(ms)", width: 100, sortable: true },
{ field: "createDate", title: "璋冪敤鏃堕棿", width: 160, sortable: true },
{ field: "creator", title: "鎿嶄綔浜�", width: 100 }
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/MesService.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/MesService.cs
index 8f1d43f..6092fa3 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/MesService.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/MesService.cs
@@ -43,7 +43,7 @@
};
}
- private HttpRequestConfig BuildConfig(string token)
+ public HttpRequestConfig BuildConfig(string token)
{
return new HttpRequestConfig
{
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/ApiAuthorizeFilter.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/ApiAuthorizeFilter.cs
index dc951cf..f7c4618 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/ApiAuthorizeFilter.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/ApiAuthorizeFilter.cs
@@ -84,7 +84,7 @@
int ExpMinutes = AppSettings.Get("ExpMinutes").ObjToInt();
if ((expDate.GetValueOrDefault() - DateTime.Now).TotalMinutes < ExpMinutes / 3 && context.HttpContext.Request.Path != ReplaceTokenPath)
{
- context.HttpContext.Response.Headers.Add("widesea_exp", "1");
+ context.HttpContext.Response.Headers.Append("widesea_exp", "1");
}
}
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/HttpRequestMiddleware.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/HttpRequestMiddleware.cs
index deb4a6d..a4e86d0 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/HttpRequestMiddleware.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/HttpRequestMiddleware.cs
@@ -18,7 +18,7 @@
public async Task InvokeAsync(HttpContext context)
{
- context.Response.Headers.Add("Access-Control-Expose-Headers", "widesea_exp");
+ context.Response.Headers.Append("Access-Control-Expose-Headers", "widesea_exp");
await _next(context);
}
}
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/BindContainerRequestDto.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/BindContainerRequestDto.cs
index 2e9d728..8d70be1 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/BindContainerRequestDto.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/BindContainerRequestDto.cs
@@ -18,6 +18,11 @@
public List<string> SfcList { get; set; }
/// <summary>
+ /// 璁惧鍚嶇О
+ /// </summary>
+ public string DeviceName { get; set; }
+
+ /// <summary>
/// 浣嶇疆淇℃伅
/// </summary>
public string Location { get; set; }
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/UnbindContainerRequestDto.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/UnbindContainerRequestDto.cs
index f994036..9812d84 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/UnbindContainerRequestDto.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/UnbindContainerRequestDto.cs
@@ -13,6 +13,11 @@
public string PalletCode { get; set; }
/// <summary>
+ /// 璁惧鍚嶇О
+ /// </summary>
+ public string DeviceName { get; set; }
+
+ /// <summary>
/// 鐢佃姱鐮佸垪琛�
/// </summary>
public List<string> SfcList { get; set; }
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/IMesService.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/IMesService.cs
index 3118962..a7a40b0 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/IMesService.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/IMesService.cs
@@ -53,5 +53,12 @@
/// 鎵樼洏鍑虹珯锛堟敮鎸佸姩鎬乀oken锛�
/// </summary>
HttpResponseResult<MesResponse> OutboundInContainer(OutboundInContainerRequest request, string token);
+
+ /// <summary>
+ /// 璇锋眰澶撮厤缃�
+ /// </summary>
+ /// <param name="token"> 璇锋眰Token</param>
+ /// <returns></returns>
+ HttpRequestConfig BuildConfig(string token);
}
}
\ No newline at end of file
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/IMesUploadHelper.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/IMesUploadHelper.cs
index 705c340..1f9aac5 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/IMesUploadHelper.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/IMesUploadHelper.cs
@@ -22,7 +22,7 @@
MesUploadStatusEnum successStatus,
string apiType,
string requestJson,
- Func<(bool isSuccess, string responseJson, string errorMessage)> mesCall,
+ Func<(bool isSuccess, string responseJson, string errorMessage, string httpRequest)> mesCall,
string creator = "System");
}
}
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/MesUploadHelper.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/MesUploadHelper.cs
index 52672b6..6ef6023 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/MesUploadHelper.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/MesUploadHelper.cs
@@ -1,9 +1,10 @@
+using Newtonsoft.Json.Linq;
using System.Diagnostics;
using WIDESEA_Common.StockEnum;
using WIDESEA_Core;
using WIDESEA_DTO.MES;
-using WIDESEA_IStockService;
using WIDESEA_IBasicService;
+using WIDESEA_IStockService;
namespace WIDESEA_StockService
{
@@ -34,7 +35,7 @@
MesUploadStatusEnum successStatus,
string apiType,
string requestJson,
- Func<(bool isSuccess, string responseJson, string errorMessage)> mesCall,
+ Func<(bool isSuccess, string responseJson, string errorMessage, string httpRequest)> mesCall,
string creator = "System")
{
_ = Task.Run(async () =>
@@ -42,12 +43,14 @@
var stopwatch = Stopwatch.StartNew();
try
{
- var (isSuccess, responseJson, errorMessage) = mesCall();
+ var (isSuccess, responseJson, errorMessage, httpRequest) = mesCall();
stopwatch.Stop();
// 濂囨暟=鎴愬姛锛屽伓鏁�=澶辫触
int status = isSuccess ? (int)successStatus : (int)successStatus + 1;
await _stockInfoService.UpdateMesUploadStatusAsync(palletCode, status);
+
+ requestJson = MergeJsonObjects(requestJson, httpRequest);
await LogAsync(palletCode, apiType, requestJson, responseJson,
stopwatch.ElapsedMilliseconds, isSuccess, errorMessage, creator);
@@ -89,5 +92,16 @@
// 鏃ュ織璁板綍澶辫触涓嶅奖鍝嶄富娴佺▼
}
}
+
+ public static string MergeJsonObjects(string json1, string json2)
+ {
+ var obj1 = JObject.Parse(json1);
+ var obj2 = JObject.Parse(json2);
+ obj1.Merge(obj2, new JsonMergeSettings
+ {
+ MergeArrayHandling = MergeArrayHandling.Union // 鏁扮粍鍚堝苟鏂瑰紡锛屽彲鎸夐渶淇敼
+ });
+ return obj1.ToString();
+ }
}
}
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockSerivce.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockSerivce.cs
index 1e37368..4e7212c 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockSerivce.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockSerivce.cs
@@ -463,7 +463,8 @@
return (
result?.Data?.IsSuccess ?? false,
System.Text.Json.JsonSerializer.Serialize(result),
- result?.Data?.Msg ?? result?.ErrorMessage ?? "鏈煡閿欒"
+ result?.Data?.Msg ?? result?.ErrorMessage ?? "鏈煡閿欒",
+ _mesService.BuildConfig(token ?? string.Empty).ToJson()
);
});
@@ -548,7 +549,8 @@
return (
result?.Data?.IsSuccess ?? false,
System.Text.Json.JsonSerializer.Serialize(result),
- result?.Data?.Msg ?? result?.ErrorMessage ?? "鏈煡閿欒"
+ result?.Data?.Msg ?? result?.ErrorMessage ?? "鏈煡閿欒",
+ _mesService.BuildConfig(token ?? string.Empty).ToJson()
);
});
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Inbound.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Inbound.cs
index 1a731c9..4cbd519 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Inbound.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Inbound.cs
@@ -206,7 +206,8 @@
return (
result?.Data?.IsSuccess ?? false,
JsonConvert.SerializeObject(result),
- result?.Data?.Msg ?? result?.ErrorMessage ?? "鏈煡閿欒"
+ result?.Data?.Msg ?? result?.ErrorMessage ?? "鏈煡閿欒",
+ _mesService.BuildConfig(token ?? string.Empty).ToJson()
);
});
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Outbound.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Outbound.cs
index 3f0f31d..ead9c74 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Outbound.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Outbound.cs
@@ -153,7 +153,8 @@
return (
result?.Data?.IsSuccess ?? false,
Newtonsoft.Json.JsonConvert.SerializeObject(result),
- result?.Data?.Msg ?? result?.ErrorMessage ?? "鏈煡閿欒"
+ result?.Data?.Msg ?? result?.ErrorMessage ?? "鏈煡閿欒",
+ _mesService.BuildConfig(token ?? string.Empty).ToJson()
);
});
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoController.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoController.cs
index c04b982..3c66a24 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoController.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoController.cs
@@ -11,6 +11,7 @@
using WIDESEA_Model.Models;
using WIDESEA_Common.Constants;
using WIDESEA_Common.StockEnum;
+using WIDESEA_Core.Helper;
namespace WIDESEA_WMSServer.Controllers.Stock
{
@@ -113,9 +114,10 @@
? _mesService.InboundInContainer(mesRequest)
: _mesService.InboundInContainer(mesRequest, token);
return (
- result?.IsSuccess ?? false,
+ result.Data?.IsSuccess ?? false,
System.Text.Json.JsonSerializer.Serialize(result),
- result?.ErrorMessage ?? "鏈煡閿欒"
+ result?.Data?.Msg ?? result?.ErrorMessage ?? "鏈煡閿欒",
+ _mesService.BuildConfig(token ?? string.Empty).ToJson()
);
},
App.User.UserName);
@@ -203,9 +205,10 @@
? _mesService.OutboundInContainer(mesRequest)
: _mesService.OutboundInContainer(mesRequest, token);
return (
- result?.IsSuccess ?? false,
+ result?.Data?.IsSuccess ?? false,
System.Text.Json.JsonSerializer.Serialize(result),
- result?.ErrorMessage ?? "鏈煡閿欒"
+ result?.Data?.Msg ?? result?.ErrorMessage ?? "鏈煡閿欒",
+ _mesService.BuildConfig(token ?? string.Empty).ToJson()
);
},
App.User.UserName);
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoDetailController.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoDetailController.cs
index 1b3f335..a3cf0df 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoDetailController.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoDetailController.cs
@@ -1,14 +1,14 @@
-锘縰sing Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Mvc;
-using WIDESEA_Core;
-using WIDESEA_Core.BaseController;
-using WIDESEA_DTO.MES;
-using WIDESEA_IStockService;
-using WIDESEA_IBasicService;
-using WIDESEA_ISystemService;
-using WIDESEA_Model.Models;
+锘縰sing Microsoft.AspNetCore.Mvc;
using WIDESEA_Common.Constants;
using WIDESEA_Common.StockEnum;
+using WIDESEA_Core;
+using WIDESEA_Core.BaseController;
+using WIDESEA_Core.Helper;
+using WIDESEA_DTO.MES;
+using WIDESEA_IBasicService;
+using WIDESEA_IStockService;
+using WIDESEA_ISystemService;
+using WIDESEA_Model.Models;
namespace WIDESEA_WMSServer.Controllers.Stock
{
@@ -52,22 +52,22 @@
try
{
- // 1. 鍙傛暟楠岃瘉
- if (dto.SfcList == null || !dto.SfcList.Any())
- {
- return response.Error("鐢佃姱鐮佸垪琛ㄤ笉鑳戒负绌�");
- }
+ //// 1. 鍙傛暟楠岃瘉
+ //if (dto.SfcList == null || !dto.SfcList.Any())
+ //{
+ // return response.Error("鐢佃姱鐮佸垪琛ㄤ笉鑳戒负绌�");
+ //}
// 2. 楠岃瘉鐢佃姱鐘舵�侊紙闈�'宸查攣瀹�'鐘舵�佸厑璁哥粦瀹氾級
- var stockDetail = await Service.Repository.QueryFirstAsync(x => dto.SfcList.Contains(x.SerialNumber));
- if (stockDetail != null && stockDetail.Status == 99)
- {
- return response.Error("褰撳墠搴撳瓨鏄庣粏鍖呭惈宸查攣瀹氱姸鎬侊紝涓嶅厑璁告墽琛岀粦瀹氭搷浣�");
- }
- var stockInfo = await _stockInfoService.Repository.QueryFirstAsync(x => stockDetail.StockId == x.Id);
+ //var stockDetail = await Service.Repository.QueryFirstAsync(x => dto.SfcList.Contains(x.SerialNumber));
+ //if (stockDetail != null && stockDetail.Status == 99)
+ //{
+ // return response.Error("褰撳墠搴撳瓨鏄庣粏鍖呭惈宸查攣瀹氱姸鎬侊紝涓嶅厑璁告墽琛岀粦瀹氭搷浣�");
+ //}
+ var stockInfo = await _stockInfoService.Repository.QueryDataNavFirstAsync(x => x.PalletCode == dto.PalletCode);
// 3. 鍔ㄦ�佽幏鍙朚ES鍑瘉
- var mesConfig = _mesDeviceConfigService.GetByDeviceName("缁勭洏鏈烘鎵�");
+ var mesConfig = _mesDeviceConfigService.GetByDeviceName(dto.DeviceName);
string equipmentCode = mesConfig?.EquipmentCode ?? StockConstants.MES_EQUIPMENT_CODE;
string resourceCode = mesConfig?.ResourceCode ?? StockConstants.MES_RESOURCE_CODE;
string token = mesConfig?.Token;
@@ -79,10 +79,10 @@
ResourceCode = resourceCode,
LocalTime = DateTime.Now,
ContainerCode = stockInfo.PalletCode,
- ContainerSfcList = dto.SfcList.Select(sfc => new ContainerSfcItem
+ ContainerSfcList = stockInfo.Details.Select(sfc => new ContainerSfcItem
{
- Sfc = sfc,
- Location = dto.Location ?? ""
+ Sfc = sfc.SerialNumber,
+ Location = sfc.InboundOrderRowNo.ToString() ?? ""
}).ToList(),
OperationType = dto.OperationType
};
@@ -101,9 +101,10 @@
? _mesService.BindContainer(mesRequest)
: _mesService.BindContainer(mesRequest, token);
return (
- result?.IsSuccess ?? false,
+ result?.Data?.IsSuccess ?? false,
System.Text.Json.JsonSerializer.Serialize(result),
- result?.ErrorMessage ?? "鏈煡閿欒"
+ result?.Data?.Msg ?? result?.ErrorMessage ?? "鏈煡閿欒",
+ _mesService.BuildConfig(token ?? string.Empty).ToJson()
);
},
App.User.UserName);
@@ -130,21 +131,21 @@
try
{
// 1. 鍙傛暟楠岃瘉
- if (dto.SfcList == null || !dto.SfcList.Any())
- {
- return response.Error("鐢佃姱鐮佸垪琛ㄤ笉鑳戒负绌�");
- }
+ //if (dto.SfcList == null || !dto.SfcList.Any())
+ //{
+ // return response.Error("鐢佃姱鐮佸垪琛ㄤ笉鑳戒负绌�");
+ //}
- // 2. 楠岃瘉鐢佃姱鐘舵�侊紙闈�'宸查攣瀹�'鐘舵�佸厑璁歌В缁戯級
- var stockDetail = await Service.Repository.QueryFirstAsync(x => dto.SfcList.Contains(x.SerialNumber));
- if (stockDetail != null && stockDetail.Status == 99)
- {
- return response.Error("褰撳墠搴撳瓨鏄庣粏鍖呭惈宸查攣瀹氱姸鎬侊紝涓嶅厑璁告墽琛岃В缁戞搷浣�");
- }
- var stockInfo = await _stockInfoService.Repository.QueryFirstAsync(x => stockDetail.StockId == x.Id);
+ //// 2. 楠岃瘉鐢佃姱鐘舵�侊紙闈�'宸查攣瀹�'鐘舵�佸厑璁歌В缁戯級
+ //var stockDetail = await Service.Repository.QueryFirstAsync(x => dto.SfcList.Contains(x.SerialNumber));
+ //if (stockDetail != null && stockDetail.Status == 99)
+ //{
+ // return response.Error("褰撳墠搴撳瓨鏄庣粏鍖呭惈宸查攣瀹氱姸鎬侊紝涓嶅厑璁告墽琛岃В缁戞搷浣�");
+ //}
+ var stockInfo = await _stockInfoService.Repository.QueryDataNavFirstAsync(x => dto.PalletCode == x.PalletCode);
// 3. 鍔ㄦ�佽幏鍙朚ES鍑瘉
- var mesConfig = _mesDeviceConfigService.GetByDeviceName("缁勭洏鏈烘鎵�");
+ var mesConfig = _mesDeviceConfigService.GetByDeviceName(dto.DeviceName);
string equipmentCode = mesConfig?.EquipmentCode ?? StockConstants.MES_EQUIPMENT_CODE;
string resourceCode = mesConfig?.ResourceCode ?? StockConstants.MES_RESOURCE_CODE;
string token = mesConfig?.Token;
@@ -156,7 +157,7 @@
ResourceCode = resourceCode,
LocalTime = DateTime.Now,
ContainCode = stockInfo.PalletCode,
- SfcList = dto.SfcList
+ SfcList = stockInfo.Details.Select(x => x.SerialNumber).ToList(),
};
string requestJson = System.Text.Json.JsonSerializer.Serialize(mesRequest);
@@ -173,9 +174,10 @@
? _mesService.UnBindContainer(mesRequest)
: _mesService.UnBindContainer(mesRequest, token);
return (
- result?.IsSuccess ?? false,
+ result?.Data?.IsSuccess ?? false,
System.Text.Json.JsonSerializer.Serialize(result),
- result?.ErrorMessage ?? "鏈煡閿欒"
+ result?.Data?.Msg ?? result?.ErrorMessage ?? "鏈煡閿欒",
+ _mesService.BuildConfig(token ?? string.Empty).ToJson()
);
},
App.User.UserName);
@@ -254,9 +256,10 @@
{
var result = _mesService.ContainerNgReport(mesRequest);
return (
- result?.IsSuccess ?? false,
+ result?.Data?.IsSuccess ?? false,
System.Text.Json.JsonSerializer.Serialize(result),
- result?.ErrorMessage ?? "鏈煡閿欒"
+ result?.Data?.Msg ?? result?.ErrorMessage ?? "鏈煡閿欒",
+ _mesService.BuildConfig(mesConfig?.Token ?? string.Empty).ToJson()
);
},
App.User.UserName);
@@ -315,4 +318,4 @@
return defaultValue;
}
}
-}
+}
\ No newline at end of file
--
Gitblit v1.9.3