From a89f1faab22c204627d49d6731be9c94d8160184 Mon Sep 17 00:00:00 2001
From: duyongjia <adu_555@163.com>
Date: 星期五, 22 十一月 2024 11:23:47 +0800
Subject: [PATCH] 优化修改提交
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 131 ++++++++++++++++++++++++++++++++-----------
1 files changed, 96 insertions(+), 35 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 423a9af..64dd609 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 OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
using SqlSugar;
using SqlSugar.Extensions;
@@ -147,7 +148,9 @@
WebResponseContent content = new WebResponseContent();
try
{
- // ServiceLogger.WriteLogToFile("");
+ string inparam = JsonConvert.SerializeObject(taskDTO);
+
+ ServiceLogger.WriteDebug("ReceiveTask", $"ReceiveMESTask鏂规硶鍏ュ弬{inparam}");
Dt_Task task = new Dt_Task();
Dt_Task taskinfo = BaseDal.QueryFirst(x => x.TaskNum == taskDTO.task_id);
if(taskDTO.cmd==101)//濡傛灉鏄�101鎸夋棫鐨勪换鍔″彿鍘绘煡
@@ -157,6 +160,7 @@
if (taskDTO.cmd!=3001&& taskDTO.cmd != 101 && taskinfo != null)
{
+ ServiceLogger.WriteDebug("ReceiveTask", $"浠诲姟鍙烽噸澶嶏紝浠诲姟鍙凤細{taskDTO.task_id}");
return content = WebResponseContent.Instance.Error($"浠诲姟鍙烽噸澶嶏紝浠诲姟鍙凤細{taskDTO.task_id}");
}
Dt_LocationInfo locationsrc = _locationInfoRepository.QueryFirst(x => x.Remark == taskDTO.src_station.ToString());
@@ -175,6 +179,7 @@
}
else
{
+ ServiceLogger.WriteDebug("ReceiveTask", $"WCS鏈煡璇㈠埌婧愮珯鐐瑰搴旂殑搴撲綅锛屾簮绔欑偣锛歿taskDTO.dest_station.ToString()}");
return content = WebResponseContent.Instance.Error($"WCS鏈煡璇㈠埌婧愮珯鐐瑰搴旂殑搴撲綅锛屾簮绔欑偣锛歿taskDTO.dest_station.ToString()}");
}
break;
@@ -193,6 +198,7 @@
}
else
{
+ ServiceLogger.WriteDebug("ReceiveTask", $"WCS鏈煡璇㈠埌婧愮珯鐐瑰搴旂殑搴撲綅锛屾簮绔欑偣锛歿taskDTO.dest_station.ToString()}");
return content = WebResponseContent.Instance.Error($"WCS鏈煡璇㈠埌婧愮珯鐐瑰搴旂殑搴撲綅锛屾簮绔欑偣锛歿taskDTO.dest_station.ToString()}");
}
}
@@ -202,6 +208,7 @@
{
UpdateTaskStatus(taskinfo.TaskId, (int)TaskInStatusEnum.AGV_InExecuting);
_taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"AGV鍏ュ簱鎵ц涓�");
+ ServiceLogger.WriteDebug("ReceiveTask", $"AGV鍏ュ簱鎵ц涓紙鑷姩3001锛夋洿鏂扮姸鎬佹垚鍔燂紝浠诲姟鍙凤細{taskinfo.TaskId}");
return content = WebResponseContent.Instance.OK($"AGV鍏ュ簱鎵ц涓紙鑷姩3001锛夋洿鏂扮姸鎬佹垚鍔燂紝浠诲姟鍙凤細{taskinfo.TaskId}");
}
else
@@ -217,10 +224,12 @@
//鏇存柊浠诲姟琛ㄤ腑NextAddress瀛楁涓烘柊鐨勪换鍔″彿 taskDTO.weight-鏃х殑浠诲姟鍙� taskDTO.task_id-鏂扮殑浠诲姟鍙�
UpdateTaskStatus(taskinfo.TaskId, taskDTO.task_id, (int)TaskInStatusEnum.AGV_InFinish);
_taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"AGV鎼繍瀹屾垚");
+ ServiceLogger.WriteDebug("ReceiveTask", $"AGV鎼繍瀹屾垚锛�101锛夋洿鏂扮姸鎬佹垚鍔燂紝浠诲姟鍙凤細{taskinfo.TaskId}");
return content = WebResponseContent.Instance.OK($"AGV鎼繍瀹屾垚锛�101锛夋洿鏂扮姸鎬佹垚鍔燂紝浠诲姟鍙凤細{taskinfo.TaskId}");
}
else
{
+ ServiceLogger.WriteDebug("ReceiveTask", $"AGV鎼繍瀹屾垚锛�101锛夋洿鏂扮姸鎬佹椂锛屾煡璇笉鍒颁换鍔″彿");
return content = WebResponseContent.Instance.Error($"AGV鎼繍瀹屾垚锛�101锛夋洿鏂扮姸鎬佹椂锛屾煡璇笉鍒颁换鍔″彿");
}
break;
@@ -252,7 +261,8 @@
}
else
{
- return content = WebResponseContent.Instance.Error($"WCS鏈煡璇㈠埌鐩爣绔欑偣瀵瑰簲鐨勫簱浣嶏紝鐩爣绔欑偣锛歿taskDTO.dest_station.ToString()}");
+ ServiceLogger.WriteDebug("ReceiveTask", $"WCS鏈煡璇㈠埌鐩爣绔欑偣瀵瑰簲鐨勫簱浣嶏紝鐩爣绔欑偣锛歿taskDTO.dest_station.ToString()}");
+ return content = WebResponseContent.Instance.Error($"WCS鏈煡璇㈠埌鐩爣绔欑偣瀵瑰簲鐨勫簱浣嶏紝鐩爣绔欑偣锛歿taskDTO.dest_station.ToString()}");
}
break;
case 104://缁勭珛鏈轰笂鏂� 鏆傚瓨浣�-->缁勭珛鏈�
@@ -270,7 +280,8 @@
}
else
{
- return content = WebResponseContent.Instance.Error($"WCS鏈煡璇㈠埌鐩爣绔欑偣瀵瑰簲鐨勫簱浣嶏紝鐩爣绔欑偣锛歿task.TargetAddress.ToString()}");
+ ServiceLogger.WriteDebug("ReceiveTask", $"WCS鏈煡璇㈠埌鐩爣绔欑偣瀵瑰簲鐨勫簱浣嶏紝鐩爣绔欑偣锛歿task.TargetAddress.ToString()}");
+ return content = WebResponseContent.Instance.Error($"WCS鏈煡璇㈠埌鐩爣绔欑偣瀵瑰簲鐨勫簱浣嶏紝鐩爣绔欑偣锛歿task.TargetAddress.ToString()}");
}
//鏍规嵁鐩爣鍦板潃锛堢粍绔嬫満锛夋煡璇㈤粯璁ょ殑鎵ц浠诲姟鐨勫皬鍫嗗灈鏈虹紪鍙�
Dt_LocationInfo locationtemp2 = _locationInfoRepository.QueryFirst(x => x.LocationCode == task.TargetAddress.ToString());
@@ -280,6 +291,8 @@
}
else
{
+
+ ServiceLogger.WriteDebug("ReceiveTask", $"WCS鏈煡璇㈠埌缁勭珛鏈哄搴旂殑榛樿灏忓爢鍨涙満閰嶇疆");
return content = WebResponseContent.Instance.Error($"WCS鏈煡璇㈠埌缁勭珛鏈哄搴旂殑榛樿灏忓爢鍨涙満閰嶇疆");
}
@@ -292,7 +305,7 @@
task.TaskNum = taskDTO.task_id;
task.PalletCode = taskDTO.CarId;
- task.Roadway = "SC01";
+
if (string.IsNullOrEmpty(task.SourceAddress))//濡傛灉涓嶆槸绔欑偣锛岀洿鎺ュ彇琛屽垪灞�
{
task.SourceAddress = $"SC01-{taskDTO.src_rack.ToString().PadLeft(3, '0')}-{taskDTO.src_col.ToString().PadLeft(3, '0')}-{taskDTO.src_row.ToString().PadLeft(3, '0')}";
@@ -310,10 +323,12 @@
{
if (srcLocation.EnableStatus == (int)EnableStatusEnum.Disable)
{
+ ServiceLogger.WriteDebug("ReceiveTask", $"婧愬湴鍧�宸茬鐢細{srcLocation.LocationCode}");
return content = WebResponseContent.Instance.Error($"婧愬湴鍧�宸茬鐢細{srcLocation.LocationCode}");
}
if (tarLocation.EnableStatus == (int)EnableStatusEnum.Disable)
{
+ ServiceLogger.WriteDebug("ReceiveTask", $"鐩爣鍦板潃宸茬鐢細{tarLocation.LocationCode}");
return content = WebResponseContent.Instance.Error($"鐩爣鍦板潃宸茬鐢細{tarLocation.LocationCode}");
}
if (taskDTO.cmd != 101)//鍏ュ簱鏃朵笉闇�瑕佸垽鏂槸鍚﹂攣瀹氾紝閿佸畾鐘舵�佹槸鍦ㄧ敓鎴愪换鍔℃椂閿佸畾
@@ -323,10 +338,13 @@
{
if (srcLocation.LocationStatus == (int)LocationStatusEnum.Lock)
{
+
+ ServiceLogger.WriteDebug("ReceiveTask", $"婧愬湴鍧�宸查攣瀹氾細{srcLocation.LocationCode}");
return content = WebResponseContent.Instance.Error($"婧愬湴鍧�宸查攣瀹氾細{srcLocation.LocationCode}");
}
if (tarLocation.LocationStatus == (int)LocationStatusEnum.Lock)
{
+ ServiceLogger.WriteDebug("ReceiveTask", $"鐩爣鍦板潃宸查攣瀹氾細{tarLocation.LocationCode}");
return content = WebResponseContent.Instance.Error($"鐩爣鍦板潃宸查攣瀹氾細{tarLocation.LocationCode}");
}
}
@@ -336,6 +354,8 @@
//WCS鏌ヨ搴撲綅鐘舵�佹槸鍚︿负鈥滅┖闂测�濆苟涓旀湭绂佺敤锛岄攣瀹氬簱浣嶄慨鏀瑰簱浣嶇姸鎬佷负鈥滈攣瀹氣�濓紝鐢熸垚WCS浜у搧鍏ュ簱浠诲姟锛屽姞鍏CS浠诲姟闃熷垪涓��
if (tarLocation.LocationStatus != (int)LocationStatusEnum.Free)
{
+
+ ServiceLogger.WriteDebug("ReceiveTask", $"鍏ュ簱-鐩爣鍦板潃涓嶆槸绌洪棽鐘舵�侊細{tarLocation.LocationCode}");
return content = WebResponseContent.Instance.Error($"鍏ュ簱-鐩爣鍦板潃涓嶆槸绌洪棽鐘舵�侊細{tarLocation.LocationCode}");
}
//srcLocation.LocationStatus = (int)LocationStatusEnum.Lock;
@@ -354,10 +374,14 @@
//WCS鏌ヨ搴撲綅鐘舵�佹槸鍚︿负鈥滄湁璐р�濓紝搴撲綅/鏆傚瓨搴撲綅鏄惁鈥滅┖闂测��
if (srcLocation.LocationStatus != (int)LocationStatusEnum.InStock)
{
+
+ ServiceLogger.WriteDebug("ReceiveTask", $"绉诲簱-婧愬湴鍧�涓嶆槸鏈夎揣鐘舵�侊細{srcLocation.LocationCode}");
return content = WebResponseContent.Instance.Error($"绉诲簱-婧愬湴鍧�涓嶆槸鏈夎揣鐘舵�侊細{srcLocation.LocationCode}");
}
if(tarLocation.LocationStatus != (int)LocationStatusEnum.Free)
{
+
+ ServiceLogger.WriteDebug("ReceiveTask", $"绉诲簱-鐩爣鍦板潃涓嶆槸绌洪棽鐘舵�侊細{srcLocation.LocationCode}");
return content = WebResponseContent.Instance.Error($"绉诲簱-鐩爣鍦板潃涓嶆槸绌洪棽鐘舵�侊細{srcLocation.LocationCode}");
}
srcLocation.LocationStatus = (int)LocationStatusEnum.Lock;
@@ -369,6 +393,8 @@
//WCS鏌ヨ搴撲綅鐘舵�佹槸鍚︿负鈥滄湁璐р��
if (srcLocation.LocationStatus != (int)LocationStatusEnum.InStock)
{
+
+ ServiceLogger.WriteDebug("ReceiveTask", $"寮傚父鍑哄簱-婧愬湴鍧�涓嶆槸鏈夎揣鐘舵�侊細{srcLocation.LocationCode}");
return content = WebResponseContent.Instance.Error($"寮傚父鍑哄簱-婧愬湴鍧�涓嶆槸鏈夎揣鐘舵�侊細{srcLocation.LocationCode}");
}
srcLocation.LocationStatus = (int)LocationStatusEnum.Lock;
@@ -384,6 +410,8 @@
//WCS鏌ヨ鏆傚瓨搴撲綅鏄惁鈥滄湁璐р��
if (srcLocation.LocationStatus != (int)LocationStatusEnum.InStock)
{
+
+ ServiceLogger.WriteDebug("ReceiveTask", $"绌鸿溅鍑哄簱-婧愬湴鍧�涓嶆槸鏈夎揣鐘舵�侊細{srcLocation.LocationCode}");
return content = WebResponseContent.Instance.Error($"绌鸿溅鍑哄簱-婧愬湴鍧�涓嶆槸鏈夎揣鐘舵�侊細{srcLocation.LocationCode}");
}
//srcLocation.LocationStatus = (int)LocationStatusEnum.Lock;
@@ -398,6 +426,8 @@
//WCS鏌ヨ鏆傚瓨搴撲綅鏄惁鈥滄湁璐р��
if (srcLocation.LocationStatus != (int)LocationStatusEnum.InStock)
{
+
+ ServiceLogger.WriteDebug("ReceiveTask", $"涓婃枡浠诲姟-婧愬湴鍧�涓嶆槸鏈夎揣鐘舵�侊細{srcLocation.LocationCode}");
return content = WebResponseContent.Instance.Error($"涓婃枡浠诲姟-婧愬湴鍧�涓嶆槸鏈夎揣鐘舵�侊細{srcLocation.LocationCode}");
}
//srcLocation.LocationStatus = (int)LocationStatusEnum.Lock;
@@ -408,6 +438,7 @@
}
else
{
+ ServiceLogger.WriteDebug("ReceiveTask", $"搴撲綅鍦板潃涓嶅瓨鍦紝浠诲姟鍙�:{task.TaskNum}");
return content = WebResponseContent.Instance.Error($"搴撲綅鍦板潃涓嶅瓨鍦紝浠诲姟鍙�:{task.TaskNum}");
}
@@ -431,12 +462,13 @@
_unitOfWorkManage.RollbackTran();
throw;
}
-
- content = WebResponseContent.Instance.OK("鎴愬姛",task);
+ ServiceLogger.WriteDebug("ReceiveTask", $"鎺ユ敹浠诲姟鎴愬姛锛屼换鍔″彿:{task.TaskNum}");
+ content = WebResponseContent.Instance.OK($"鎺ユ敹浠诲姟鎴愬姛锛屼换鍔″彿:{task.TaskNum}", task);
}
catch (Exception ex)
{
+ ServiceLogger.WriteDebug("ReceiveTask", $"浠诲姟鎺ユ敹閿欒,閿欒淇℃伅:{ex.StackTrace}");
content = WebResponseContent.Instance.Error($"浠诲姟鎺ユ敹閿欒,閿欒淇℃伅:{ex.Message}");
}
return content;
@@ -844,6 +876,7 @@
MESResponse res = ApiInvoke.SendTaskCMD(sendcmd);
if (res != null && res.code != 0)
{
+ ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"澶у爢鍨涙満瀹屾垚鍑哄簱浠诲姟鍚庡洖浼燤ES澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵res.message}銆�");
content = WebResponseContent.Instance.Error($"澶у爢鍨涙満瀹屾垚鍑哄簱浠诲姟鍚庡洖浼燤ES澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵res.message}銆�");
}
@@ -851,6 +884,8 @@
catch (Exception ex)
{
_unitOfWorkManage.RollbackTran();
+ //浠诲姟鎵ц澶辫触锛岃揣浣嶇姸鎬佽繕鍘�
+ ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"澶у爢鍨涙満鎵ц鍑哄簱浠诲姟澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵ex.Message}銆�");
content = WebResponseContent.Instance.Error($"澶у爢鍨涙満鎵ц鍑哄簱浠诲姟澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵ex.Message}銆�");
}
@@ -880,16 +915,25 @@
//鍏ュ簱瀹屾垚锛屽洖浼燤ES 鍏ュ簱瀹屾垚鍥炰紶task.NextAddress 涔嬪墠101璇锋眰鏃跺瓨鐨勬柊浠诲姟鍙�
MESSendCMD sendcmd = new MESSendCMD { cmd = 201, task_id = int.Parse(task.NextAddress), status = 6 };
+ string inparam = JsonConvert.SerializeObject(sendcmd);
+ ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"澶у爢鍨涙満瀹屾垚鍏ュ簱浠诲姟鍚庡洖浼燤ES鍏ュ弬:{inparam}");
MESResponse res = ApiInvoke.SendTaskCMD(sendcmd);
if (res != null && res.code != 0)
{
+
+ ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"澶у爢鍨涙満瀹屾垚鍏ュ簱浠诲姟鍚庡洖浼燤ES澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵res.message}銆�");
content = WebResponseContent.Instance.Error($"澶у爢鍨涙満瀹屾垚鍏ュ簱浠诲姟鍚庡洖浼燤ES澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵res.message}銆�");
+ }
+ else
+ {
+ ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"澶у爢鍨涙満瀹屾垚鍏ュ簱浠诲姟鍚庡洖浼燤ES鎴愬姛锛�,浠诲姟鍙�:銆恵taskNum}銆�");
}
}
catch (Exception ex)
{
_unitOfWorkManage.RollbackTran();
+ ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"澶у爢鍨涙満鎵ц鍏ュ簱浠诲姟澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵ex.Message}銆�");
content = WebResponseContent.Instance.Error($"澶у爢鍨涙満鎵ц鍏ュ簱浠诲姟澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵ex.Message}銆�");
}
}
@@ -902,7 +946,7 @@
srcLocation.LocationStatus = (int)LocationStatusEnum.Free;
Dt_LocationInfo tarLocation = _locationInfoRepository.QueryFirst(x => x.LocationCode == task.TargetAddress);
- srcLocation.LocationStatus = (int)LocationStatusEnum.InStock;
+ tarLocation.LocationStatus = (int)LocationStatusEnum.InStock;
UpdateTaskStatus(task.TaskId, (int)TaskOutStatusEnum.SC_OutFinish);
_taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍫嗗灈鏈哄嚭搴撳畬鎴�");
@@ -917,9 +961,12 @@
//绉诲簱瀹屾垚锛屽洖浼燤ES
//鍥炰紶鍒癢MS
MESSendCMD sendcmd = new MESSendCMD { cmd = 201, task_id = task.TaskNum, status = 6 };
+ string inparam = JsonConvert.SerializeObject(sendcmd);
+ ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"澶у爢鍨涙満瀹屾垚鍑哄簱浠诲姟鍚庡洖浼燤ES鍏ュ弬:{inparam}");
MESResponse res = ApiInvoke.SendTaskCMD(sendcmd);
if (res != null && res.code != 0)
{
+ ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"澶у爢鍨涙満瀹屾垚鍑哄簱浠诲姟鍚庡洖浼燤ES澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵res.message}銆�");
content = WebResponseContent.Instance.Error($"澶у爢鍨涙満瀹屾垚鍑哄簱浠诲姟鍚庡洖浼燤ES澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵res.message}銆�");
}
@@ -927,6 +974,7 @@
catch (Exception ex)
{
_unitOfWorkManage.RollbackTran();
+ ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"澶у爢鍨涙満鎵ц鍑哄簱浠诲姟澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵ex.Message}銆�");
content = WebResponseContent.Instance.Error($"澶у爢鍨涙満鎵ц鍑哄簱浠诲姟澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵ex.Message}銆�");
}
}
@@ -935,7 +983,7 @@
{
try
{
- Dt_LocationInfo srcLocation = _locationInfoRepository.QueryFirst(x => x.LocationCode == task.SourceAddress);
+ //Dt_LocationInfo srcLocation = _locationInfoRepository.QueryFirst(x => x.LocationCode == task.SourceAddress);
//srcLocation.LocationStatus = (int)LocationStatusEnum.Free;
@@ -950,59 +998,72 @@
_unitOfWorkManage.CommitTran();
//涓婃枡瀹屾垚锛屽洖浼燱MS
MESSendCMD sendcmd = new MESSendCMD { cmd = 201, task_id = task.TaskNum, status = 6 };
+ string inparam = JsonConvert.SerializeObject(sendcmd);
+ ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"灏忓爢鍨涙満鎵ц鍑哄簱浠诲姟鍥炰紶MES鍏ュ弬{inparam}");
MESResponse res = ApiInvoke.SendTaskCMD(sendcmd);
if (res != null && res.code != 0)
{
+ ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"灏忓爢鍨涙満瀹屾垚鍑哄簱浠诲姟鍚庡洖浼燤ES澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵res.message}銆�");
content = WebResponseContent.Instance.Error($"灏忓爢鍨涙満瀹屾垚鍑哄簱浠诲姟鍚庡洖浼燤ES澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵res.message}銆�");
}
- else
- {
- //鍒ゆ柇鏄惁瀹屾垚鐨勬渶鍚庝竴灞傦紝鑷姩鐢熸垚绌鸿溅鍑哄簱浠诲姟
- string[] Levels = task.Remark.Split("-");
- if (Levels.Length == 2)
- {
- if (!string.IsNullOrEmpty(Levels[0])&& !string.IsNullOrEmpty(Levels[1]))
- {
- //濡傛灉褰撳墠鎻愬彇灞傛暟绛変簬鎬诲眰鏂欙紝鍒欒〃绀烘枡杞︽墍鏈夌殑灞傛暟鍙栧畬
- if(Convert.ToInt16(Levels[0])== Convert.ToInt16(Levels[1]))
- {
- string[] SourceCodes = task.SourceAddress.Split("-");
- string startPlan = "";
- if (SourceCodes.Length == 4)
- {
- startPlan= "101"+ SourceCodes[2].Substring(1,2);
- }
- DeliveryPlan send = new DeliveryPlan { startPlan = startPlan, isQuit = false, CarId = task.PalletCode };
- ApiInvoke.DeliveryPlanCMD(send);//鍥炶皟MES鎺ュ彛鐢熸垚绌鸿溅鍑哄簱浠诲姟
-
- }
-
- }
+ //else
+ //{
+ // //鍒ゆ柇鏄惁瀹屾垚鐨勬渶鍚庝竴灞傦紝鑷姩鐢熸垚绌鸿溅鍑哄簱浠诲姟
+ // string[] Levels = task.Remark.Split("-");
+ // if (Levels.Length == 2)
+ // {
+ // if (!string.IsNullOrEmpty(Levels[0])&& !string.IsNullOrEmpty(Levels[1]))
+ // {
+ // //濡傛灉褰撳墠鎻愬彇灞傛暟绛変簬鎬诲眰鏂欙紝鍒欒〃绀烘枡杞︽墍鏈夌殑灞傛暟鍙栧畬
+ // if(Convert.ToInt16(Levels[0])== Convert.ToInt16(Levels[1]))
+ // {
+ // string[] SourceCodes = task.SourceAddress.Split("-");
+ // string startPlan = "";
+ // if (SourceCodes.Length == 4)
+ // {
+ // startPlan = "101" + SourceCodes[2].Substring(1, 2);
+ // }
+ // DeliveryPlan send = new DeliveryPlan { startPlan = startPlan, isQuit = false, CarId = task.PalletCode };
+ // string inparam2 = JsonConvert.SerializeObject(send);
+ // ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"灏忓爢鍨涙満鎵ц鍑哄簱浠诲姟鍥炰紶MES鍏ュ弬{inparam2}");
+ // ApiInvoke.DeliveryPlanCMD(send);//鍥炶皟MES鎺ュ彛鐢熸垚绌鸿溅鍑哄簱浠诲姟
+ // 鎵�鏈夌殑灞傛暟閮藉彇瀹岋紝闇�瑕佹妸鏆傚瓨浣嶇姸鎬佹敼涓虹┖闂茬姸鎬�
+ // srcLocation.LocationStatus = (int)LocationStatusEnum.Free;
+ // _locationInfoRepository.UpdateData(srcLocation);
+ // }
+
+ // }
- }
- }
+ // }
+ //}
}
catch (Exception ex)
{
_unitOfWorkManage.RollbackTran();
+ ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"灏忓爢鍨涙満鎵ц鍑哄簱浠诲姟澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵ex.StackTrace}銆�");
content = WebResponseContent.Instance.Error($"灏忓爢鍨涙満鎵ц鍑哄簱浠诲姟澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵ex.Message}銆�");
}
}
else
{
+ ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"浠诲姟绫诲瀷閿欒,鏈壘鍒拌浠诲姟绫诲瀷,浠诲姟鍙�:銆恵taskNum}銆�,浠诲姟绫诲瀷:銆恵task.TaskType}銆�");
throw new Exception($"浠诲姟绫诲瀷閿欒,鏈壘鍒拌浠诲姟绫诲瀷,浠诲姟鍙�:銆恵taskNum}銆�,浠诲姟绫诲瀷:銆恵task.TaskType}銆�");
}
- content = WebResponseContent.Instance.OK();
+ ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"浠诲姟瀹屾垚鎴愬姛,浠诲姟鍙�:銆恵taskNum}銆�");
+ content = WebResponseContent.Instance.OK($"浠诲姟瀹屾垚鎴愬姛,浠诲姟鍙�:銆恵taskNum}銆�");
}
catch (Exception ex)
{
- content = WebResponseContent.Instance.Error($"浠诲姟瀹屾垚寮傚父,浠诲姟鍙�:銆恵taskNum}銆�");
+ ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"浠诲姟瀹屾垚寮傚父,浠诲姟鍙�:銆恵taskNum}銆憑ex.Message}");
+ content = WebResponseContent.Instance.Error($"浠诲姟瀹屾垚寮傚父,浠诲姟鍙�:銆恵taskNum}銆憑ex.Message}");
}
return content;
}
+
+
/// <summary>
/// 鎭㈠鎸傝捣浠诲姟
/// </summary>
--
Gitblit v1.9.3