From 9ce6731460179c71f0f2c636b2a1598324d5194e Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期六, 20 九月 2025 15:16:48 +0800 Subject: [PATCH] 最新代码更新 --- 项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/原料库/StackerCraneJob_YLSC3.cs | 59 ++++++++++++++++++++++++++++------------------------------- 1 files changed, 28 insertions(+), 31 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/StackerCraneJob_YLSC3.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/StackerCraneJob_YLSC3.cs" index 7d04c5c..53c4a8d 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/StackerCraneJob_YLSC3.cs" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/StackerCraneJob_YLSC3.cs" @@ -76,8 +76,8 @@ commonStackerCrane.LastTaskType = task.TaskType; task.Dispatchertime = DateTime.Now; task.ExceptionMessage = ""; - //_taskService.UpdateTask(task, TaskStatusEnum.SC_Executing); - _taskService.UpdateTaskStatusToNext(task); + _taskService.UpdateTask(task, TaskStatusEnum.SC_Executing); + //_taskService.UpdateTaskStatusToNext(task); commonStackerCrane.Communicator.Write("DB1000.20.0", true); //寤舵椂1s Thread.Sleep(1000); @@ -141,33 +141,20 @@ //鍘熸枡涓�妤煎嚭搴撲笅鍙戠嚎浣撻�昏緫 if (stationManger.StationDeviceCode == "CL1_YL") { - IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); - if (device != null) - { - OtherDevice conveyorLine = (OtherDevice)device; - conveyorLine.SetValue(ConveyorLineDBName.TaskNum, taskNum, stationManger.StationCode); - conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, router.NextPosi, stationManger.StationCode); - conveyorLine.SetValue(ConveyorLineDBName.ResponState, 86, stationManger.StationCode); - - // 鍫嗗灈鏈哄畬鎴� - _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: stationManger.StationDeviceCode, currentAddress: stationManger.StationCode, nextAddress: router.NextPosi); - } - else - { - WriteInfo(deviceCode, $"鏈壘鍒板嚭搴撶珯鍙般�恵stationManger.StationDeviceCode}銆戝搴旂殑閫氳瀵硅薄锛屾棤娉曞彂閫佽緭閫佺嚎鍑哄簱淇″彿"); - _taskService.UpdateTaskExceptionMessage(taskNum, $"鏈壘鍒板嚭搴撶珯鍙般�恵stationManger.StationDeviceCode}銆戝搴旂殑閫氳瀵硅薄锛屾棤娉曞彂閫佽緭閫佺嚎鍑哄簱淇″彿"); - return WebResponseContent.Instance.Error($"鏈壘鍒板嚭搴撶珯鍙般�恵stationManger.StationDeviceCode}銆戝搴旂殑閫氳瀵硅薄锛屾棤娉曞彂閫佽緭閫佺嚎鍑哄簱淇″彿"); - } - }//鍘熸枡浜屾ゼ鍑哄簱涓嬪彂绾夸綋閫昏緫 - else + // 鍫嗗灈鏈哄畬鎴� + _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: stationManger.StationDeviceCode, currentAddress: stationManger.StationCode, nextAddress: router.NextPosi); + } + else//鍘熸枡浜屾ゼ鍑哄簱涓嬪彂绾夸綋閫昏緫 { IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); if (device != null) { CommonConveyorLine conveyorLine = (CommonConveyorLine)device; - conveyorLine.SetValue(WR_CLineYLDB.WR_Task, taskNum, stationManger.StationCode); - conveyorLine.SetValue(WR_CLineYLDB.WR_ToHode, router.NextPosi, stationManger.StationCode); - conveyorLine.SetValue(WR_CLineYLDB.WR_Reresult, 86, stationManger.StationCode); + conveyorLine.SetValue(ConveyorLineDBName.TaskNum, taskNum, stationManger.StationCode); + conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, router.NextPosi, stationManger.StationCode); + conveyorLine.SetValue(ConveyorLineDBName.Width, task.TaskLength, stationManger.StationCode); + conveyorLine.SetValue(ConveyorLineDBName.Barcode, task.PalletCode, stationManger.StationCode); + conveyorLine.SetValue(ConveyorLineDBName.ResponState, 86, stationManger.StationCode); _taskService.UpdateTaskStatusToNext(task); } else @@ -295,6 +282,11 @@ _taskRepository.UpdateData(task); return task; } + else + { + task.ExceptionMessage = "鍑哄簱绔欏彴鏃犳硶涓嬪彂"; + _taskRepository.UpdateData(task); + } } else { @@ -313,6 +305,11 @@ task.NextAddress = stationManger.StackerCraneStationCode; _taskRepository.UpdateData(task); return task; + } + else + { + task.ExceptionMessage = "鍑哄簱绔欏彴鏃犳硶涓嬪彂"; + _taskRepository.UpdateData(task); } } else @@ -340,9 +337,9 @@ { YLStackerCraneTaskCommand stackerCraneTaskCommand = new YLStackerCraneTaskCommand(); + stackerCraneTaskCommand.PalletType = Convert.ToInt16(task.PalletType); stackerCraneTaskCommand.TaskNum = task.TaskNum; stackerCraneTaskCommand.WorkType = 5; - stackerCraneTaskCommand.PalletType = Convert.ToInt16(task.PalletType); if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//鍒ゆ柇鏄惁鏄叆搴撲换鍔� { @@ -377,9 +374,9 @@ string[] targetCodes = task.NextAddress.Split("-"); if (targetCodes.Length == 3) { - stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[1]); - stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[2]); - stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[3]); + stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); + stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); + stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); } else { @@ -390,9 +387,9 @@ string[] sourceCodes = task.CurrentAddress.Split("-"); if (sourceCodes.Length == 5) { - stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]); - stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]); - stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]); + stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[1]); + stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[2]); + stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[3]); } else { -- Gitblit v1.9.3