From 713f0b7f34ddb2c412d97ed96b8fd4934e08ada6 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期四, 05 三月 2026 15:38:38 +0800
Subject: [PATCH] 添加WMS容器流动接口、质检结果反馈接口;添加四向车站点容器上架/释放接口
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TestJob.cs | 16 ++++----
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs | 7 ---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 88 +++++++++++++++++++++++++++++++------------
3 files changed, 71 insertions(+), 40 deletions(-)
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 89a87b4..328d00b 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"
@@ -229,13 +229,6 @@
WebResponseContent ModifyWMSLayoutZone(WMSUpdateLocationArea wMSUpdateLocationArea);
/// <summary>
- /// 瀹瑰櫒娴佸姩璇锋眰
- /// </summary>
- /// <param name="wMSContainerFlow"></param>
- /// <returns></returns>
- WebResponseContent ContainerFlow(WMSContainerFlow wMSContainerFlow);
-
- /// <summary>
/// 鍖哄煙搴撲綅淇℃伅鏌ヨ
/// </summary>
/// <param name="AreaCode">鍖哄煙鍙�</param>
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 8fc1547..a16c631 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"
@@ -22,6 +22,7 @@
using System.Threading.Tasks;
using WIDESEAWCS_BasicInfoService;
using WIDESEAWCS_Common;
+using WIDESEAWCS_Common.LocationEnum;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseRepository;
@@ -70,7 +71,7 @@
/// </summary>
public IRepository<Dt_Task> Repository => BaseDal;
- public TaskService(IRepository<Dt_Task> BaseDal, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, IRepository<Dt_TaskExecuteDetail> taskExecuteDetailRepository, IMapper mapper, IKLSLocationInfoService kLSLocationInfoService, IRGVLocationInfoService rGVLocationInfoService, IHKLocationInfoService hKLocationInfoService, IApiInfoService apiInfoService,ITrackloginfoService trackloginfoService) : base(BaseDal)
+ public TaskService(IRepository<Dt_Task> BaseDal, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, IRepository<Dt_TaskExecuteDetail> taskExecuteDetailRepository, IMapper mapper, IKLSLocationInfoService kLSLocationInfoService, IRGVLocationInfoService rGVLocationInfoService, IHKLocationInfoService hKLocationInfoService, IApiInfoService apiInfoService, ITrackloginfoService trackloginfoService) : base(BaseDal)
{
_routerService = routerService;
_taskExecuteDetailService = taskExecuteDetailService;
@@ -229,7 +230,7 @@
{
Dt_Task dt_Task = BaseDal.QueryFirst(x => x.WMSTaskNum == updateTaskPriority.taskCode);
if (dt_Task == null) throw new Exception("鏈煡璇㈠埌浠诲姟鍙风浉鍏充换鍔�");
-
+
// 鍒ゆ柇褰撳墠浠诲姟鏄惁涓哄嚡涔愬+浠诲姟
bool isGALAXISTask = dt_Task.TaskType == (int)TaskTypeEnum.MLInbound ||
dt_Task.TaskType == (int)TaskTypeEnum.MLOutbound;
@@ -261,7 +262,8 @@
BaseDal.UpdateData(dt_Task);
return content.OK("淇敼浠诲姟浼樺厛绾ф垚鍔�", dt_Task);
}
- else {
+ else
+ {
return content.Error($"浠诲姟澶辫触{agvContent.data.returnInfo}");
}
}
@@ -279,7 +281,7 @@
if (apiInfo == null) throw new Exception("鏈壘鍒板洓鍚戣溅AGV浠诲姟涓嬪彂鎺ュ彛閰嶇疆淇℃伅锛佽妫�鏌ユ帴鍙i厤缃�");
string response = HttpHelper.Post(apiInfo.ApiAddress, request.Serialize());
FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
- if (fOURBOTReturn.returnCode == 0 && fOURBOTReturn .returnUserMsg== "鎴愬姛")
+ if (fOURBOTReturn.returnCode == 0 && fOURBOTReturn.returnUserMsg == "鎴愬姛")
{
return content.OK("淇敼浠诲姟浼樺厛绾ф垚鍔�", dt_Task);
@@ -309,11 +311,11 @@
try
{
var rgv = new List<Dt_RGVLocationInfo>();
- var kls=new List<Dt_KLSLocationInfo>();
- var hk=new List<Dt_HKLocationInfo>();
- if(wMSUpdateLocationArea.WarehouseId == 1)
+ var kls = new List<Dt_KLSLocationInfo>();
+ var hk = new List<Dt_HKLocationInfo>();
+ if (wMSUpdateLocationArea.WarehouseId == 1)
{
- var rgvList = _rGVLocationInfoService.Repository.QueryData(x =>wMSUpdateLocationArea.LocationCodes.Contains(x.LocationCode)).ToList();
+ var rgvList = _rGVLocationInfoService.Repository.QueryData(x => wMSUpdateLocationArea.LocationCodes.Contains(x.LocationCode)).ToList();
foreach (var item in rgvList)
{
item.WarehouseId = wMSUpdateLocationArea.UpdateAreaCode.ObjToInt();
@@ -355,7 +357,7 @@
private void UpdateLocationCode(object LocationInfo, string updateAreaCode)
{
-
+
}
@@ -898,18 +900,6 @@
}
/// <summary>
- /// 瀹瑰櫒娴佸姩璇锋眰
- /// </summary>
- /// <param name="wMSContainerFlow"></param>
- /// <returns></returns>
- /// <exception cref="NotImplementedException"></exception>
- public WebResponseContent ContainerFlow(WMSContainerFlow wMSContainerFlow)
- {
- return WebResponseContent.Instance.Error("璇ユ帴鍙f殏鏈疄鐜�");
- }
-
-
- /// <summary>
/// 鍖哄煙搴撲綅淇℃伅鏌ヨ
/// </summary>
/// <param name="AreaCode"></param>
@@ -966,15 +956,63 @@
{
throw new NotImplementedException();
}
-
+ /// <summary>
+ /// 瀹瑰櫒娴佸姩璇锋眰
+ /// </summary>
+ /// <param name="wMSContainerFlow"></param>
+ /// <returns></returns>
+ /// <exception cref="NotImplementedException"></exception>
public WebResponseContent ContainerRequest(WMSContainerFlow wMSContainerFlow)
{
- throw new NotImplementedException();
+ try
+ {
+ Dt_StationManger stationManger = _stationMangerService.Repository.QueryFirst(x => x.StationCode == wMSContainerFlow.slotCode) ?? throw new Exception($"鏈壘鍒扮珯鍙般�恵wMSContainerFlow.slotCode}銆戜俊鎭�");
+ Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == "releaseStation") ?? throw new Exception("鏈壘鍒扮珯鐐瑰鍣ㄩ噴鏀炬帴鍙i厤缃俊鎭紒璇锋鏌ユ帴鍙i厤缃�");
+ if (wMSContainerFlow.direction == "200")
+ {
+ stationManger.IsOccupied = LocationStatusEnum.Free.ObjToInt();
+ FOURBOToccupyStation fOURBOToccupyStation = new FOURBOToccupyStation()
+ {
+ stationCode = wMSContainerFlow.slotCode,
+ };
+ string response = HttpHelper.Post(apiInfo.ApiAddress, fOURBOToccupyStation.Serialize());
+ FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
+ if (fOURBOTReturn.returnCode != 0) throw new Exception(fOURBOTReturn.returnUserMsg);
+ _stationMangerService.UpdateData(stationManger);
+ }
+ return WebResponseContent.Instance.OK();
+ }
+ catch (Exception ex)
+ {
+ return WebResponseContent.Instance.Error(ex.Message);
+ }
}
-
+ /// <summary>
+ /// 璐ㄦ缁撴灉鍙嶉
+ /// </summary>
+ /// <param name="iQC"></param>
+ /// <returns></returns>
+ /// <exception cref="NotImplementedException"></exception>
public WebResponseContent IQCResult(IQCResultDTO iQC)
{
- throw new NotImplementedException();
+ try
+ {
+ Dt_StationManger stationManger = _stationMangerService.Repository.QueryFirst(x => x.StationCode == iQC.StationCode) ?? throw new Exception($"鏈壘鍒扮珯鍙般�恵iQC.StationCode}銆戜俊鎭�");
+ Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(FOURBOToccupyStation)) ?? throw new Exception("鏈壘鍒扮珯鐐瑰鍣ㄤ笂鏋舵帴鍙i厤缃俊鎭紒璇锋鏌ユ帴鍙i厤缃�");
+ FOURBOToccupyStation fOURBOToccupyStation = new FOURBOToccupyStation()
+ {
+ stationCode = iQC.StationCode,
+ podID = iQC.ContainerCode,
+ };
+ string response = HttpHelper.Post(apiInfo.ApiAddress, fOURBOToccupyStation.Serialize());
+ FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
+ if (fOURBOTReturn.returnCode != 0) throw new Exception(fOURBOTReturn.returnUserMsg);
+ return WebResponseContent.Instance.OK();
+ }
+ catch (Exception ex)
+ {
+ return WebResponseContent.Instance.Error(ex.Message);
+ }
}
}
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TestJob.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TestJob.cs"
index 8407636..e89ac29 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TestJob.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TestJob.cs"
@@ -57,7 +57,7 @@
//device.SetValue(QualityInspectionCommandEnum.StartqualityInspection,true,task.SourceAddress);
//濡傛灉鏈夎揣鐨勮瘽锛屾墠杩涜璐ㄦ锛屾妸绔欏彴鐘舵�佽涓哄崰鐢�
var R_StockAvailableSymbol = device.GetValue<QualityInspectionCommandEnum, bool>(QualityInspectionCommandEnum.R_StockAvailableSymbol, task.SourceAddress);
- if (R_StockAvailableSymbol==true)
+ if (R_StockAvailableSymbol == true)
{
//stationMangers.IsOccupied=1;//鏀逛负鍗犵敤
//寮�鍚川妫�
@@ -70,9 +70,9 @@
//鍐嶈鍙栬川妫�缁撴灉
var qualityResult = device.GetValue<QualityInspectionCommandEnum, bool>(QualityInspectionCommandEnum.R_QualityInspectionInProgress, task.SourceAddress);
//宸﹁秴瀹借鍛�
- var R_LeftOverWidthWarning = device.GetValue<QualityInspectionCommandEnum, bool>(QualityInspectionCommandEnum.R_LeftOverWidthWarning, task.SourceAddress);
+ var R_LeftOverWidthWarning = device.GetValue<QualityInspectionCommandEnum, bool>(QualityInspectionCommandEnum.R_LeftOverWidthWarning, task.SourceAddress);
//鍙宠秴瀹借鍛�
- var R_RightWideWarning=device.GetValue<QualityInspectionCommandEnum, bool>(QualityInspectionCommandEnum.R_RightWideWarning, task.SourceAddress);
+ var R_RightWideWarning = device.GetValue<QualityInspectionCommandEnum, bool>(QualityInspectionCommandEnum.R_RightWideWarning, task.SourceAddress);
//瓒呴珮璀﹀憡
var R_ExtremeWarning = device.GetValue<QualityInspectionCommandEnum, bool>(QualityInspectionCommandEnum.R_ExtremeWarning, task.SourceAddress);
if (qualityResult)
@@ -80,20 +80,20 @@
//濡傛灉璐ㄦ閫氳繃浜嗭紝灏辨妸浠诲姟鐘舵�佹敼涓鸿川妫�瀹屾垚
task.TaskState = TaskStatusEnum.CheckShapeingOk.ObjToInt();
}
- else if(R_LeftOverWidthWarning)
+ else if (R_LeftOverWidthWarning)
{
- task.ExceptionMessage= "璐ㄦ澶辫触锛屽乏瓒呭";
+ task.ExceptionMessage += "璐ㄦ澶辫触锛屽乏瓒呭";
task.TaskState = TaskStatusEnum.CheckShapeingNG.ObjToInt();
}
else if (R_RightWideWarning)
{
- task.ExceptionMessage = "璐ㄦ澶辫触锛屽彸瓒呭";
+ task.ExceptionMessage += "璐ㄦ澶辫触锛屽彸瓒呭";
}
else if (R_ExtremeWarning)
{
- task.ExceptionMessage = "璐ㄦ澶辫触,瓒呴珮";
+ task.ExceptionMessage += "璐ㄦ澶辫触,瓒呴珮";
}
- else if (qualityResult==false) //濡傛灉璐ㄦ澶辫触锛屽氨澶嶄綅
+ else if (qualityResult == false) //濡傛灉璐ㄦ澶辫触锛屽氨澶嶄綅
{
//鍐欏叆澶嶄綅淇″彿
device.SetValue(QualityInspectionCommandEnum.FaultReset, true, task.SourceAddress);
--
Gitblit v1.9.3