From c362218b8ef0af6402d3715fbed040ac1cbe0433 Mon Sep 17 00:00:00 2001 From: duyongjia <adu_555@163.com> Date: 星期五, 29 十一月 2024 14:32:18 +0800 Subject: [PATCH] 最新上传 --- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 338 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 299 insertions(+), 39 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 a9fbbb3..dd4bf5a 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" @@ -21,6 +21,7 @@ using SqlSugar; using SqlSugar.Extensions; using System; +using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; @@ -54,6 +55,7 @@ private readonly ILocationInfoRepository _locationInfoRepository; private readonly IMapper _mapper; private readonly IUnitOfWorkManage _unitOfWorkManage; + private readonly ITaskRepository _taskRepository; private Dictionary<string, OrderByType> _taskOrderBy = new() { @@ -71,7 +73,7 @@ public List<int> TaskOtherboundTypes => typeof(TaskOtherTypeEnum).GetEnumIndexList(); - public TaskService(ITaskRepository BaseDal, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, ITaskExecuteDetailRepository taskExecuteDetailRepository, IMapper mapper, ILocationInfoRepository locationInfoRepository, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) + public TaskService(ITaskRepository BaseDal, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, ITaskExecuteDetailRepository taskExecuteDetailRepository, IMapper mapper, ILocationInfoRepository locationInfoRepository, IUnitOfWorkManage unitOfWorkManage, ITaskRepository taskRepository) : base(BaseDal) { _routerService = routerService; _taskExecuteDetailService = taskExecuteDetailService; @@ -79,6 +81,7 @@ _mapper = mapper; _locationInfoRepository = locationInfoRepository; _unitOfWorkManage = unitOfWorkManage; + _taskRepository = taskRepository; } /// <summary> @@ -183,7 +186,7 @@ return content = WebResponseContent.Instance.Error($"WCS鏈煡璇㈠埌婧愮珯鐐瑰搴旂殑搴撲綅锛屾簮绔欑偣锛歿taskDTO.dest_station.ToString()}"); } break; - case 3001://AGV鏀捐揣瀹屾垚 WMS鍙�3001鐨勫悓鏃朵細鍐欐彁鍗囦俊鍙� + case 3001://AGV鏀捐揣瀹屾垚 WMS鍙�3001鐨勫悓鏃禬CS闇�鍦╦ob涓啓鎻愬崌淇″彿 if (BaseDal.QueryFirst(x => x.TaskNum == taskDTO.task_id) == null)//鎵嬪姩鍏ュ簱鐩存帴鍙�3001锛岄渶瑕佺敓鎴愪换鍔★紝鍥犱负娌℃湁1001鐜妭 { @@ -468,7 +471,7 @@ } catch (Exception ex) { - ServiceLogger.WriteDebug("ReceiveTask", $"浠诲姟鎺ユ敹閿欒,閿欒淇℃伅:{ex.Message}"); + ServiceLogger.WriteDebug("ReceiveTask", $"浠诲姟鎺ユ敹閿欒,閿欒淇℃伅:{ex.StackTrace}"); content = WebResponseContent.Instance.Error($"浠诲姟鎺ユ敹閿欒,閿欒淇℃伅:{ex.Message}"); } return content; @@ -678,7 +681,7 @@ _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, task.ExceptionMessage); - content = WebResponseContent.Instance.OK(); + } catch (Exception ex) { @@ -700,6 +703,245 @@ task.Modifier = "System"; task.ModifyDate = DateTime.Now; BaseDal.UpdateData(task); + } + + /// <summary> + /// 浠诲姟寮哄埗瀹屾垚 鍫嗗灈鏈哄疄闄呭凡瀹屾垚浠诲姟锛學CS鏈敹鍒板畬鎴愪俊鍙锋垨鍏朵粬鏈煡鍘熷洜瀵艰嚧WCS浠诲姟鏈畬鎴愶紝鍙互鎵ц璇ユ柟娉曞己鍒跺畬鎴愪换鍔� + /// </summary> + /// <param name="taskNum"></param> + /// <returns></returns> + public WebResponseContent ForceCompleteTask(int taskNum) + { + WebResponseContent content = new WebResponseContent(); + try + { + bool isBack = false; + //1锛屽厛鏌ヨ浠诲姟锛屾牴鎹笉鍚岀殑浠诲姟绫诲瀷鍋氫换鍔″己鍒跺畬鎴愭搷浣� + Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == taskNum); + if (task == null) return WebResponseContent.Instance.Error($"鏈壘鍒拌浠诲姟淇℃伅,浠诲姟鍙�:銆恵taskNum}銆�"); + + Dt_LocationInfo locationsrc = _locationInfoRepository.QueryFirst(x => x.LocationCode == task.SourceAddress.ToString()); + Dt_LocationInfo locationdsc = _locationInfoRepository.QueryFirst(x => x.LocationCode == task.TargetAddress.ToString()); + if (task.TaskType == (int)TaskInboundTypeEnum.Inbound) + { + if (task.TaskState == (int)TaskInStatusEnum.SC_InExecuting) + { + task.TaskState = (int)TaskInStatusEnum.SC_InFinish; + //闇�瑕佸皢鐩爣鍦板潃鏀逛负鏈夎揣鐘舵�� + locationdsc.LocationStatus = (int)LocationStatusEnum.InStock; + + //鏇存柊鐘舵�佷负浠诲姟瀹屾垚 + UpdateTaskStatus(task.TaskId, task.TaskState); + _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍫嗗灈鏈哄叆搴撳畬鎴�"); + _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍏ュ簱浠诲姟瀹屾垚"); + //鏇存柊璐т綅 + _locationInfoRepository.UpdateData(locationdsc); + isBack = true; + + } + else + { + return content = WebResponseContent.Instance.Error("璇ヤ换鍔$洰鍓嶇姸鎬侊紝涓嶅厑璁″己鍒跺畬鎴愶紒"); + } + + } + else + { + if (task.TaskState == (int)TaskOutStatusEnum.SC_OutExecuting) + { + + if (task.TaskType == (int)TaskOutboundTypeEnum.OutInventory || task.TaskType == (int)TaskOutboundTypeEnum.OutPick)//寮傚父鍑哄簱 绌鸿溅鍑哄簱 + { + task.TaskState = (int)TaskOutStatusEnum.OutFinish; + //婧愬湴鍧�鏇存柊涓虹┖闂� + locationsrc.LocationStatus = (int)LocationStatusEnum.Free; + + //鏇存柊鐘舵�佷负浠诲姟瀹屾垚 + UpdateTaskStatus(task.TaskId, task.TaskState); + _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍫嗗灈鏈哄嚭搴撳畬鎴�"); + _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍑哄簱浠诲姟瀹屾垚"); + //鏇存柊璐т綅 + _locationInfoRepository.UpdateData(locationsrc); + isBack = true; + } + else if (task.TaskType == (int)TaskRelocationTypeEnum.Relocation)//绉诲簱 + { + task.TaskState = (int)TaskOutStatusEnum.OutFinish; + //婧愬湴鍧�鏇存柊涓虹┖闂� + locationsrc.LocationStatus = (int)LocationStatusEnum.Free; + //鐩爣鍦板潃鏇存柊涓烘湁璐� + locationdsc.LocationStatus = (int)LocationStatusEnum.InStock; + + + //鏇存柊鐘舵�佷负浠诲姟瀹屾垚 + UpdateTaskStatus(task.TaskId, task.TaskState); + _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍫嗗灈鏈哄嚭搴撳畬鎴�"); + _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍑哄簱浠诲姟瀹屾垚"); + //鏇存柊璐т綅 + _locationInfoRepository.UpdateData(locationsrc); + _locationInfoRepository.UpdateData(locationdsc); + isBack = true; + + + } + else + { + return WebResponseContent.Instance.Error($"涓婃枡浠诲姟涓嶅厑璁″己鍒跺畬鎴愶紒"); + } + } + else + { + return WebResponseContent.Instance.Error($"璇ヤ换鍔$姸鎬佷笉鍏佽寮哄埗瀹屾垚锛�"); + } + } + + //浠诲姟寮哄埗瀹屾垚鍥炶皟MES + if (isBack) + { + + if (task.TaskType == (int)TaskInboundTypeEnum.Inbound)//鍏ュ簱鏃跺洖浼犻渶浼犳柊浠诲姟鍙� + { + task.TaskNum =int.Parse(task.NextAddress); + } + MESSendCMD sendcmd = new MESSendCMD { cmd = 201, task_id = task.TaskNum, status = 6 }; + MESResponse res = ApiInvoke.SendTaskCMD(sendcmd); + if (res != null && res.code != 0) + { + ServiceLogger.WriteDebug("ForceCompleteTask", $"浠诲姟寮哄埗瀹屾垚鍚庡洖浼燤ES澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵res.message}銆�"); + content = WebResponseContent.Instance.Error($"浠诲姟寮哄埗瀹屾垚鍚庡洖浼燤ES澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵res.message}銆�"); + } + else + { + ServiceLogger.WriteDebug("ForceCompleteTask", $"浠诲姟寮哄埗瀹屾垚鍚庡洖浼燤ES鎴愬姛锛�,浠诲姟鍙�:銆恵taskNum}銆�"); + content = WebResponseContent.Instance.Error($"澶у爢鍨涙満瀹屾垚鍚庡洖浼燤ES鎴愬姛锛�,浠诲姟鍙�:銆恵taskNum}銆�"); + } + } + } + catch (Exception ex) + { + content = WebResponseContent.Instance.Error(ex.Message); + } + return content; + + } + + /// <summary> + /// 浠诲姟鍙栨秷 + /// </summary> + /// <param name="taskid"></param> + /// <returns></returns> + public WebResponseContent CancelTask(int taskNum) + { + WebResponseContent content = new WebResponseContent(); + try + { + //1锛屽厛鏌ヨ浠诲姟锛屾牴鎹笉鍚岀殑浠诲姟绫诲瀷鍋氫换鍔″彇娑堟搷浣� + Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == taskNum); + if (task == null) return WebResponseContent.Instance.Error($"鏈壘鍒拌浠诲姟淇℃伅,浠诲姟鍙�:銆恵taskNum}銆�"); + + Dt_LocationInfo locationsrc = _locationInfoRepository.QueryFirst(x => x.LocationCode == task.SourceAddress.ToString()); + Dt_LocationInfo locationdsc = _locationInfoRepository.QueryFirst(x => x.LocationCode == task.TargetAddress.ToString()); + bool isBack = false; + //濡傛灉鏄叆搴撳垎鑷姩鍜屾墜鍔ㄤ袱绉嶆儏鍐靛鐞� + if (task.TaskType == (int)TaskInboundTypeEnum.Inbound) + { + if (task.WMSId == 0 && task.TaskState == (int)TaskInStatusEnum.InNew)//鑷姩鍏ュ簱锛�1001-AGV璇锋眰鏄惁鍏佽杩涘叆锛屼换鍔$姸鎬佷负鈥滄柊寤哄叆搴撲换鍔�200鈥濅箣鍓嶅彲浠ュ彇娑� + { + task.TaskState = (int)TaskInStatusEnum.InCancel; + //闇�瑕佸皢鐩爣鍦板潃鎭㈠涓虹┖闂茬姸鎬� + locationdsc.LocationStatus = (int)LocationStatusEnum.Free; + //鏇存柊鐘舵�佷负浠诲姟鍙栨秷 + UpdateTaskStatus(task.TaskId, task.TaskState); + _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍏ュ簱浠诲姟鍙栨秷"); + _locationInfoRepository.UpdateData(locationdsc); + isBack = true; + } + else if (task.WMSId == 1 && task.TaskState == (int)TaskInStatusEnum.AGV_InExecuting)//鎵嬪姩鍏ュ簱锛�3001-AGV鏀捐揣瀹屾垚锛屼换鍔$姸鎬佷负鈥淎GV鍏ュ簱鎵ц涓�210鈥濅箣鍓嶅彲浠ュ彇娑� + { + task.TaskState = (int)TaskInStatusEnum.InCancel; + //闇�瑕佸皢鐩爣鍦板潃鎭㈠绌洪棽鐘舵�� + locationdsc.LocationStatus = (int)LocationStatusEnum.Free; + //鏇存柊鐘舵�佷负浠诲姟鍙栨秷 + UpdateTaskStatus(task.TaskId, task.TaskState); + _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍏ュ簱浠诲姟鍙栨秷"); + _locationInfoRepository.UpdateData(locationdsc); + isBack = true; + } + else + { + return WebResponseContent.Instance.Error($"璇ヤ换鍔$姸鎬佷笉鍏佽鍙栨秷锛�"); + } + } + else//鍏朵粬浠诲姟锛屼换鍔$姸鎬佲�滄柊寤哄嚭搴撲换鍔♀�濅箣鍓嶏紝鎵嶅彲浠ュ彇娑� + { + if (task.TaskState == (int)TaskOutStatusEnum.OutNew) + { + if(task.TaskType == (int)TaskOutboundTypeEnum.OutInventory|| task.TaskType == (int)TaskOutboundTypeEnum.OutPick)//寮傚父鍑哄簱 绌鸿溅鍑哄簱 + { + task.TaskState = (int)TaskOutStatusEnum.OutCancel; + //婧愬湴鍧�鎭㈠鍒版湁璐� + locationsrc.LocationStatus = (int)LocationStatusEnum.InStock; + + //鏇存柊鐘舵�佷负浠诲姟鍙栨秷 + UpdateTaskStatus(task.TaskId, task.TaskState); + _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍑哄簱浠诲姟鍙栨秷"); + _locationInfoRepository.UpdateData(locationsrc); + isBack = true; + } + else if(task.TaskType == (int)TaskRelocationTypeEnum.Relocation)//绉诲簱 + { + task.TaskState = (int)TaskOutStatusEnum.OutCancel; + //婧愬湴鍧�鎭㈠鍒版湁璐� + locationsrc.LocationStatus = (int)LocationStatusEnum.InStock; + //闇�瑕佸皢鐩爣鍦板潃鎭㈠绌洪棽鐘舵�� + locationdsc.LocationStatus = (int)LocationStatusEnum.Free; + //鏇存柊鐘舵�佷负浠诲姟鍙栨秷 + UpdateTaskStatus(task.TaskId, task.TaskState); + _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍑哄簱浠诲姟鍙栨秷"); + _locationInfoRepository.UpdateData(locationsrc); + _locationInfoRepository.UpdateData(locationdsc); + isBack = true; + } + else + { + return WebResponseContent.Instance.Error($"涓婃枡浠诲姟涓嶅厑璁″彇娑堬紒"); + } + } + else + { + return WebResponseContent.Instance.Error($"璇ヤ换鍔$姸鎬佷笉鍏佽鍙栨秷锛�"); + } + } + + + + //浠诲姟鍙栨秷鍥炶皟MES + if (isBack) + { + MESSendCMD sendcmd = new MESSendCMD { cmd = 201, task_id = task.TaskNum, status = 3 }; + MESResponse res = ApiInvoke.SendTaskCMD(sendcmd); + if (res != null && res.code != 0) + { + ServiceLogger.WriteDebug("ForceCompleteTask", $"浠诲姟鍙栨秷鍥炰紶MES澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵res.message}銆�"); + content = WebResponseContent.Instance.Error($"浠诲姟鍙栨秷鍥炰紶MES澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵res.message}銆�"); + } + else + { + ServiceLogger.WriteDebug("ForceCompleteTask", $"浠诲姟鍙栨秷鍥炰紶MES鎴愬姛锛�,浠诲姟鍙�:銆恵taskNum}銆�"); + content = WebResponseContent.Instance.Error($"浠诲姟鍙栨秷鍥炰紶MES鎴愬姛锛�,浠诲姟鍙�:銆恵taskNum}銆�"); + } + } + else + { + + } + + } + catch (Exception ex) + { + content = WebResponseContent.Instance.Error(ex.Message); + } + return content; } @@ -872,18 +1114,33 @@ _unitOfWorkManage.CommitTran(); //鍑哄簱瀹屾垚锛屽洖浼燱MS //鍥炰紶鍒癢MS - MESSendCMD sendcmd = new MESSendCMD { cmd = 201, task_id = task.TaskNum, status = 6 }; - MESResponse res = ApiInvoke.SendTaskCMD(sendcmd); - if (res != null && res.code != 0) + if (task.TaskType == (int)TaskOutboundTypeEnum.OutPick) { - ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"澶у爢鍨涙満瀹屾垚鍑哄簱浠诲姟鍚庡洖浼燤ES澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵res.message}銆�"); - content = WebResponseContent.Instance.Error($"澶у爢鍨涙満瀹屾垚鍑哄簱浠诲姟鍚庡洖浼燤ES澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵res.message}銆�"); + MESSendCMD sendcmd = new MESSendCMD { cmd = 201, task_id = task.TaskNum, status = 6 }; + 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 + { + MESSendCMD sendcmd = new MESSendCMD { cmd = 201, task_id = task.TaskNum, status = 6 }; + 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}銆�"); + } } } catch (Exception ex) { _unitOfWorkManage.RollbackTran(); + //浠诲姟鎵ц澶辫触锛岃揣浣嶇姸鎬佽繕鍘� ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"澶у爢鍨涙満鎵ц鍑哄簱浠诲姟澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵ex.Message}銆�"); content = WebResponseContent.Instance.Error($"澶у爢鍨涙満鎵ц鍑哄簱浠诲姟澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵ex.Message}銆�"); } @@ -982,7 +1239,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; @@ -1002,44 +1259,45 @@ 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 }; - string inparam2 = JsonConvert.SerializeObject(send); - ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"灏忓爢鍨涙満鎵ц鍑哄簱浠诲姟鍥炰紶MES鍏ュ弬{inparam2}"); - ApiInvoke.DeliveryPlanCMD(send);//鍥炶皟MES鎺ュ彛鐢熸垚绌鸿溅鍑哄簱浠诲姟 - //鎵�鏈夌殑灞傛暟閮藉彇瀹岋紝闇�瑕佹妸鏆傚瓨浣嶇姸鎬佹敼涓虹┖闂茬姸鎬� - srcLocation.LocationStatus = (int)LocationStatusEnum.Free; - _locationInfoRepository.UpdateData(srcLocation); - } + //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.Message}銆�"); + ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"灏忓爢鍨涙満鎵ц鍑哄簱浠诲姟澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵ex.StackTrace}銆�"); content = WebResponseContent.Instance.Error($"灏忓爢鍨涙満鎵ц鍑哄簱浠诲姟澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵ex.Message}銆�"); } @@ -1060,6 +1318,8 @@ return content; } + + /// <summary> /// 鎭㈠鎸傝捣浠诲姟 /// </summary> -- Gitblit v1.9.3