From 14aaca9a2e1da2849d602487a52094ee26bbe30a Mon Sep 17 00:00:00 2001 From: duyongjia <adu_555@163.com> Date: 星期二, 03 十二月 2024 13:40:41 +0800 Subject: [PATCH] 生产试运行稳定版本提交 --- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 40 ++++++++++++++++++++++++++++++++++++---- 1 files changed, 36 insertions(+), 4 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 dd4bf5a..6984990 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" @@ -42,6 +42,7 @@ using WIDESEAWCS_ITaskInfoRepository; using WIDESEAWCS_ITaskInfoService; using WIDESEAWCS_Model.Models; +using WIDESEAWCS_QuartzJob; using WIDESEAWCS_QuartzJob.Models; using WIDESEAWCS_QuartzJob.Service; @@ -210,7 +211,7 @@ if (taskinfo != null) { UpdateTaskStatus(taskinfo.TaskId, (int)TaskInStatusEnum.AGV_InExecuting); - _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"AGV鍏ュ簱鎵ц涓�"); + _taskExecuteDetailService.AddTaskExecuteDetail(taskinfo.TaskId, $"AGV鍏ュ簱鎵ц涓�"); ServiceLogger.WriteDebug("ReceiveTask", $"AGV鍏ュ簱鎵ц涓紙鑷姩3001锛夋洿鏂扮姸鎬佹垚鍔燂紝浠诲姟鍙凤細{taskinfo.TaskId}"); return content = WebResponseContent.Instance.OK($"AGV鍏ュ簱鎵ц涓紙鑷姩3001锛夋洿鏂扮姸鎬佹垚鍔燂紝浠诲姟鍙凤細{taskinfo.TaskId}"); } @@ -226,7 +227,7 @@ { //鏇存柊浠诲姟琛ㄤ腑NextAddress瀛楁涓烘柊鐨勪换鍔″彿 taskDTO.weight-鏃х殑浠诲姟鍙� taskDTO.task_id-鏂扮殑浠诲姟鍙� UpdateTaskStatus(taskinfo.TaskId, taskDTO.task_id, (int)TaskInStatusEnum.AGV_InFinish); - _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"AGV鎼繍瀹屾垚"); + _taskExecuteDetailService.AddTaskExecuteDetail(taskinfo.TaskId, $"AGV鎼繍瀹屾垚"); ServiceLogger.WriteDebug("ReceiveTask", $"AGV鎼繍瀹屾垚锛�101锛夋洿鏂扮姸鎬佹垚鍔燂紝浠诲姟鍙凤細{taskinfo.TaskId}"); return content = WebResponseContent.Instance.OK($"AGV鎼繍瀹屾垚锛�101锛夋洿鏂扮姸鎬佹垚鍔燂紝浠诲姟鍙凤細{taskinfo.TaskId}"); } @@ -241,6 +242,10 @@ task.TaskType= (int)TaskRelocationTypeEnum.Relocation; task.TaskState = (int)TaskOutStatusEnum.OutNew; task.Roadway = "SC01"; + if (taskDTO.total > 0) + { + task.Remark = taskDTO.total.ToString();//鍙栧嚭搴撶殑鎬诲眰鏁� + } task.Grade = 1; break; case 102: @@ -586,6 +591,15 @@ } /// <summary> + /// 鏌ヨ绉诲簱浠诲姟 + /// </summary> + /// <returns></returns> + public Dt_Task QueryStackerCraneTaskByRelotion(int taskNum) + { + return BaseDal.QueryFirst(x => (x.Roadway == "SC01" )&&x.TaskType==(int)TaskRelocationTypeEnum.Relocation && x.TaskNum==taskNum, TaskOrderBy); + } + + /// <summary> /// 鏌ヨ灏忓爢鍨涙満鍑哄簱瀹屾垚浠诲姟 /// </summary> /// <returns></returns> @@ -749,7 +763,7 @@ { if (task.TaskState == (int)TaskOutStatusEnum.SC_OutExecuting) { - + if (task.TaskType == (int)TaskOutboundTypeEnum.OutInventory || task.TaskType == (int)TaskOutboundTypeEnum.OutPick)//寮傚父鍑哄簱 绌鸿溅鍑哄簱 { task.TaskState = (int)TaskOutStatusEnum.OutFinish; @@ -1176,7 +1190,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}銆�"); } @@ -1225,6 +1239,24 @@ ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"澶у爢鍨涙満瀹屾垚鍑哄簱浠诲姟鍚庡洖浼燤ES澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵res.message}銆�"); content = WebResponseContent.Instance.Error($"澶у爢鍨涙満瀹屾垚鍑哄簱浠诲姟鍚庡洖浼燤ES澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵res.message}銆�"); } + //if(task.TaskType== (int)TaskRelocationTypeEnum.Relocation&&!string.IsNullOrEmpty(task.Remark.Trim()))//鍑哄簱浠诲姟鍐欐�诲眰鏁版爣璇� + //{ + // CommonStackerCrane commonStackerCrane = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "SC01") as CommonStackerCrane; + // //鏍规嵁浠诲姟婧愬湴鍧�纭畾鍐欏叆PLC浣嶇疆 Depth + // Dt_LocationInfo location = _locationInfoRepository.QueryFirst(x => x.LocationCode == task.TargetAddress); + // if (commonStackerCrane!=null&&location != null) + // { + // bool issuccess = commonStackerCrane.Communicator.Write<short>("DB28." + location.Depth + ".0", 9); + // if (issuccess) + // { + // ServiceLogger.WriteDebug("TaskService", $"鍘熸枡鍑哄簱鍚庡啓鍏ユ爣璇嗘垚鍔燂紒"); + // } + // else + // { + // ServiceLogger.WriteDebug("TaskService", $"鍘熸枡鍑哄簱鍚庡啓鍏ユ爣璇嗗け璐ワ紒"); + // } + // } + //} } catch (Exception ex) -- Gitblit v1.9.3