From 2929a5bd618ed09a11ee88309da5b9af9d2011c0 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期五, 10 一月 2025 20:53:54 +0800
Subject: [PATCH] 辅料仓逻辑优化
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 46 +++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 41 insertions(+), 5 deletions(-)
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 833dff5..50fb3c7 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"
@@ -170,7 +170,7 @@
Dt_StationManger stationManger;
if (taskTypeGroup == TaskTypeGroup.InboundGroup)
{
- stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == item.SourceAddress);
+ stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == item.SourceAddress || x.StationDeviceCode == item.SourceAddress);
}
else
{
@@ -181,7 +181,7 @@
return WebResponseContent.Instance.Error($"鏈壘鍒扮珯鍙伴厤缃俊鎭�");
}
- List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && (item.SourceAddress == x.StartPosi || item.RoadWay == x.StartPosi));
+ List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && (item.SourceAddress == x.StartPosi || item.RoadWay == x.StartPosi || item.RoadWay == x.ChildPosiDeviceCode || item.RoadWay == x.ChildPosi));
router = routers.FirstOrDefault();
if (router == null)
{
@@ -194,6 +194,11 @@
{
task.NextAddress = router.NextPosi;
task.DeviceCode = stationManger.StationDeviceCode;
+ }
+ else if (item.TaskType == TaskTypeEnum.MesOutbound.ObjToInt())
+ {
+ task.NextAddress = router.NextPosi;
+ task.DeviceCode = stationManger.StackerCraneCode;
}
else
{
@@ -284,8 +289,12 @@
{
return WebResponseContent.Instance.Error($"鏈壘鍒扮珯鍙颁俊鎭�");
}
-
- string responseStr = HttpHelper.Get($"http://127.0.0.1:9293/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={stationManger.StackerCraneCode}&palletCode={palletCode}");
+ string address = AppSettings.Get("WMSApiAddress");
+ if (string.IsNullOrEmpty(address))
+ {
+ return WebResponseContent.Instance.Error($"鏈壘鍒癢MSApi鍦板潃");
+ }
+ string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={stationManger.StackerCraneCode}&palletCode={palletCode}");
WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr);
if (responseContent != null && responseContent.Status && responseContent.Data != null)
{
@@ -304,6 +313,31 @@
return content;
}
+ public WebResponseContent RequestWMSAssignRoadway(int taskNum, List<string> roadwayNos)
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ string address = AppSettings.Get("WMSApiAddress");
+ if (string.IsNullOrEmpty(address))
+ {
+ return WebResponseContent.Instance.Error($"鏈壘鍒癢MSApi鍦板潃");
+ }
+ string responseStr = HttpHelper.Post($"{address}/api/Task/AssignRoadway?taskNum={taskNum}", roadwayNos.Serialize());
+ WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr);
+ if (responseContent != null && responseContent.Status && responseContent.Data != null)
+ {
+ return responseContent;
+ }
+
+ }
+ catch (Exception ex)
+ {
+ content = WebResponseContent.Instance.Error(ex.Message);
+ }
+ return content;
+ }
+
/// <summary>
/// 鍚慦MS鐢宠鍒嗛厤璐т綅
/// </summary>
@@ -312,7 +346,9 @@
/// <returns></returns>
public string? RequestAssignLocation(int taskNum, string roadwayNo)
{
- string responseStr = HttpHelper.Get($"http://127.0.0.1:9283/api/Task/AssignInboundTaskLocation?taskNum={taskNum}&roadwayNo={roadwayNo}");
+ string address = AppSettings.Get("WMSApiAddress");
+ if (string.IsNullOrEmpty(address)) throw new Exception("鏈壘鍒癢MSApi鍦板潃");
+ string responseStr = HttpHelper.Get($"{address}/api/Task/AssignInboundTaskLocation?taskNum={taskNum}&roadwayNo={roadwayNo}");
WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr);
if (responseContent != null && responseContent.Status && responseContent.Data != null)
--
Gitblit v1.9.3