From a4342e58b21d24428285f78abb95d6a87ccf5979 Mon Sep 17 00:00:00 2001
From: 陈勇 <竞男@ASUNA>
Date: 星期一, 30 三月 2026 16:02:36 +0800
Subject: [PATCH] 同步
---
项目代码/WCS/WCSServer/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs | 100 +++++++++++++++++++------------------------------
1 files changed, 39 insertions(+), 61 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServer/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServer/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
index eaab7f1..1452454 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServer/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServer/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
@@ -115,73 +115,51 @@
var palletcode = conveyorLine.GetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.SkidNo, station.stationChildCode);
var pvi = conveyorLine.GetValue<ConveyorLineDBName, string>(ConveyorLineDBName.PVI, station.stationChildCode);
- WebResponseContent response = _taskService.RequestRoadWayTask(palletcode.ToString(), pvi, station).Result;
- if (response.Status)
+ if (station.stationModel == "1") //鐩撮�氭ā寮�
{
- var task = _taskService.QueryBarCodeConveyorLineTask(palletcode.ToString(), station.stationChildCode);
- if (task != null)
+ 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.HZPassTZ)?.ConfigValue;
+ if (wmsBase == null || requestTask == null)
{
- var stationInfo = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.NextAddress);
- conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.Spare6, 3, station.stationChildCode);
- Thread.Sleep(300);
- conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.Spare5, Convert.ToInt16(stationInfo.stationTCLocation), station.stationChildCode);
- conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.AllowRelease, 1, station.stationChildCode);
-
- _taskService.UpdateTaskStatusToNext(task);
+ throw new InvalidOperationException("WMS IP 鏈厤缃�");
}
+ var wmsIpAddrss = wmsBase + requestTask;
+
+ var result = await HttpHelper.PostAsync(wmsIpAddrss, new { palletCode = palletcode, Roadways = station.Roadway, area = station.stationArea, Position = station.stationChildCode, PVI = pvi }.ToJsonString());
+ WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(result);
+ if (!content.Status)
+ {
+ throw new Exception(content.Message);
+ }
+ conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.Spare6, 2, station.stationChildCode);
+ conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.AllowRelease, 1, station.stationChildCode);
+ }
+ else //鍏ュ簱妯″紡
+ {
+ WebResponseContent response = _taskService.RequestRoadWayTask(palletcode.ToString(), pvi, station).Result;
+ if (response.Status)
+ {
+ var task = _taskService.QueryBarCodeConveyorLineTask(palletcode.ToString(), station.stationChildCode);
+ if (task != null)
+ {
+ var stationInfo = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.NextAddress);
+ conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.Spare6, 3, station.stationChildCode);
+ Thread.Sleep(300);
+ conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.Spare5, Convert.ToInt16(stationInfo.stationTCLocation), station.stationChildCode);
+ conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.AllowRelease, 1, station.stationChildCode);
+
+ _taskService.UpdateTaskStatusToNext(task);
+ }
+ }
+ //else
+ //{
+ // conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.AllowRelease, 12, station.stationChildCode);
+ //}
}
}
- //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.RequestInboundRoadWayNo)?.ConfigValue;
- //if (wmsBase == null || requestTask == null)
- //{
- // throw new InvalidOperationException("WMS IP 鏈厤缃�");
- //}
- //var wmsIpAddrss = wmsBase + requestTask;
-
- //var result = await HttpHelper.PostAsync(wmsIpAddrss, new { palletCode = palletcode, Roadways = station.Roadway, area = station.stationArea, Position = station.stationChildCode, PVI = pvi }.ToJsonString());
- //WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(result);
- //if (!content.Status)
- //{
- // return;
- //}
-
- ////鐒婃秱鎻愬崌鏈� 鐩撮�氫汉娑傝-2 鍏ュ簱-3
- //conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.Spare6, 3, station.stationChildCode);
- //conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.Spare5, 5, station.stationChildCode);
- //conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.AllowRelease, 1, station.stationChildCode);
}
- //DeviceProtocolDetailDTO? deviceProtocolDetails = conveyorLine.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == station.stationChildCode && x.ProtocalDetailValue == request.ToString());
-
- //if (deviceProtocolDetails != null)
- //{
- // MethodInfo? method = GetType().GetMethod(deviceProtocolDetails.ProtocolDetailType);
- // if (method != null)
- // {
- // method.Invoke(this, new object[] { conveyorLine, conveyorLine, station });
- // }
- //}
-
- //ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(station.stationChildCode);
- //command.PVI.Replace("/0", "").Replace("\"\\u0010\\u000f", "");
- //command.CarColor.Replace("/0", "");
- //command.CarType.Replace("/0", "");
- //command.CarCate.Replace("/0", "");
- //command.CatSkyWindow.Replace("/0", "");
-
- //DeviceProtocolDetailDTO? deviceProtocolDetails = conveyorLine.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == station.stationChildCode && x.ProtocalDetailValue == command.Request.ToString());
-
- ////x.DeviceProParamName == nameof(ConveyorLineTaskCommand.ConveyorLineSingal)
- //if (deviceProtocolDetails != null)
- //{
- // MethodInfo? method = GetType().GetMethod(deviceProtocolDetails.ProtocolDetailType);
- // if (method != null)
- // {
- // method.Invoke(this, new object[] { conveyorLine, command, station });
- // }
- //}
#region 璋冪敤浜嬩欢鎬荤嚎閫氱煡鍓嶇
//var tokenInfos = _cacheService.Get<List<UserInfo>>("Cache_UserToken");
@@ -210,7 +188,7 @@
}
finally
{
- WriteDebug("CommonConveyorLineJob", "test");
+ //WriteDebug("CommonConveyorLineJob", "test");
//Console.Out.WriteLine(DateTime.Now);
}
return;
--
Gitblit v1.9.3