From cdabe47ad8128c5006202e55c29746a617e988d6 Mon Sep 17 00:00:00 2001
From: 肖洋 <cathay_xy@163.com>
Date: 星期日, 22 十二月 2024 15:29:57 +0800
Subject: [PATCH] 添加静置NG入库功能,更新相关接口和配置,优化代码结构
---
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 44 +++++++++++++++++++++++++++++++++++++-------
1 files changed, 37 insertions(+), 7 deletions(-)
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
index 9b1276e..3335a9f 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -90,10 +90,11 @@
task.Creater = "WMS";
if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
{
- if (task.TargetAddress == "002-021-001")
+ if (task.TargetAddress == "002-021-001" && task.Roadway.Contains("JZ") && task.TaskType == (int)TaskOutboundTypeEnum.OutTray)
{
task.TaskState = (int)TaskOutStatusEnum.OutNew;
task.CurrentAddress = item.SourceAddress;
+ task.NextAddress = item.TargetAddress;
}
else
{
@@ -128,6 +129,11 @@
task.NextAddress = routers.FirstOrDefault().ChildPosi;
}
}
+ else
+ {
+ task.CurrentAddress = "002-021-001";
+ task.NextAddress = item.TargetAddress;
+ }
}
tasks.Add(task);
}
@@ -155,20 +161,31 @@
WebResponseContent content = new WebResponseContent();
try
{
+
var hasTask = await BaseDal.QueryFirstAsync(x => x.PalletCode == palletCode);
if (hasTask != null)
{
return content.OK("褰撳墠鎵樼洏瀛樺湪浠诲姟");
}
- var config = _sys_ConfigService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress);
- var wmsBase = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.WMSIP_BASE)?.ConfigValue;
- var requestTask = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.RequestTask)?.ConfigValue;
- if (wmsBase == null || requestTask == null)
+ var wmsIpAddrss = string.Empty;
+ var stationManager = _stationManagerRepository.QueryFirst(x => x.stationChildCode == sourceAddress);
+ if (stationManager.stationType == 5)
{
- throw new InvalidOperationException("WMS IP 鏈厤缃�");
+ wmsIpAddrss = GetIpAddress(SysConfigKeyConst.WMSIP_BASE, SysConfigKeyConst.RequestInBoundTaskNG);
}
- var wmsIpAddrss = wmsBase + requestTask;
+ else
+ {
+ wmsIpAddrss = GetIpAddress(SysConfigKeyConst.WMSIP_BASE, SysConfigKeyConst.RequestTask);
+ }
+ //var config = _sys_ConfigService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress);
+ //var wmsBase = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.WMSIP_BASE)?.ConfigValue;
+ //var requestTask = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.RequestTask)?.ConfigValue;
+ //if (wmsBase == null || requestTask == null)
+ //{
+ // throw new InvalidOperationException("WMS IP 鏈厤缃�");
+ //}
+ //var wmsIpAddrss = wmsBase + requestTask;
var result = await HttpHelper.PostAsync(wmsIpAddrss, new { Position = sourceAddress, PalletCode = palletCode }.ToJsonString());
content = JsonConvert.DeserializeObject<WebResponseContent>(result);
@@ -824,5 +841,18 @@
{
return BaseDal.QueryFirst(x => x.PalletCode == barcode && x.NextAddress == nextAddress && (x.TaskState == (int)TaskInStatusEnum.Line_InExecuting || x.TaskState == (int)TaskOutStatusEnum.Line_OutExecuting), TaskOrderBy);
}
+
+
+ private string GetIpAddress(string baseIp,string name)
+ {
+ var configz = _sys_ConfigService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress);
+ var wcsBasez = configz.Where(x => x.ConfigKey == baseIp).FirstOrDefault()?.ConfigValue;
+ var address = configz.Where(x => x.ConfigKey == name).FirstOrDefault()?.ConfigValue;
+ if (wcsBasez == null || address == null)
+ {
+ throw new InvalidOperationException("WMS IP 鏈厤缃�");
+ }
+ return wcsBasez + address;
+ }
}
}
\ No newline at end of file
--
Gitblit v1.9.3