From aeb971fe12b73d83d31a83b00f0a6e2876b24a00 Mon Sep 17 00:00:00 2001
From: yanjinhui <3306209981@qq.com>
Date: 星期四, 09 四月 2026 21:21:51 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/RuiShengZhiNeng/GaoPuLiTiKu
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/inboundTransportCheckDTO.cs | 19 ++++
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs | 7 +
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/WMSReturn.cs | 16 +++
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TSJJob.cs | 119 +++++++++++++++++------------
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/inboundElevatorExitDTO.cs | 17 ++++
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 49 +++++++++++
6 files changed, 173 insertions(+), 54 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/WMSReturn.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/WMSReturn.cs"
index 1607927..72ad09a 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/WMSReturn.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/WMSReturn.cs"
@@ -23,11 +23,11 @@
/// <summary>
/// TRUE
/// </summary>
- public string success { get; set; }
+ public bool success { get; set; }
/// <summary>
/// 鎴愬姛
/// </summary>
- public string result { get; set; }
+ public object result { get; set; }
/// <summary>
/// 鏃堕棿鎴�
/// </summary>
@@ -38,4 +38,16 @@
/// </summary>
public object data { get; set; }
}
+
+ public class Exists
+ {
+ /// <summary>
+ /// 鏄惁鍦ㄩ��
+ /// </summary>
+ public bool taskExists { get; set; }
+ /// <summary>
+ /// 寮傚父鍦板潃
+ /// </summary>
+ public string errorAreaCode { get; set; }
+ }
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/inboundElevatorExitDTO.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/inboundElevatorExitDTO.cs"
new file mode 100644
index 0000000..b031c73
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/inboundElevatorExitDTO.cs"
@@ -0,0 +1,17 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEAWCS_DTO.WMS
+{
+ /// <summary>
+ /// 4F鎻愬崌鏈哄嚭鍙f墭鐩樺彿涓婃姤WMS
+ /// </summary>
+ public class inboundElevatorExitDTO
+ {
+ public string containerCode { get; set; }
+ public string toLocationCode { get; set; }
+ }
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/inboundTransportCheckDTO.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/inboundTransportCheckDTO.cs"
new file mode 100644
index 0000000..12f05df
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/inboundTransportCheckDTO.cs"
@@ -0,0 +1,19 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEAWCS_DTO.WMS
+{
+ /// <summary>
+ /// 瑁佺墖鍏ュ簱3F鍒�4F杩愯緭绠卞彿鏍¢獙
+ /// </summary>
+ public class inboundTransportCheckDTO
+ {
+ /// <summary>
+ /// 鎵樼洏鍙�
+ /// </summary>
+ public string containerCode { get; set; }
+ }
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs"
index ff14810..6fe4558 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs"
@@ -270,6 +270,13 @@
/// <returns></returns>
public WebResponseContent MaterialBoxInspection(string taskCode ,string containerCode);
+ /// <summary>
+ /// 4F鎻愬崌鏈哄嚭鍙f墭鐩樺彿涓婃姤WMS
+ /// </summary>
+ /// <param name="LocationCode"></param>
+ /// <param name="containerCode"></param>
+ /// <returns></returns>
+ public WebResponseContent InboundElevatorExit(string LocationCode, string containerCode);
/// <summary>
/// wcs绉诲簱鏁版嵁鍥炰紶
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
index eae3f6f..dcabee7 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
@@ -16,6 +16,7 @@
#endregion << 鐗� 鏈� 娉� 閲� >>
using AutoMapper;
+using Newtonsoft.Json;
using SixLabors.ImageSharp.ColorSpaces;
using SqlSugar;
using System.Collections.Generic;
@@ -1233,7 +1234,28 @@
{
throw new NotImplementedException();
}
-
+ public WebResponseContent InboundElevatorExit(string LocationCode, string containerCode)
+ {
+ WebResponseContent content = new WebResponseContent();
+ inboundElevatorExitDTO inboundElevator=new inboundElevatorExitDTO();
+ try
+ {
+ Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(inboundElevatorExitDTO)) ?? throw new Exception("鏈壘鍒�4F鎻愬崌鏈哄嚭鍙f墭鐩樺彿涓婃姤WMS鎺ュ彛閰嶇疆淇℃伅锛佽妫�鏌ユ帴鍙i厤缃�");
+ inboundElevator.containerCode= containerCode;
+ inboundElevator.toLocationCode = LocationCode;
+ string response = HttpHelper.Post(apiInfo.ApiAddress, inboundElevator.Serialize());
+ content.OK(data: response);
+ return WebResponseContent.Instance.OK();
+ }
+ catch (Exception ex)
+ {
+ return WebResponseContent.Instance.Error(ex.Message);
+ }
+ finally
+ {
+ _trackloginfoService.AddTrackLog(inboundElevator, content, "4F鎻愬崌鏈哄嚭鍙f墭鐩樺彿涓婃姤WMS", "", "");
+ }
+ }
/// <summary>
/// 鏂欑楠岃瘉
/// </summary>
@@ -1242,7 +1264,30 @@
/// <returns></returns>
public WebResponseContent MaterialBoxInspection(string taskCode, string containerCode)
{
- throw new NotImplementedException();
+ WebResponseContent content = new WebResponseContent();
+ inboundTransportCheckDTO checkDTO = new inboundTransportCheckDTO();
+ try
+ {
+ checkDTO.containerCode = containerCode;
+ Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(inboundTransportCheckDTO)) ?? throw new Exception("鏈壘鍒拌鐗囧叆搴�3F鍒�4F杩愯緭绠卞彿鏍¢獙鎺ュ彛閰嶇疆淇℃伅锛佽妫�鏌ユ帴鍙i厤缃�");
+ string response = HttpHelper.Post(apiInfo.ApiAddress, checkDTO.Serialize());
+ content.OK(data: response);
+ WMSReturn wMSReturn = response.DeserializeObject<WMSReturn>();
+ if (wMSReturn == null) throw new Exception("WMS杩斿洖缁撴灉杞崲澶辫触锛�");
+ if (!wMSReturn.success) throw new Exception(wMSReturn.message);
+ string dataJson = wMSReturn.result.ToString();
+ Exists? exists = JsonConvert.DeserializeObject<Exists>(dataJson);
+ if (exists == null) throw new Exception($"WMS杩斿洖缁撴灉鐨剅esult杞崲澶辫触");
+ return WebResponseContent.Instance.OK(exists.errorAreaCode);
+ }
+ catch (Exception ex)
+ {
+ return WebResponseContent.Instance.Error(ex.Message);
+ }
+ finally
+ {
+ _trackloginfoService.AddTrackLog(checkDTO, content, "瑁佺墖鍏ュ簱3F鍒�4F杩愯緭绠卞彿鏍¢獙", "", "");
+ }
}
/// <summary>
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TSJJob.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TSJJob.cs"
index e925bf3..770a40f 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TSJJob.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TSJJob.cs"
@@ -30,7 +30,7 @@
{
[DisallowConcurrentExecution]
public class TSJJob : JobBase, IJob
- {
+ {
private readonly ITaskService _taskService;
private readonly IStationMangerService _stationMangerService;
public TSJJob(ITaskService taskService, IStationMangerService stationMangerService)
@@ -146,7 +146,7 @@
}
continue;
}
-
+
if (device.GetValue<HoistEnum, short>(HoistEnum.ROutScanningCompletionSignal, task.SourceAddress) != 1)
{
if (task.ExceptionMessage != "4妤兼彁鍗囨満鍑哄彛鎵爜瀹屾垚淇″彿娌℃湁瀹屾垚")
@@ -172,60 +172,79 @@
task.ExceptionMessage = "";
Uptasks.Add(task);
}
-
-
}
-
- #region 鎵樼洏鍙风‘璁や腑
- //鏌ユ壘涓夋ゼ鍏ュ簱浠诲姟鐘舵�佷负CheckPalletCodeing鐨勪换鍔℃墭鐩樺彿纭涓�
- var RK3FTasks = _taskService.Repository.QueryFirst(x => x.TaskType == TaskTypeEnum.RK3F.ObjToInt() && x.TaskState == (int)TaskStatusEnum.CheckPalletCodeing);
- if (RK3FTasks != null)
- {
- //妫�鏌�3妤煎叆搴撶鍙锋槸澶氬皯锛岀劧鍚庝紶缁檞ms
- var BinNumber = device.GetValue<HoistEnum, string>(HoistEnum.Inboxnumber, RK3FTasks.TargetAddress);
- BinNumber = BinNumber?.TrimEnd('\0')?.Substring(2);
- if (device.GetValue<HoistEnum, short>(HoistEnum.RInScanningCompletionSignal, RK3FTasks.TargetAddress ) !=1 )
- {
- RK3FTasks.ExceptionMessage = "3妤兼壂鐮佸畬鎴愪俊鍙锋病鏈夊畬鎴�";
- }
- else //瀹屾垚灏辨妸浠诲姟鐘舵�佹敼鎴愭墭鐩樺彿纭瀹屾垚
- {
- //鏍规嵁璇诲埌鐨勭鍙疯繘琛屾枡绠辨楠岋紝妫�楠岄�氳繃灏辫Е鍙戣鐮佸櫒璇诲彇锛屽鏋滀笉閫氳繃灏辨姏鍑哄紓甯�
- //var Verification = _taskService.MaterialBoxInspection(RK3FTasks.WMSTaskNum, BinNumber.ToString());
- //if (!Verification.Status)
- //{
- // if (!(RK3FTasks.ExceptionMessage == Verification.Message))
- // {
- // RK3FTasks.ExceptionMessage = Verification.Message;
- // Uptasks.Add(RK3FTasks);
- // }
- // //鏂欑楠岃瘉鍐欏ソ鍚庯紝闇�瑕佹洿鏀�
- // RK3FTasks.TargetAddress = Verification.Data.ToString();
- //}
-
- //濡傛灉鏂欑妫�楠屾垚鍔熷氨鍐欏叆璇荤爜鍣ㄧ殑鍊�
- var result = _taskService.Hikvisiontaskscontinue(RK3FTasks.WMSTaskNum, RK3FTasks.TargetAddress);
- if (result.Status == false)
- {
- if (RK3FTasks.ExceptionMessage != result.Message)
- {
- RK3FTasks.ExceptionMessage = result.Message;
- Uptasks.Add(RK3FTasks);
- }
- }
- RK3FTasks.ExceptionMessage = "";
- RK3FTasks.TaskState = (int)TaskStatusEnum.CheckPalletCodeFinish;
- }
- Uptasks.Add(RK3FTasks);
- }
- #endregion
if (Uptasks.Count > 0)
{
_taskService.UpdateData(Uptasks);
}
- WriteInfo(device.DeviceName, "infoLog");
- WriteDebug(device.DeviceName, "debugLog");
+ #region 鎵樼洏鍙风‘璁や腑
+ //鏌ユ壘涓夋ゼ鍏ュ簱浠诲姟鐘舵�佷负CheckPalletCodeing鐨勪换鍔℃墭鐩樺彿纭涓�
+ var RK3FTask = _taskService.Repository.QueryFirst(x => x.TaskType == TaskTypeEnum.RK3F.ObjToInt() && x.TaskState == (int)TaskStatusEnum.CheckPalletCodeing);
+ if (RK3FTask != null)
+ {
+ if (device.GetValue<HoistEnum, short>(HoistEnum.RInScanningCompletionSignal, RK3FTask.TargetAddress) != 1)
+ {
+ RK3FTask.ExceptionMessage = "3妤兼壂鐮佸畬鎴愪俊鍙锋病鏈夊畬鎴�";
+ _taskService.UpdateData(RK3FTask);
+ }
+ else //瀹屾垚灏辨妸浠诲姟鐘舵�佹敼鎴愭墭鐩樺彿纭瀹屾垚
+ {
+ //妫�鏌�3妤煎叆搴撶鍙锋槸澶氬皯锛岀劧鍚庝紶缁檞ms
+ var BinNumber = device.GetValue<HoistEnum, string>(HoistEnum.Inboxnumber, RK3FTask.TargetAddress);
+ if (!string.IsNullOrEmpty(BinNumber))
+ {
+ BinNumber = BinNumber.TrimEnd('\0').Substring(2);
+ //鏍规嵁璇诲埌鐨勭鍙疯繘琛屾枡绠辨楠岋紝妫�楠岄�氳繃灏辫Е鍙戣鐮佸櫒璇诲彇锛屽鏋滀笉閫氳繃灏辨姏鍑哄紓甯�
+ var Verification = _taskService.MaterialBoxInspection(RK3FTask.WMSTaskNum, BinNumber);
+ if (!Verification.Status)
+ {
+ if (RK3FTask.ExceptionMessage != Verification.Message)
+ {
+ RK3FTask.ExceptionMessage = Verification.Message;
+ _taskService.UpdateData(RK3FTask);
+ }
+ }
+ else
+ {
+ if (!string.IsNullOrEmpty(Verification.Message)) RK3FTask.TargetAddress = Verification.Message;
+ //濡傛灉鏂欑妫�楠屾垚鍔熷氨鍐欏叆璇荤爜鍣ㄧ殑鍊�
+ var result = _taskService.Hikvisiontaskscontinue(RK3FTask.WMSTaskNum, RK3FTask.TargetAddress);
+ if (result.Status)
+ {
+ RK3FTask.ExceptionMessage = "";
+ RK3FTask.TaskState = (int)TaskStatusEnum.CheckPalletCodeFinish;
+ _taskService.UpdateData(RK3FTask);
+ }
+ else
+ {
+ if (RK3FTask.ExceptionMessage != result.Message)
+ {
+ RK3FTask.ExceptionMessage = result.Message;
+ _taskService.UpdateData(RK3FTask);
+ }
+ }
+ }
+ }
+ }
+ }
+ #endregion
+
+ #region 4F鎻愬崌鏈哄嚭鍙f墭鐩樺彿涓婃姤WMS
+ var Address = "TSJC4F";
+ if (device.GetValue<HoistEnum, short>(HoistEnum.ROutScanningCompletionSignal, Address) == 1)
+ {
+ var BinNumber = device.GetValue<HoistEnum, string>(HoistEnum.Emptycontainernumber, Address);
+ if (!string.IsNullOrEmpty(BinNumber))
+ {
+ BinNumber = BinNumber.TrimEnd('\0').Substring(2);
+ _taskService.InboundElevatorExit(Address, BinNumber);
+ }
+ }
+ #endregion
+ //WriteInfo(device.DeviceName, "infoLog");
+
+ //WriteDebug(device.DeviceName, "debugLog");
}
catch (Exception ex)
{
--
Gitblit v1.9.3